wintest: make IPv6 optional in wintest
authorAndrew Tridgell <tridge@samba.org>
Fri, 26 Nov 2010 00:33:10 +0000 (11:33 +1100)
committerAndrew Tridgell <tridge@samba.org>
Fri, 26 Nov 2010 02:08:21 +0000 (03:08 +0100)
we need some more work on IPv6 support in s4 before this works

wintest/conf/abartlet.conf
wintest/conf/tridge.conf
wintest/test-s4-howto.py

index 3fa450173929e1edca74a8b8076e69d13bcd9a3b..f775c81b3afe0b71421ed1f1cb065e8a5522fc7c 100644 (file)
@@ -19,7 +19,6 @@ INTERFACE            : virbr0:0
 # this is an additional IP that will be used for named to listen
 # on. It should not be the primary IP of the interface
 INTERFACE_IP          : 192.168.122.2
-INTERFACE_IPV6        : 3ffe:ffff:0:f101::3
 INTERFACE_NET         : 192.168.122.2/24
 
 # how to run bind9
index a2bad630a26587675a6b3d7fe5ab10b9478039a9..1c7ed0bda744a0f22efa10d97deaea4176b005e9 100644 (file)
@@ -19,7 +19,6 @@ INTERFACE             : virbr0:0
 # this is an additional IP that will be used for named to listen
 # on. It should not be the primary IP of the interface
 INTERFACE_IP         : 10.0.0.2
-INTERFACE_IPV6        : 3ffe:ffff:0:f101::3
 INTERFACE_NET        : 10.0.0.2/24
 
 # how to run bind9
index d12968c50ff8784af09cfd262b39548cdd256bff..a1a211f8ae02d3e638efae56ea20b3b8856ebd66 100755 (executable)
@@ -13,8 +13,9 @@ def check_prerequesites(t):
         raise Exception("You must run this script as root")
     t.putenv("KRB5_CONFIG", '${PREFIX}/private/krb5.conf')
     t.run_cmd('ifconfig ${INTERFACE} ${INTERFACE_NET} up')
-    t.run_cmd('ifconfig ${INTERFACE} inet6 del ${INTERFACE_IPV6}/64', checkfail=False)
-    t.run_cmd('ifconfig ${INTERFACE} inet6 add ${INTERFACE_IPV6}/64 up')
+    if t.getvar('INTERFACE_IPV6'):
+        t.run_cmd('ifconfig ${INTERFACE} inet6 del ${INTERFACE_IPV6}/64', checkfail=False)
+        t.run_cmd('ifconfig ${INTERFACE} inet6 add ${INTERFACE_IPV6}/64 up')
 
 
 def build_s4(t):
@@ -133,10 +134,16 @@ def restart_bind(t):
         raise RuntimeError("old /etc/resolv.conf must not contain %s as a nameserver, this will create loops with the generated dns configuration" % nameserver)
     t.setvar('DNSSERVER', nameserver)
 
+    if t.getvar('INTERFACE_IPV6'):
+        ipv6_listen = 'listen-on-v6 port 53 { ${INTERFACE_IPV6}; };'
+    else:
+        ipv6_listen = ''
+    t.setvar('BIND_LISTEN_IPV6', ipv6_listen)
+
     t.write_file("etc/named.conf", '''
 options {
        listen-on port 53 { ${INTERFACE_IP};  };
-       listen-on-v6 port 53 { ${INTERFACE_IPV6}; };
+       ${BIND_LISTEN_IPV6}
        directory       "${PREFIX}/var/named";
        dump-file       "${PREFIX}/var/named/data/cache_dump.db";
        pid-file        "${PREFIX}/var/named/named.pid";
@@ -494,7 +501,7 @@ def join_as_dc(t, vm):
     child = t.open_telnet("${WIN_HOSTNAME}", "${WIN_DOMAIN}\\administrator", "${WIN_PASS}", set_time=True)
     t.get_ipconfig(child)
     t.retry_cmd("bin/samba-tool drs showrepl ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator%${WIN_PASS}", ['INBOUND NEIGHBORS'] )
-    t.run_cmd('bin/samba-tool join ${WIN_REALM} DC -Uadministrator%${WIN_PASS} -d${DEBUGLEVEL} --option=interfaces="${INTERFACE} ${INTERFACE_IPV6"')
+    t.run_cmd('bin/samba-tool join ${WIN_REALM} DC -Uadministrator%${WIN_PASS} -d${DEBUGLEVEL} --option=interfaces=${INTERFACE}')
     t.run_cmd('bin/samba-tool drs kcc ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator@${WIN_REALM}%${WIN_PASS}')
 
 
@@ -563,7 +570,7 @@ def join_as_rodc(t, vm):
     child = t.open_telnet("${WIN_HOSTNAME}", "${WIN_DOMAIN}\\administrator", "${WIN_PASS}", set_time=True)
     t.get_ipconfig(child)
     t.retry_cmd("bin/samba-tool drs showrepl ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator%${WIN_PASS}", ['INBOUND NEIGHBORS'] )
-    t.run_cmd('bin/samba-tool join ${WIN_REALM} RODC -Uadministrator%${WIN_PASS} -d${DEBUGLEVEL} --option=interfaces="${INTERFACE} ${INTERFACE_IPV6}"')
+    t.run_cmd('bin/samba-tool join ${WIN_REALM} RODC -Uadministrator%${WIN_PASS} -d${DEBUGLEVEL} --option=interfaces=${INTERFACE}')
     t.run_cmd('bin/samba-tool drs kcc ${WIN_HOSTNAME}.${WIN_REALM} -Uadministrator@${WIN_REALM}%${WIN_PASS}')