diff --git a/xCAT-test/autotest/testcase/dhcptest/dhcpfixture.sh b/xCAT-test/autotest/testcase/dhcptest/dhcpfixture.sh index 503b29af7..47f400b51 100755 --- a/xCAT-test/autotest/testcase/dhcptest/dhcpfixture.sh +++ b/xCAT-test/autotest/testcase/dhcptest/dhcpfixture.sh @@ -301,6 +301,10 @@ do_check() { } do_setup() { + # A second setup over a live fixture would save the fixture's own dhcpd.conf + # and site table as the originals, so teardown would restore them instead of + # what was there first. Refuse rather than leave the machine in that state. + [ -d "$STATE" ] && die "a fixture is already up; run '$0 teardown' first" mkdir -p "$STATE" || die "cannot create $STATE" # Recorded before it is changed, so teardown is exact rather than a guess. diff --git a/xCAT-test/autotest/testcase/provtest/provfixture.sh b/xCAT-test/autotest/testcase/provtest/provfixture.sh index fbfa78696..77ca62965 100755 --- a/xCAT-test/autotest/testcase/provtest/provfixture.sh +++ b/xCAT-test/autotest/testcase/provtest/provfixture.sh @@ -463,6 +463,11 @@ define_node() { do_setup() { local tmpl http dns tftp + # A second setup over a live fixture would overwrite the record teardown + # restores from -- the site table, /etc/hosts, the name server's + # configuration -- and orphan the veth and the namespace it no longer knows + # about. Refuse rather than leave the machine in that state. + [ -d "$STATE" ] && die "a fixture is already up; run '$0 teardown' first" mkdir -p "$STATE" || die "cannot create $STATE" : > "$STATE/files"; : > "$STATE/dirs" : > "$STATE/nodes"; : > "$STATE/osimages"; : > "$STATE/services"