diff options
Diffstat (limited to 'tools/xm-test')
-rw-r--r-- | tools/xm-test/Writing_Tests_HOWTO | 14 | ||||
-rw-r--r-- | tools/xm-test/configure.ac | 16 | ||||
-rw-r--r-- | tools/xm-test/lib/XmTestLib/NetConfig.py | 9 | ||||
-rw-r--r-- | tools/xm-test/tests/restore/04_restore_withdevices_pos.py | 8 | ||||
-rw-r--r-- | tools/xm-test/tests/xapi/03_xapi-network_pos.py | 8 |
5 files changed, 24 insertions, 31 deletions
diff --git a/tools/xm-test/Writing_Tests_HOWTO b/tools/xm-test/Writing_Tests_HOWTO index 84cc90e2c6..379b0b145c 100644 --- a/tools/xm-test/Writing_Tests_HOWTO +++ b/tools/xm-test/Writing_Tests_HOWTO @@ -104,12 +104,14 @@ routing environments in the future, the current xm-test only supports a bridging environment. Xm-test currently only supports a range of IPs, the dhcp feature will be added soon. -The network tests will need to know what IPs to use. IPs are configured -when you build xm-test. Xm-test uses the zeroconf address range by -default, 169.254.0.1-169.254.255.255. If you'd like to set a new range, -do so at configure time, a netmask and network address must also be defined: - - # ./configure --with-net-ip-range=192.168.1.1-192.168.1.100 --with-network-address=192.168.1.0 --with-netmask=255.255.255.0 +The network tests will need to know what IPs to use. IPs are +configured when you build xm-test. Xm-test by default a range chosen +at random from the RFC1918 private use space, and published at +www.ucam.org/cam-grin, 172.30.206.1-172.30.206.254 from +172.30.206.0/24. If you'd like to set a new range, do so at configure +time, a netmask and network address must also be defined: + + # ./configure --with-net-ip-range=192.0.2.1-192.0.2.100 --with-network-address=192.0.2.0 --with-netmask=255.255.255.0 The tests will not need to set network information, this is done by the library once it's configured. diff --git a/tools/xm-test/configure.ac b/tools/xm-test/configure.ac index bbc639bdb0..a92b6daa6b 100644 --- a/tools/xm-test/configure.ac +++ b/tools/xm-test/configure.ac @@ -56,24 +56,24 @@ else fi # Network needs to know ips to use: dhcp or a range of IPs in the form -# of: 192.168.1.1-192.168.1.100 +# of: 192.0.2.1-192.0.2.100 # If not dhcp, a netmask and network address must be supplied. Defaults to -# zeroconf range. -NET_IP_RANGE="169.254.0.1-169.254.255.255" +# range allocated in www.ucam.org/cam-grin. +NET_IP_RANGE="172.30.206.1-172.30.206.254" AC_ARG_WITH(net-ip-range, - [ --with-net-ip-range=ip-range Set a range of ip addresses to use for xm-test guest domain networks. Can specify dhcp or a range of IPs: 192.168.1.1-192.168.1.100 [[default="169.254.0.1-169.254.255.255"]]], + [ --with-net-ip-range=ip-range Set a range of ip addresses to use for xm-test guest domain networks. Can specify dhcp or a range of IPs: 192.0.2.1-192.0.2.100 [[default="172.30.206.1-172.30.206.254"]]], [ NET_IP_RANGE="$withval" ]) iprange=`echo $NET_IP_RANGE | perl -e 'while(<>) { print if /\d+\.\d+\.\d+\.\d+-\d+\.\d+\.\d+\.\d+/ }'` -NETWORK_ADDRESS="169.254.0.0" +NETWORK_ADDRESS="172.30.206.0" AC_ARG_WITH(network-address, - [ --with-network-address=ip Set network address to use with ip range [[default="169.254.0.0"]]], + [ --with-network-address=ip Set network address to use with ip range [[default="172.30.206.0"]]], [ NETWORK_ADDRESS="$withval" ]) -NETMASK="255.255.0.0" +NETMASK="255.255.255.0" AC_ARG_WITH(netmask, - [ --with-netmask=mask Set netmask to use with ip range [[default="255.255.0.0"]]], + [ --with-netmask=mask Set netmask to use with ip range [[default="255.255.255.0"]]], [ NETMASK="$withval" ]) if test "x$NET_IP_RANGE" != "xdhcp" && test -z "$iprange" diff --git a/tools/xm-test/lib/XmTestLib/NetConfig.py b/tools/xm-test/lib/XmTestLib/NetConfig.py index 919af65fdb..0c39969806 100644 --- a/tools/xm-test/lib/XmTestLib/NetConfig.py +++ b/tools/xm-test/lib/XmTestLib/NetConfig.py @@ -69,12 +69,6 @@ def getXendNetConfig(): configfile.close() return netenv -def checkZeroconfAddresses(): - # Make sure there aren't existing zeroconf addresses. - rc, out = traceCommand("ip addr show |grep \"inet 169.254\" | grep eth0") - if rc == 0: - raise NetworkError("Zeroconf addresses already used: %s" % out) - class NetConfig: def __init__(self): @@ -101,9 +95,6 @@ class NetConfig: self.__setMaxNumberIPs() - if self.network == "169.254.0.0": - checkZeroconfAddresses() - # Clean out any aliases in the network range for dom0's interface. # If an alias exists, a test xendevice add command could fail. if NETWORK_IP_RANGE != "dhcp": diff --git a/tools/xm-test/tests/restore/04_restore_withdevices_pos.py b/tools/xm-test/tests/restore/04_restore_withdevices_pos.py index 63b716da62..a7a67f7c93 100644 --- a/tools/xm-test/tests/restore/04_restore_withdevices_pos.py +++ b/tools/xm-test/tests/restore/04_restore_withdevices_pos.py @@ -48,11 +48,11 @@ try: if run["return"] != 0: FAIL("Unable to write to block device hdb2!") - run = console.runCmd("ifconfig eth0 169.254.0.1 netmask 255.255.255.0") + run = console.runCmd("ifconfig eth0 172.30.206.1 netmask 255.255.255.240") if run["return"] != 0: FAIL("Unable to configure DomU's eth0") - run = console.runCmd("ifconfig eth1 169.254.1.1 netmask 255.255.255.0") + run = console.runCmd("ifconfig eth1 172.30.206.17 netmask 255.255.255.240") if run["return"] != 0: FAIL("Unable to configure DomU's eth1") @@ -114,11 +114,11 @@ try: run = console.runCmd("ifconfig") if not re.search("eth0", run["output"]): FAIL("DomU's eth0 disappeared") - if not re.search("169.254.0.1", run["output"]): + if not re.search("172.30.206.1", run["output"]): FAIL("DomU's eth0 lost its IP") if not re.search("eth1", run["output"]): FAIL("DomU's eth1 disappeared") - if not re.search("169.254.1.1", run["output"]): + if not re.search("172.30.206.17", run["output"]): FAIL("DomU's eth1 lost its IP") if not re.search("Loopback", run["output"]): FAIL("DomU's lo disappeared") diff --git a/tools/xm-test/tests/xapi/03_xapi-network_pos.py b/tools/xm-test/tests/xapi/03_xapi-network_pos.py index 43ea82691d..9ae2daea1b 100644 --- a/tools/xm-test/tests/xapi/03_xapi-network_pos.py +++ b/tools/xm-test/tests/xapi/03_xapi-network_pos.py @@ -39,18 +39,18 @@ if status: # Configure IP addresses on two domains try: # Run 'ls' - run = console1.runCmd("ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up") - run = console2.runCmd("ifconfig eth0 192.168.0.2 netmask 255.255.255.0 up") + run = console1.runCmd("ifconfig eth0 172.30.206.1 netmask 255.255.255.0 up") + run = console2.runCmd("ifconfig eth0 172.30.206.2 netmask 255.255.255.0 up") except ConsoleError, e: saveLog(console.getHistory()) FAIL(str(e)) # Now ping... try: - run = console1.runCmd("ping -c 4 192.168.0.2") + run = console1.runCmd("ping -c 4 172.30.206.2") if run['return'] > 0: FAIL("Could not ping other host") - run = console2.runCmd("ping -c 4 192.168.0.1") + run = console2.runCmd("ping -c 4 172.30.206.1") if run['return'] > 0: FAIL("Could not pint other host") except ConsoleError, e: |