wintest Wipe the BIND data directory just before we restart bind
authorAndrew Bartlett <abartlet@samba.org>
Tue, 30 Nov 2010 23:07:38 +0000 (10:07 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 1 Dec 2010 05:09:59 +0000 (16:09 +1100)
This will hopefully mean we don't end up with stale zone info in the
new server.

Andrew Bartlett

wintest/test-s4-howto.py

index 588fcbe..99e11d7 100755 (executable)
@@ -141,8 +141,6 @@ def restart_bind(t):
     t.putenv('KEYTAB_FILE', '${PREFIX}/private/dns.keytab')
     t.putenv('KRB5_KTNAME', '${PREFIX}/private/dns.keytab')
     t.chdir('${PREFIX}')
     t.putenv('KEYTAB_FILE', '${PREFIX}/private/dns.keytab')
     t.putenv('KRB5_KTNAME', '${PREFIX}/private/dns.keytab')
     t.chdir('${PREFIX}')
-    t.run_cmd("mkdir -p var/named/data")
-    t.run_cmd("chown -R ${BIND_USER} var/named")
 
     nameserver = t.get_nameserver()
     if nameserver == t.getvar('INTERFACE_IP'):
 
     nameserver = t.get_nameserver()
     if nameserver == t.getvar('INTERFACE_IP'):
@@ -225,6 +223,11 @@ options {
 
     rndc_cmd(t, "stop", checkfail=False)
     t.port_wait("${INTERFACE_IP}", 53, wait_for_fail=True)
 
     rndc_cmd(t, "stop", checkfail=False)
     t.port_wait("${INTERFACE_IP}", 53, wait_for_fail=True)
+
+    t.run_cmd("rm -rf var/named")
+    t.run_cmd("mkdir -p var/named/data")
+    t.run_cmd("chown -R ${BIND_USER} var/named")
+
     t.bind_child = t.run_child("${BIND9} -u ${BIND_USER} -n 1 -c ${PREFIX}/etc/named.conf -g")
 
     t.port_wait("${INTERFACE_IP}", 53)
     t.bind_child = t.run_child("${BIND9} -u ${BIND_USER} -n 1 -c ${PREFIX}/etc/named.conf -g")
 
     t.port_wait("${INTERFACE_IP}", 53)