From 55b84e5530ea10063da1750a2855cd4821b32236 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sun, 13 Sep 2026 20:53:41 -0300 Subject: [PATCH 1/3] test(xcat-core): the Ubuntu node netplan discards the DHCP search domain The netplan xCAT writes for a compute node sets dhcp4: true and nothing else, so systemd-networkd keeps its UseDomains default of no. The node takes the DNS server from DHCP and drops the offered domain-search, and no single-label name resolves on the installed node. Assert the rendered netplan asks networkd to use the DHCP domains. The assertion runs the template's own late-command, so it reads the file the installer writes, not the template text. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/ubuntu_subiquity_installnic.t | 13 +++++++++++-- xCAT-test/unit/ubuntu_subiquity_template.t | 3 ++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/xCAT-test/unit/ubuntu_subiquity_installnic.t b/xCAT-test/unit/ubuntu_subiquity_installnic.t index 83d5ee498..876915e9a 100644 --- a/xCAT-test/unit/ubuntu_subiquity_installnic.t +++ b/xCAT-test/unit/ubuntu_subiquity_installnic.t @@ -98,7 +98,7 @@ $tmpl_path = "$FindBin::Bin/../../xCAT-server/share/xcat/install/ubuntu/compute. unless -f $tmpl_path; SKIP: { - skip 'compute.subiquity.tmpl not found', 4 unless -f $tmpl_path; + skip 'compute.subiquity.tmpl not found', 6 unless -f $tmpl_path; my $tmpl = do { local $/; open my $fh, '<', $tmpl_path or die $!; <$fh> }; # The netplan-writing part of late-commands, verbatim: from the resolved values down to the @@ -106,7 +106,7 @@ SKIP: { my ($snippet) = $tmpl =~ /(installnic="#SUBIQUITYINSTALLNIC#".*?fi;)/s; ok($snippet, 'the netplan late-command is rendered from the resolved values'); - skip 'netplan late-command not found in the template', 3 unless $snippet; + skip 'netplan late-command not found in the template', 5 unless $snippet; $snippet =~ s/''/'/g; # undo the YAML single-quote escaping for my $case ( @@ -132,9 +132,18 @@ SKIP: { ' match:', qq( macaddress: "$case->{mac}"), ($case->{setname} ne '' ? " set-name: $case->{setname}" : ()), ' dhcp4: true', + ' dhcp4-overrides:', + ' use-domains: true', ); is($netplan, join("\n", @expected) . "\n", "the netplan written for $case->{name} matches the resolved values"); + + # systemd-networkd defaults UseDomains to no, so a netplan carrying dhcp4: true alone + # takes the DNS server from DHCP and drops the offered domain-search. The node then + # resolves no single-label name: updateflag.awk runs "$MASTER 3002" with the short + # management node name, cannot resolve it, and the node never leaves postbooting. + like($netplan, qr/^\s+use-domains: true$/m, + "the netplan for $case->{name} asks networkd to use the DHCP search domain"); } } diff --git a/xCAT-test/unit/ubuntu_subiquity_template.t b/xCAT-test/unit/ubuntu_subiquity_template.t index ecff4688e..466e8ae21 100644 --- a/xCAT-test/unit/ubuntu_subiquity_template.t +++ b/xCAT-test/unit/ubuntu_subiquity_template.t @@ -59,10 +59,11 @@ unlike($tmpl, qr/tr ''A-F'' ''a-f''/, 'the shell no longer normalizes the MAC (Template.pm resolves mac.mac entries)'); unlike($tmpl, qr/cut -d''\|'' -f1/, 'the shell no longer splits mac.mac entries (Template.pm resolves them for this node)'); -like($tmpl, qr/printf ''%s\\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \\"\$\{installmac\}\\"" " set-name: \$\{installnic\}" " dhcp4: true" >\/target\/etc\/netplan\/00-xcat-install\.yaml;/, 'target netplan printf stays on one shell line'); +like($tmpl, qr/printf ''%s\\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \\"\$\{installmac\}\\"" " set-name: \$\{installnic\}" " dhcp4: true" " dhcp4-overrides:" " use-domains: true" >\/target\/etc\/netplan\/00-xcat-install\.yaml;/, 'target netplan printf stays on one shell line'); like($tmpl, qr/" macaddress: \\"\$\{installmac\}\\""/, 'target netplan matches by MAC address'); like($tmpl, qr/" set-name: \$\{installnic\}"/, 'target netplan sets the expected installnic name'); like($tmpl, qr/"\s+dhcp4: true"/, 'target netplan enables DHCPv4 on installnic'); +like($tmpl, qr/"\s+use-domains: true"/, 'target netplan takes the search domain DHCP offers, so short names resolve on the node'); like($tmpl, qr/printf ''%s\\n'' ''#HOSTNAME#'' >\/target\/etc\/hostname/, 'template writes target hostname before disabling cloud-init'); like($tmpl, qr/sed -i ''s\/\^127\\\.0\\\.1\\\.1\.\*\/127\.0\.1\.1 #HOSTNAME#\/'' \/target\/etc\/hosts/, 'template updates target hosts entry for hostname'); like($tmpl, qr/touch \/target\/etc\/cloud\/cloud-init\.disabled/, 'target cloud-init is disabled after target netplan is written'); From 840a6c56c6129319281c7181567155c963721e16 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Sun, 13 Sep 2026 20:54:51 -0300 Subject: [PATCH 2/3] fix(xcat-core): a compute node cannot resolve the management node by short name On Ubuntu 26.04 the installed compute node keeps systemd-resolved, which takes the DNS server from DHCP and no search domain, so /etc/resolv.conf reads "search .". mypostscript then runs "updateflag.awk $MASTER 3002" with the short management node name, the flag update fails eleven times, and the node stays at postbooting until retry_install.sh gives up. The management node does offer domain-search; the node discards it. compute.subiquity.tmpl writes /target/etc/netplan/00-xcat-install.yaml with dhcp4: true alone, so systemd-networkd applies its UseDomains default of no. Add dhcp4-overrides: use-domains: true to both branches, the one that renames the interface and the one that matches by MAC alone. ubuntu_subiquity_installnic.t runs the template's own late-command and asserts the netplan it writes carries the setting. It fails without this change. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl b/xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl index 328ccd258..39cbc5496 100644 --- a/xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl +++ b/xCAT-server/share/xcat/install/ubuntu/compute.subiquity.tmpl @@ -90,9 +90,9 @@ autoinstall: installmac="#SUBIQUITYINSTALLMAC#"; mkdir -p /target/etc/netplan; if [ -z "${installnic}" ]; then - printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " dhcp4: true" >/target/etc/netplan/00-xcat-install.yaml; + printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " dhcp4: true" " dhcp4-overrides:" " use-domains: true" >/target/etc/netplan/00-xcat-install.yaml; else - printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " set-name: ${installnic}" " dhcp4: true" >/target/etc/netplan/00-xcat-install.yaml; + printf ''%s\n'' "network:" " version: 2" " ethernets:" " xcat-install:" " match:" " macaddress: \"${installmac}\"" " set-name: ${installnic}" " dhcp4: true" " dhcp4-overrides:" " use-domains: true" >/target/etc/netplan/00-xcat-install.yaml; fi; chmod 600 /target/etc/netplan/00-xcat-install.yaml; printf ''%s\n'' ''#HOSTNAME#'' >/target/etc/hostname; From b0f87b2b9913e8d590cdf75bc38da534176c1e4d Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Mon, 14 Sep 2026 08:34:35 -0300 Subject: [PATCH 3/3] style(xcat-core): the netplan test comment traces the failure across four layers The comment on the use-domains assertion in ubuntu_subiquity_installnic.t followed the missing search domain from systemd-networkd through updateflag.awk to a node stuck in postbooting. The assertion below it already names what is checked. The comment now carries the one fact the code does not show: networkd defaults UseDomains to no. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- xCAT-test/unit/ubuntu_subiquity_installnic.t | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/xCAT-test/unit/ubuntu_subiquity_installnic.t b/xCAT-test/unit/ubuntu_subiquity_installnic.t index 876915e9a..fe6b24079 100644 --- a/xCAT-test/unit/ubuntu_subiquity_installnic.t +++ b/xCAT-test/unit/ubuntu_subiquity_installnic.t @@ -139,9 +139,7 @@ SKIP: { "the netplan written for $case->{name} matches the resolved values"); # systemd-networkd defaults UseDomains to no, so a netplan carrying dhcp4: true alone - # takes the DNS server from DHCP and drops the offered domain-search. The node then - # resolves no single-label name: updateflag.awk runs "$MASTER 3002" with the short - # management node name, cannot resolve it, and the node never leaves postbooting. + # drops the search domain DHCP offers, and no single-label name resolves on the node. like($netplan, qr/^\s+use-domains: true$/m, "the netplan for $case->{name} asks networkd to use the DHCP search domain"); }