[igt-dev] [PATCH i-g-t 2/5] xe/xe_sysfs_scheduler: Try to set sysfs scheduler with default min

priyanka.dandamudi at intel.com priyanka.dandamudi at intel.com
Fri Aug 4 05:10:12 UTC 2023


From: Priyanka Dandamudi <priyanka.dandamudi at intel.com>

Test tries to set sysfs scheduler with default min which is beyond local min
and assert is expected to be not equal to the set one.

v2: Added code to store and restore property in test min/max.(Tejas)

Signed-off-by: Priyanka Dandamudi <priyanka.dandamudi at intel.com>
Reviewed-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
---
 tests/xe/xe_sysfs_scheduler.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/tests/xe/xe_sysfs_scheduler.c b/tests/xe/xe_sysfs_scheduler.c
index 2a113ea0f..7a190f3d3 100644
--- a/tests/xe/xe_sysfs_scheduler.c
+++ b/tests/xe/xe_sysfs_scheduler.c
@@ -59,7 +59,7 @@ static void test_min_max(int xe, int engine, const char **property)
 {
 	unsigned int default_max, max;
 	unsigned int default_min, min;
-	unsigned int set;
+	unsigned int set, store;
 	int defaults;
 
 	defaults = openat(engine, ".defaults", O_DIRECTORY);
@@ -67,6 +67,7 @@ static void test_min_max(int xe, int engine, const char **property)
 
 	igt_sysfs_scanf(defaults, property[2], "%u", &default_max);
 	igt_sysfs_scanf(defaults, property[1], "%u", &default_min);
+	igt_sysfs_scanf(engine, property[0], "%u", &store);
 
 	igt_sysfs_printf(engine, property[2], "%d", default_max-10);
 	igt_sysfs_scanf(engine, property[2], "%u", &max);
@@ -94,13 +95,14 @@ static void test_min_max(int xe, int engine, const char **property)
 
 	igt_sysfs_printf(engine, property[0], "%d", default_min);
 	igt_sysfs_scanf(engine, property[0], "%u", &set);
-	igt_assert_eq(set, default_min);
+	igt_assert_neq(set, default_min);
 
 	igt_sysfs_printf(engine, property[0], "%d", min);
 	igt_sysfs_scanf(engine, property[0], "%u", &set);
 	igt_assert_eq(set, min);
 
-	/* Reset max, min to original values */
+	/* Reset property, max, min to original values */
+	igt_sysfs_printf(engine, property[0], "%d", store);
 	igt_sysfs_printf(engine, property[1], "%d", default_min);
 	igt_sysfs_printf(engine, property[2], "%d", default_max);
 }
-- 
2.25.1



More information about the igt-dev mailing list