Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Smitha Balasubramanyam <smitha.balasubramanyam@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH] tests/intel: ctx_restore rollback on invalid input
Date: Mon, 20 Apr 2026 12:08:16 +0530	[thread overview]
Message-ID: <20260420063816.1054855-1-smitha.balasubramanyam@intel.com> (raw)

Add a test vector with a partially invalid second command in the
ctx_restore_*_bb invalid-case suite to ensure a malformed multi-line
BB is rejected and the stored BB remains empty (rollback).

Replaced the hardcoded "ctx_restore_post_bb" write with the computed
file name ("ctx_restore_%s_bb") in test_ctx_restore_invalid so the
invalid-case tests work for both "post" and "mid" variants.

Signed-off-by: Smitha Balasubramanyam <smitha.balasubramanyam@intel.com>
---
 tests/intel/xe_configfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/intel/xe_configfs.c b/tests/intel/xe_configfs.c
index 755524e7c..97ea95da8 100644
--- a/tests/intel/xe_configfs.c
+++ b/tests/intel/xe_configfs.c
@@ -225,12 +225,16 @@ static void test_ctx_restore_invalid(int configfs_device_fd, const char *type)
 		{ .test = "invalid-engine-instance",
 		  .in = "rcs0 reg 4F100 DEADBEEF",
 		},
+		{ .test = "invalid-second-command",
+			.in = "rcs cmd 11000001 4F100 DEADBEEF\n"
+				"rcs cmd 11000001 4F10G DEADBEEF",
+		},
 	};
 	char buf[4096] = { };
 	char file[64] = { };
 
 	snprintf(file, sizeof(file), "ctx_restore_%s_bb", type);
-	igt_sysfs_set(configfs_device_fd, "ctx_restore_post_bb", "");
+	igt_sysfs_set(configfs_device_fd, file, "");
 
 	/*
 	 * These only test if command parsing is correct,
-- 
2.43.0


             reply	other threads:[~2026-04-20  6:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20  6:38 Smitha Balasubramanyam [this message]
2026-04-20 18:12 ` [PATCH] tests/intel: ctx_restore rollback on invalid input Kamil Konieczny
2026-04-20 18:25 ` Kamil Konieczny
2026-04-21 15:27 ` ✓ i915.CI.BAT: success for " Patchwork
2026-04-21 16:05 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-21 18:39 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-21 21:15 ` ✓ i915.CI.Full: success " Patchwork
2026-04-22  9:15 ` [PATCH v2] tests/intel/xe_configfs: ctx_restore_*_bb " Smitha Balasubramanyam
2026-04-22 14:54   ` Kamil Konieczny
2026-04-22 10:34 ` ✓ i915.CI.BAT: success for tests/intel: ctx_restore rollback on invalid input (rev2) Patchwork
2026-04-22 10:48 ` ✓ Xe.CI.BAT: " Patchwork
2026-04-22 14:26 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-04-23  9:55 ` ✗ i915.CI.Full: " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2026-04-20  4:57 [PATCH 0/2] Negative tests for VM_BIND decompression Smitha Balasubramanyam
2026-05-27  5:01 ` [PATCH] tests/intel: ctx_restore rollback on invalid input Smitha Balasubramanyam

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=20260420063816.1054855-1-smitha.balasubramanyam@intel.com \
    --to=smitha.balasubramanyam@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox