All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anshuman Gupta <anshuman.gupta@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: petri.latvala@intel.com
Subject: [igt-dev] [PATCH i-g-t v3 2/2] test/perf_pmu: Change module unload assertion
Date: Tue, 22 Feb 2022 19:38:38 +0530	[thread overview]
Message-ID: <20220222140838.21823-3-anshuman.gupta@intel.com> (raw)
In-Reply-To: <20220222140838.21823-1-anshuman.gupta@intel.com>

Update the module unload assertion values according to
to returned values from igt_i915_driver_unload() and
__igt_i915_driver_unload() instead of IGT process exit
values.

v2:
- Use igt_assert_neq(__igt_i915_driver_unload(NULL), 0). [Petri]
v3:
- Use igt_assert(ret !=0 && !(strcmp(who, "i915"))). [Ashutosh]

Signed-off-by: Anshuman Gupta <anshuman.gupta@intel.com>
---
 tests/i915/perf_pmu.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/tests/i915/perf_pmu.c b/tests/i915/perf_pmu.c
index 4f3cb6145..c48cc07df 100644
--- a/tests/i915/perf_pmu.c
+++ b/tests/i915/perf_pmu.c
@@ -2046,7 +2046,8 @@ static void test_unload(unsigned int num_engines)
 		const struct intel_execution_engine2 *e;
 		int fd[4 + num_engines * 3], i;
 		uint64_t *buf;
-		int count = 0;
+		int count = 0, ret;
+		const char *who;
 		int i915;
 
 		i915 = __drm_open_driver(DRIVER_INTEL);
@@ -2101,7 +2102,8 @@ static void test_unload(unsigned int num_engines)
 
 		igt_debug("Read %d events from perf and trial unload\n", count);
 		pmu_read_multi(fd[0], count, buf);
-		igt_assert_eq(__igt_i915_driver_unload(NULL), IGT_EXIT_SKIP);
+		ret = __igt_i915_driver_unload(&who);
+		igt_assert(ret != 0 && !strcmp(who, "i915"));
 		pmu_read_multi(fd[0], count, buf);
 
 		igt_debug("Close perf\n");
@@ -2114,7 +2116,7 @@ static void test_unload(unsigned int num_engines)
 	igt_waitchildren();
 
 	igt_debug("Final unload\n");
-	igt_assert_eq(__igt_i915_driver_unload(NULL), IGT_EXIT_SUCCESS);
+	igt_assert_eq(__igt_i915_driver_unload(NULL), 0);
 }
 
 #define test_each_engine(T, i915, ctx, e) \
@@ -2394,7 +2396,7 @@ igt_main
 	}
 
 	igt_subtest("module-unload") {
-		igt_require(igt_i915_driver_unload() == IGT_EXIT_SUCCESS);
+		igt_require(igt_i915_driver_unload() == 0);
 		for (int pass = 0; pass < 3; pass++)
 			test_unload(num_engines);
 	}
-- 
2.26.2

  parent reply	other threads:[~2022-02-22 14:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-22 14:08 [igt-dev] [PATCH i-g-t v3 0/2] Avoid process exit return values in igt_kmod Anshuman Gupta
2022-02-22 14:08 ` [igt-dev] [PATCH i-g-t v3 1/2] lib/igt_kmod: Don't use process exit return value Anshuman Gupta
2022-02-22 14:08 ` Anshuman Gupta [this message]
2022-02-22 17:17   ` [igt-dev] [PATCH i-g-t v3 2/2] test/perf_pmu: Change module unload assertion Dixit, Ashutosh
2022-02-22 17:30 ` [igt-dev] ✓ Fi.CI.BAT: success for Avoid process exit return values in igt_kmod (rev3) Patchwork
2022-02-22 21:56 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220222140838.21823-3-anshuman.gupta@intel.com \
    --to=anshuman.gupta@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.