From 68075b6b44d31ea1ac833d714658b4d35fe0d327 Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Fri, 11 Sep 2026 10:40:38 -0300 Subject: [PATCH] fix(provtest): give makedns a name it can resolve for this machine makedns looks up the server of each zone it writes and qualifies it with site.domain. On a cluster whose networks name their server as that name is this machine's own, inside the fixture's domain, which nothing resolves -- so makedns failed and every wire case died in setup. It passed where the other networks name no server and the lookup fell back to site.nameservers, an address. Add the qualified name to /etc/hosts, which teardown already restores. --- .../autotest/testcase/provtest/provfixture.sh | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xCAT-test/autotest/testcase/provtest/provfixture.sh b/xCAT-test/autotest/testcase/provtest/provfixture.sh index 77ca62965..418efe31a 100755 --- a/xCAT-test/autotest/testcase/provtest/provfixture.sh +++ b/xCAT-test/autotest/testcase/provtest/provfixture.sh @@ -461,6 +461,19 @@ define_node() { echo "$name" >> "$STATE/nodes" } +# This machine's own name under the fixture's domain, resolvable. Only the +# qualified name is added: the short one is whatever the machine already +# answers to, and shadowing it would change what every other lookup returns. +mn_hosts_entry() { + local short addr + short=$(hostname -s) || die "cannot read this machine's hostname" + addr=$(getent ahostsv4 "$(hostname)" 2>/dev/null | awk '{print $1; exit}') + [ -n "$addr" ] || addr=$(hostname -I 2>/dev/null | awk '{print $1}') + [ -n "$addr" ] || die "cannot find an address for $short" + printf '%s %s.%s\n' "$addr" "$short" "$DOMAIN" >> /etc/hosts \ + || die "cannot add $short.$DOMAIN to /etc/hosts" +} + do_setup() { local tmpl http dns tftp # A second setup over a live fixture would overwrite the record teardown @@ -580,6 +593,13 @@ do_setup() { || die "makehosts failed" echo done > "$STATE/hostsadded" + # makedns names each zone's server and qualifies it with site.domain, so on + # a cluster whose networks name theirs as the name it looks up + # is this machine's own, inside the fixture's domain -- which nothing + # resolves, and makedns fails before writing a record. Give it that name. + # /etc/hosts is saved above and put back by teardown. + mn_hosts_entry || return 1 + do_generate || return 1 say "fixture is up on $IF_SRV/$IF_CLI, node $NODE at $NODE_IP"