From 5d3c40b5a24229b2c838bb33927b24575baa9465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vin=C3=ADcius=20Ferr=C3=A3o?= <2031761+viniciusferrao@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:04:26 -0300 Subject: [PATCH] test(enablekdump): pin options that merely end in root= Add foo-root=bar and rd.foo.root=bar to the legacy migration fixture and assert both survive intact. Against the word-boundary strip these assertions fail with the tokens truncated to foo- and rd.foo.; the existing second-run check keeps covering them through both executions. --- xCAT-test/unit/enablekdump_per_node.t | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xCAT-test/unit/enablekdump_per_node.t b/xCAT-test/unit/enablekdump_per_node.t index 54802817a..087cf8736 100644 --- a/xCAT-test/unit/enablekdump_per_node.t +++ b/xCAT-test/unit/enablekdump_per_node.t @@ -109,7 +109,7 @@ sub write_file { # line, so leaving the legacy value behind would defeat the migration. { my $legacy = qq{KDUMP_COMMANDLINE=""\n} - . qq{KDUMP_COMMANDLINE_APPEND="root=nfs:10.0.0.1:/dumparea rd.neednet=1 rootflags=nofail"\n}; + . qq{KDUMP_COMMANDLINE_APPEND="root=nfs:10.0.0.1:/dumparea rd.neednet=1 rootflags=nofail foo-root=bar rd.foo.root=bar"\n}; my $r = run_enablekdump(osver => 'rhels7.9', node => 'n07', sysconfig => $legacy); @@ -122,6 +122,10 @@ sub write_file { 'unrelated options on the legacy line are preserved'); like($append, qr{(?:^|\s)rootflags=nofail(?:\s|$)}, 'rootflags= is not mistaken for a root= token'); + like($append, qr{(?:^|\s)foo-root=bar(?:\s|$)}, + 'a root= suffix after a dash is not stripped'); + like($append, qr{(?:^|\s)rd\.foo\.root=bar(?:\s|$)}, + 'a root= suffix after a dot is not stripped'); # Re-running against its own output must not stack another root=. my $r2 = run_enablekdump(osver => 'rhels7.9', node => 'n07',