From 2107bd6069f6781cb7cf693bb9f4f1195b09aa53 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 30 Oct 2026 10:01:30 -0300 Subject: [PATCH] fix(xcat-core): chtab receives only the first setting of a [Table_*] value With [Table_vm] othersettings=cpumode:host-passthrough;firmware:efi-secureboot, xcattest gives chtab only cpumode:host-passthrough, and bash runs firmware:efi-secureboot as a command. The environment setup then fails. chtab_command joined its words unquoted, and xcattest runs the command through /bin/bash -c. chtab_command now quotes every word, the row selector included, with the same _quote that chdef_command uses. xcattest_conf_chtab_command.t passes with this change and fails 3 of 4 checks on the previous commit. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/lib/xCAT/Test/Conf.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-test/lib/xCAT/Test/Conf.pm b/xCAT-test/lib/xCAT/Test/Conf.pm index 8a9f649b60..b5e74e7177 100644 --- a/xCAT-test/lib/xCAT/Test/Conf.pm +++ b/xCAT-test/lib/xCAT/Test/Conf.pm @@ -130,6 +130,9 @@ sub chdef_command { Descriptions: The chtab command that applies one row of a [Table_*] block. + xcattest runs every command through /bin/bash -c, so each word is quoted, the row + selector too. A vm.othersettings value carries a semicolon. + The assignments are sorted, so one conf builds one command. Arguments: $table - the table name, as the section name spells it @@ -150,7 +153,7 @@ sub chtab_command { my $value = defined $attrs->{$attr} ? $attrs->{$attr} : ''; push @words, "$table.$attr=$value"; } - return join ' ', 'chtab', @words; + return join ' ', 'chtab', map { _quote($_) } @words; } #-------------------------------------------------------------------------------