From f0519021734828a6f68ce0a848b9cc9190be52cf Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:34:14 -0300 Subject: [PATCH] test(xcat-core): capture Subiquity install failing when installnic is unset The Ubuntu diskful (Subiquity) install fails on any node that does not set noderes.installnic. compute.subiquity.tmpl resolves #TABLE:noderes:$NODE:installnic#, and Template.pm's tabdb raises "Unable to find requested field from table " when the value is absent, aborting with "Failed to generate xnba configurations" so the compute node never enters the installer. EL and SLES pass the identical case because their statefull templates never reference installnic (gen_net_boot_params defaults to the boot MAC). Assert that the template uses the non-fatal #TABLEBLANKOKAY# token for installnic and treats an empty installnic the same as "mac" (match by MAC, no NIC rename). These assertions fail on the current template, capturing the defect. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/ubuntu_subiquity_template.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/xCAT-test/unit/ubuntu_subiquity_template.t b/xCAT-test/unit/ubuntu_subiquity_template.t index 2af9692aa..77f80a356 100644 --- a/xCAT-test/unit/ubuntu_subiquity_template.t +++ b/xCAT-test/unit/ubuntu_subiquity_template.t @@ -36,7 +36,20 @@ unlike($tmpl, qr/echo.*GRUB_CMDLINE.*\\"/, 'no escaped double quotes in echo GRU unlike($tmpl, qr/\\\\x22/, 'template does not rely on non-portable printf hex escapes'); like($tmpl, qr/printf ''%s\\n'' ''GRUB_CMDLINE_LINUX="#TABLEBLANKOKAY:bootparams:\$NODE:kcmdline#"''/, 'GRUB line uses portable printf quoting'); like($tmpl, qr/\/target\/etc\/netplan\/00-xcat-install\.yaml/, 'template writes an xCAT-owned target netplan file'); -like($tmpl, qr/installnic="#TABLE:noderes:\$NODE:installnic#"/, 'target netplan uses node installnic'); +# Regression: an UNSET noderes.installnic must not fatally break Subiquity xnba +# generation. The EL/SLES statefull templates never reference installnic, so they default +# gracefully; this template resolved #TABLE:noderes:$NODE:installnic#, and Template.pm's tabdb +# raises "Unable to find requested field from table " -> "Failed to +# generate xnba configurations" when the node carries no installnic value, so the Ubuntu +# diskful install never starts. The template must use the non-fatal #TABLEBLANKOKAY# token +# (renders blank when unset) and treat an empty installnic the same as "mac" -- match by MAC +# with no NIC rename, which is the EL-equivalent default. +unlike($tmpl, qr/installnic="#TABLE:noderes:\$NODE:installnic#"/, + 'installnic does NOT use the fatal #TABLE# token (it errors when installnic is unset)'); +like($tmpl, qr/installnic="#TABLEBLANKOKAY:noderes:\$NODE:installnic#"/, + 'installnic uses the non-fatal #TABLEBLANKOKAY# token so an unset installnic renders blank'); +like($tmpl, qr/if \[ "\$\{installnic\}" = "mac" \] \|\| \[ -z "\$\{installnic\}" \]; then/, + 'an empty installnic is handled like "mac" (match by MAC, no set-name rename)'); like($tmpl, qr/installmac="#TABLE:mac:\$NODE:mac#"/, 'target netplan uses node MAC'); like($tmpl, qr/installmac="\$\(printf ''%s'' "\$\{installmac\}".*\| tr ''A-F'' ''a-f''\)"/, 'target netplan normalizes MAC case'); like($tmpl, qr/installmac="\$\(printf ''%s'' "\$\{installmac\}" \| cut -d''\|'' -f1 \| cut -d''!'' -f1/, 'target netplan strips mac table suffixes before matching');