From patchwork Mon Jul 22 08:01:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 13738503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 11430C3DA59 for ; Mon, 22 Jul 2024 08:10:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61BCE10E3EA; Mon, 22 Jul 2024 08:10:01 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="fm8/hZNQ"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7DD8F10E3D6; Mon, 22 Jul 2024 08:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721635792; x=1753171792; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ODZXMYLmiFFHmtAzIZpP3BQe3sXwxAmu56gFHFKGPbM=; b=fm8/hZNQmzaAvfSczEauXkS/b6O3iiUznoY+b9hqdSdMSLp18+lYuaF1 ELYd4fMFYZd72FM1moDLATwR4QsB8dWQNeXtVcJXA4iS/cTUvU+wJztId rpCNUCu/o80AJEx3mY+zrVoVcGcHqsJ5fHoHEqmcXEgxvbsEOwGHVd310 QS5SIN+ALmTHg6dAWBu8X3pee0u1hnTxOmakGOaNSxOVfQWB5r+VQNz/9 EqCtDTEE3xW/UivRYxLs5mRzfz/P0s2I+7M6Yhp6TaHr8/KN1GqsPLcqh pbOQP6XpDcwmBwzAcKPLQSzTVpwYby5+VTUE9Sw7gT5dVYpDQb/cZtCxY w==; X-CSE-ConnectionGUID: RFLqqMFrTReJ+4bieuKMBw== X-CSE-MsgGUID: LuWZoQqgTueYCNrn2X1qig== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="19037719" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="19037719" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:09:49 -0700 X-CSE-ConnectionGUID: iyOiezTRTx2cJaQjmGHc3g== X-CSE-MsgGUID: PotItiAzTR6cS35eJ+DL3A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51463640" Received: from jkrzyszt-mobl2.ger.corp.intel.com ([10.245.246.233]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:09:46 -0700 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Kamil Konieczny , =?utf-8?q?Zbigniew_Kempc?= =?utf-8?q?zy=C5=84ski?= , Janusz Krzysztofik Subject: [PATCH i-g-t 1/3] lib/kunit: Fix selective execution of test cases Date: Mon, 22 Jul 2024 10:01:02 +0200 Message-ID: <20240722080913.74333-6-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722080913.74333-5-janusz.krzysztofik@linux.intel.com> References: <20240722080913.74333-5-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" An issue has been discovered when running an IGT kunit test with a dynamic sub-subtest specified: only the first kunit test case of a test suite can be actually executed. Selecting a test case other than the first one results in "Unloading test module failed, not executing more selftests." message being displayed and no single test case (dynamic sub-subtest) executed. To avoid the failure from a consecutive module unload attempt after it has been already unloaded, unload the test module neither after geting a list of test cases, nor after each leaving of igt_dynamic() section, only as a first step of each dynamic sub-subtest body. Reported-by: Zbigniew Kempczyński Signed-off-by: Janusz Krzysztofik Reviewed-by: Zbigniew Kempczyński --- lib/igt_kmod.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c index 33f059199f..5864be29d2 100644 --- a/lib/igt_kmod.c +++ b/lib/igt_kmod.c @@ -1328,8 +1328,6 @@ static bool kunit_get_tests(struct igt_list_head *tests, igt_require_f(r->code == IGT_EXIT_SKIP, "Unexpected non-SKIP result while listing test cases\n"); - igt_skip_on(kmod_module_remove_module(tst->kmod, 0)); - return true; } @@ -1356,6 +1354,8 @@ static void __igt_kunit(struct igt_ktest *tst, char glob[1024]; int i; + igt_skip_on(kmod_module_remove_module(tst->kmod, + KMOD_REMOVE_FORCE)); igt_skip_on(igt_kernel_tainted(&taints)); igt_assert_lt(snprintf(glob, sizeof(glob), "%s.%s", @@ -1412,12 +1412,6 @@ static void __igt_kunit(struct igt_ktest *tst, igt_info("Kernel tainted, not executing more selftests.\n"); break; } - - if (igt_debug_on(kmod_module_remove_module(tst->kmod, - KMOD_REMOVE_FORCE))) { - igt_info("Unloading test module failed, not executing more selftests.\n"); - break; - } } } From patchwork Mon Jul 22 08:01:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 13738502 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 15983C3DA5D for ; Mon, 22 Jul 2024 08:09:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B97210E3D6; Mon, 22 Jul 2024 08:09:57 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="Z7Rw5vvh"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id A1B1710E3D7; Mon, 22 Jul 2024 08:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721635792; x=1753171792; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=fnWo+3DxJtgEREL+rRh2TqwDy6ap/DF0XPUC9cq4jdM=; b=Z7Rw5vvhotqzwYz0x9QEG7RMsh3COe4ByNVG8aLFHYIS/1zv7mnf2b/S 01074vxWF0HCccstCFXBu6uV9HvfO0PWUBcD0IZHTLIzIQWRtgKPBWaPN meUtI6dzOR7194oL0URmkbWMqBK0A3KVwKi5weAlHF/1nU4+B6DBapuzE 0ZoWEkshIq/Ivvg4+t9HU3j5wxoy2snaYBeeLtFoRQU5ban8jcffYGgv9 hpPnwr3hMCuriy7COieH/VsrSTRT7cmriNZUYaXP+9LZfq4GwJuurepi9 X8qaH4ALz/EYRm9CRipRdQON2gzssC0j+RZqa3S71i6KAyeLh1hl87o5u w==; X-CSE-ConnectionGUID: JXlCDoYpS3m7K1MBxWvImA== X-CSE-MsgGUID: cslEncK6SM+brn8rbi3vng== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="19037722" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="19037722" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:09:51 -0700 X-CSE-ConnectionGUID: JPLXEuxVTG268D/o6WzGgA== X-CSE-MsgGUID: fySyE+1MSMa+F6NEl1tzHg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51463666" Received: from jkrzyszt-mobl2.ger.corp.intel.com ([10.245.246.233]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:09:49 -0700 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Kamil Konieczny , =?utf-8?q?Zbigniew_Kempc?= =?utf-8?q?zy=C5=84ski?= , Janusz Krzysztofik Subject: [PATCH i-g-t 2/3] lib/kunit: Drop 'suite' from __igt_kunit arguments list Date: Mon, 22 Jul 2024 10:01:03 +0200 Message-ID: <20240722080913.74333-7-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722080913.74333-5-janusz.krzysztofik@linux.intel.com> References: <20240722080913.74333-5-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" The optional 'suite' argument was used as a KUnit filter_glob when we were loading KUnit test module once per IGT subtest. Since we are now loading the module once per IGT dynamic sub-subtest, we use test_suite.test_case obtained from a list of test cases as filter_glob. Drop the no longer used argument. Signed-off-by: Janusz Krzysztofik Reviewed-by: Zbigniew Kempczyński --- lib/igt_kmod.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c index 5864be29d2..a13c6fe063 100644 --- a/lib/igt_kmod.c +++ b/lib/igt_kmod.c @@ -1333,7 +1333,6 @@ static bool kunit_get_tests(struct igt_list_head *tests, static void __igt_kunit(struct igt_ktest *tst, const char *subtest, - const char *suite, const char *opts, const char *debugfs_path, struct igt_list_head *tests, @@ -1486,7 +1485,7 @@ void igt_kunit(const char *module_name, const char *suite, const char *opts) !kunit_get_tests(&tests, &tst, suite, opts, debugfs_path, &debugfs_dir, &ktap)) __igt_kunit_legacy(&tst, subtest, opts); else - __igt_kunit(&tst, subtest, suite, opts, debugfs_path, &tests, &ktap); + __igt_kunit(&tst, subtest, opts, debugfs_path, &tests, &ktap); } igt_fixture { From patchwork Mon Jul 22 08:01:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Janusz Krzysztofik X-Patchwork-Id: 13738504 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A63F8C3DA5D for ; Mon, 22 Jul 2024 08:10:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A6B210E3EE; Mon, 22 Jul 2024 08:10:35 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="bnmXtdqE"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) by gabe.freedesktop.org (Postfix) with ESMTPS id BB86110E3D6; Mon, 22 Jul 2024 08:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1721635794; x=1753171794; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Vi0K1DntkP/Tuz9xM7tuojD9fBCZDNTvlpfzPG+69dw=; b=bnmXtdqEOyAilB03sY6uG1cfkoDl7lxss6HsDbGLkjzRMS+cljVD9Cwi cabMWQwLOrmwwxK/t7Uf8ulPUY1A3vRzGfw6UOlOmEzoMfN4JOckjmuUK mvWrc04GYORmr0/dKHCIvkqIs3+jPVhF8ZIULJGQQR0ZuAf0+WBe076fh 11A5EUncmq299fptNozH9/uvB+PPSS1iJg5QIRii5qg4LyF02iovd4NUo srGMaIKp27cD+mzmvUS5TYjgCdX9fVyYQD5mPW8eHo2Jgms7ADf0cNgC7 3aurJ9tvoNV34YNUfjPZ97tP8A2kUaq3bbjiRgDzV37vhW06ubSby3+CB A==; X-CSE-ConnectionGUID: ZEGTXfTDTNyKiTPA9ZCtFg== X-CSE-MsgGUID: uPo3P+mWTWOqFrLP/RLu2g== X-IronPort-AV: E=McAfee;i="6700,10204,11140"; a="19037726" X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="19037726" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:09:54 -0700 X-CSE-ConnectionGUID: FOob59qsQeml7i5Hvth2qA== X-CSE-MsgGUID: UMbWChTQTqekg/EW3kfUoA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,227,1716274800"; d="scan'208";a="51463688" Received: from jkrzyszt-mobl2.ger.corp.intel.com ([10.245.246.233]) by fmviesa006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jul 2024 01:09:51 -0700 From: Janusz Krzysztofik To: igt-dev@lists.freedesktop.org Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, Kamil Konieczny , =?utf-8?q?Zbigniew_Kempc?= =?utf-8?q?zy=C5=84ski?= , Janusz Krzysztofik Subject: [PATCH i-g-t 3/3] lib/kunit: Improve a comment on action=list parameter Date: Mon, 22 Jul 2024 10:01:04 +0200 Message-ID: <20240722080913.74333-8-janusz.krzysztofik@linux.intel.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240722080913.74333-5-janusz.krzysztofik@linux.intel.com> References: <20240722080913.74333-5-janusz.krzysztofik@linux.intel.com> MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Emphasize the fact that test case list of unknown length we want to avoid parsing of is an unstructured free text list. Signed-off-by: Janusz Krzysztofik Reviewed-by: Zbigniew Kempczyński --- lib/igt_kmod.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c index a13c6fe063..464c0dcf48 100644 --- a/lib/igt_kmod.c +++ b/lib/igt_kmod.c @@ -1284,10 +1284,10 @@ static bool kunit_get_tests(struct igt_list_head *tests, /* * To get a list of test cases provided by a kunit test module, ask the * generic kunit module to respond with SKIP result for each test found. - * We could also use action=list kunit parameter to get the listing, - * however, parsing a KTAP report -- something that we already can do - * perfectly -- seems to be more safe than extracting a test case list - * of unknown length from /dev/kmsg. + * We could also try to use action=list kunit parameter to get the + * listing, however, parsing a structured KTAP report -- something that + * we already can do perfectly -- seems to be more safe than extracting + * a free text list of unknown length from /dev/kmsg. */ if (igt_debug_on(!kunit_set_filtering(suite, "module=none", "skip"))) return false;