From patchwork Tue Aug 29 21:25:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinay Belgaumkar X-Patchwork-Id: 9928343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 68E4B6022E for ; Tue, 29 Aug 2017 21:23:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B5D828A7C for ; Tue, 29 Aug 2017 21:23:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5017A28A7E; Tue, 29 Aug 2017 21:23:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E92F828A7C for ; Tue, 29 Aug 2017 21:23:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D9C476E142; Tue, 29 Aug 2017 21:22:43 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id E94216E142 for ; Tue, 29 Aug 2017 21:22:42 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2017 14:22:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,445,1498546800"; d="scan'208";a="305860900" Received: from vinaysim-desktop.fm.intel.com ([10.1.27.130]) by fmsmga004.fm.intel.com with ESMTP; 29 Aug 2017 14:22:41 -0700 From: Vinay Belgaumkar To: intel-gfx@lists.freedesktop.org Date: Tue, 29 Aug 2017 14:25:19 -0700 Message-Id: <1504041919-172350-1-git-send-email-vinay.belgaumkar@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [Intel-gfx] [PATCH i-g-t] tests/gem_flink_basic: Add documentation for subtests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Added the missing IGT_TEST_DESCRIPTION and some subtest descriptions. Signed-off-by: Vinay Belgaumkar --- tests/gem_flink_basic.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/gem_flink_basic.c b/tests/gem_flink_basic.c index 26ae7d6..8761e0d 100644 --- a/tests/gem_flink_basic.c +++ b/tests/gem_flink_basic.c @@ -36,6 +36,8 @@ #include #include "drm.h" +IGT_TEST_DESCRIPTION("Tests for flink - a way to export a gem object by name"); + static void test_flink(int fd) { @@ -155,14 +157,48 @@ igt_main igt_fixture fd = drm_open_driver(DRIVER_INTEL); + /* basic: + This subtest creates a gem object, and then creates + a flink. It tests that we can gain access to the gem + object using the flink name. + + Test fails if flink creation/open fails. + **/ igt_subtest("basic") test_flink(fd); + + /* double-flink: + This test checks if it is possible to create 2 flinks + for the same gem object. + + Test fails if 2 flink objects cannot be created. + **/ igt_subtest("double-flink") test_double_flink(fd); + + /* bad-flink: + Use an invalid flink handle. + + DRM_IOCTL_GEM_FLINK ioctl call should return failure. + **/ igt_subtest("bad-flink") test_bad_flink(fd); + + /* bad-open: + Try to use an invalid flink name. + + DRM_IOCTL_GEM_FLINK ioctl call should return failure. + **/ igt_subtest("bad-open") test_bad_open(fd); + + /* flink-lifetime: + Check if a flink name can be used even after the drm + fd used to create it is closed. + + Flink name should remain valid until the gem object + it points to has not been freed. + **/ igt_subtest("flink-lifetime") test_flink_lifetime(fd); }