From 2f5a4dbd3af0277814064181d007e8829a1eb598 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Wed, 14 Oct 2026 18:48:54 -0300 Subject: [PATCH] test(xcat-core): capture the empty candidate list of mysqlsetup mysqlsetup -i reports comment the bind-address line failed: cannot read : No such file or directory on every MySQL cluster, with no file named. Measured on xcat185-mn-tmp-84 through SN_setup_case, which then stops: the Kea configuration and the service node install never happen. @BIND_FILES is assigned by a top-level statement that sits below the main flow's exit, so the statement never runs and the list is empty at run time. $BIND_FILES[-1] is then undef. Each case in the test localizes the list, so none of them read the value the script itself holds. The test now asserts the list of the loaded script. 2 of its 15 checks fail on this commit. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/mysqlsetup_bind_address_label.t | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/xCAT-test/unit/mysqlsetup_bind_address_label.t b/xCAT-test/unit/mysqlsetup_bind_address_label.t index 562f4e1eab..dab748e531 100644 --- a/xCAT-test/unit/mysqlsetup_bind_address_label.t +++ b/xCAT-test/unit/mysqlsetup_bind_address_label.t @@ -29,6 +29,18 @@ my ($help, $load_error); die("Unable to load mysqlsetup: $load_error") unless ref($load_error) eq 'MysqlSetupTestExit' && $load_error->{status} == 0; +# THE SECOND DEFECT. The candidate list was a top-level statement below the +# main flow's exit, so it never ran and the list was empty at run time: every +# call reported "cannot read : No such file or directory". Each case below +# localizes the list, so only this check sees the loaded script's own value. +{ + no warnings 'once'; + ok(scalar(@main::BIND_FILES) > 0, 'the loaded script has candidate files'); + is_deeply([ @main::BIND_FILES ], + [ '/etc/mysql/mariadb.conf.d/50-server.cnf', '/etc/mysql/my.cnf', '/etc/my.cnf' ], + '... the three the POD names, in order'); +} + my $CONF = <<'CONF'; [mysqld] datadir=/var/lib/mysql