From 518ddee895eba091be1507d3f0ca57ba247ad6f9 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 30 Oct 2026 14:59:19 -0300 Subject: [PATCH] test(service-node): a check matches the path of the checkout it runs in service_node_artifacts_el.t asserts the EL service template is not a Subiquity one, and it matched the pattern against the whole absolute path. A checkout directory named for the thing under test therefore matched itself: in a worktree called ipv6-subiquity-net the check failed on share/xcat/install/rh/service.rhels9.tmpl, which is the right template. It now matches the basename. A real Subiquity template still fails it, and an EL one in a path carrying the word still passes. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/service_node_artifacts_el.t | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xCAT-test/unit/service_node_artifacts_el.t b/xCAT-test/unit/service_node_artifacts_el.t index e8d6c563b1..e7bbbbc0e5 100644 --- a/xCAT-test/unit/service_node_artifacts_el.t +++ b/xCAT-test/unit/service_node_artifacts_el.t @@ -113,7 +113,10 @@ my $tmpl = xCAT::SvrUtils::get_tmpl_file_name($SHARE . '/rh', $SN{profile}, $SN{ ok(defined $tmpl && length $tmpl, 'the EL service profile resolves a template at all') or diag('no template for ' . join(' ', @SN{qw(profile osver arch)})); like($tmpl, qr{/service[^/]*\.tmpl$}, '... and it is the service profile, not compute'); -unlike($tmpl, qr{subiquity}, '... and not a Subiquity template, which no EL node can boot'); +# The basename, not the whole path: the path carries the checkout directory, and a checkout +# named for the thing under test made this match itself. +unlike(( $tmpl =~ m{([^/]+)$} )[0] // $tmpl, qr{subiquity}, + '... and not a Subiquity template, which no EL node can boot'); # --------------------------------------------------------------------------- # 3. The NFS export. A service node with nfsserver=1 serves files. With site.installloc set it