tests/intel/xe_configfs: Test invalid engine with valid class
PATCH 1/2 tests/intel/xe_configfs: Test invalid engine with valid class
ctx_restore_* expects only the engine class. Pass in an invalid engine with a valid engine class to make sure it's correctly handled in the kernel.
--- tests/intel/xe_configfs.c | 3 +++ 1 file changed, 3 insertions(+)
tests/intel/xe_configfs.c +3 -0
@@ -177,6 +177,9 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) { .test = "invalid-reg-addr-only", .in = "rcs reg 4F100", }, + { .test = "invalid-engine-instance", + .in = "rcs0 reg 4F100 DEADBEEF", + }, };char buf[4096 ] = { };char file[64 ] = { };
Signature · 1 line
2.51.0
PATCH 2/2 tests/intel/xe_configfs: Check for invalid char in the beginning
The test was supposed to check the beginning and the end of the number, but was actually doing the same check (the end) twice. Fix it.
--- tests/intel/xe_configfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tests/intel/xe_configfs.c +3 -3
@@ -168,11 +168,11 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) { .test = "invalid-type", .in = "rcs 11000001 4F100 DEADBEEF", }, - { .test = "invalid-number", + { .test = "invalid-number-end", .in = "rcs cmd 1100000g 4F100 DEADBEEF", }, - { .test = "invalid-number", - .in = "rcs cmd 1100000g 4F100 DEADBEEF", + { .test = "invalid-number-start", + .in = "rcs cmd g1100000 4F100 DEADBEEF", }, { .test = "invalid-reg-addr-only", .in = "rcs reg 4F100",
Signature · 1 line
2.51.0
Re: [PATCH i-g-t 2/2] tests/intel/xe_configfs: Check for invalid char in the beginning
Hi Lucas,
Quoted 14 lines · Lucas De Marchi
The test was supposed to check the beginning and the end of the number, but was actually doing the same check (the end) twice. Fix it.
Signed-off-by Lucas De Marchi <[email protected]>--- tests/intel/xe_configfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tests/intel/xe_configfs.c +0
-0@@ -168,11 +168,11 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) { .test = "invalid-type",
tests/intel/xe_configfs.c static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) · line 175
Quoted 10 lines
tests/intel/xe_configfs.c +3
-3.in = "rcs 11000001 4F100 DEADBEEF", }, - { .test = "invalid-number", + { .test = "invalid-number-end", .in = "rcs cmd 1100000g 4F100 DEADBEEF", }, - { .test = "invalid-number", - .in = "rcs cmd 1100000g 4F100 DEADBEEF", + { .test = "invalid-number-start", + .in = "rcs cmd g1100000 4F100 DEADBEEF",
Looks good, what about invalid char in middle?
Quoted 6 lines
tests/intel/xe_configfs.c +0
-0}, { .test = "invalid-reg-addr-only", .in = "rcs reg 4F100",Signature · 1 line
2.51.0
Re: [PATCH i-g-t 2/2] tests/intel/xe_configfs: Check for invalid char in the beginning
Quoted 20 lines · Kamil Konieczny
Hi Lucas,
Quoted 18 lines · Lucas De Marchi
The test was supposed to check the beginning and the end of the number, but was actually doing the same check (the end) twice. Fix it.
Signed-off-by Lucas De Marchi <[email protected]>--- tests/intel/xe_configfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)tests/intel/xe_configfs.c +1
-1@@ -168,11 +168,11 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) { .test = "invalid-type", .in = "rcs 11000001 4F100 DEADBEEF", }, - { .test = "invalid-number", + { .test = "invalid-number-end",
Quoted 8 lines
tests/intel/xe_configfs.c static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) · line 175
Quoted 6 lines
tests/intel/xe_configfs.c +2
-2.in = "rcs cmd 1100000g 4F100 DEADBEEF", }, - { .test = "invalid-number", - .in = "rcs cmd 1100000g 4F100 DEADBEEF", + { .test = "invalid-number-start", + .in = "rcs cmd g1100000 4F100 DEADBEEF",Looks good, what about invalid char in middle?
yeah, makes sense... I added one additional test and sent a v2
Quoted 2 lines
Reviewed-by Kamil Konieczny <[email protected]>
thanks
Lucas De Marchi
-----Original Message-----
From: De Marchi, Lucas <[email protected]>
Sent: Wednesday, October 29, 2025 3:00 PM
To: [email protected]
Cc: Tauro, Riana <[email protected]>; De Marchi, Lucas <[email protected]>; Cavitt, Jonathan <[email protected]>
Subject: [PATCH i-g-t 1/2] tests/intel/xe_configfs: Test invalid engine with valid class
Quoted 7 lines
ctx_restore_* expects only the engine class. Pass in an invalid engine with a valid engine class to make sure it's correctly handled in the kernel.
Cc Jonathan Cavitt <[email protected]>Signed-off-by Lucas De Marchi <[email protected]>
-Jonathan Cavitt
Quoted 22 lines
--- tests/intel/xe_configfs.c | 3 +++ 1 file changed, 3 insertions(+)tests/intel/xe_configfs.c +3
-0@@ -177,6 +177,9 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type) { .test = "invalid-reg-addr-only", .in = "rcs reg 4F100", }, + { .test = "invalid-engine-instance", + .in = "rcs0 reg 4F100 DEADBEEF", + }, };char buf[4096 ] = { };char file[64 ] = { };Signature · 1 line
2.51.0