[libvirt] [TCK] [PATCH v2] Test cases for network ipv6 support

v2: - added test cases using 'ip addr ...' and 'ip route ...' commands This patch adds a couple of test cases for the recently added network ipv6 support. Signed-off-by: Stefan Berger<stefanb@us.ibm.com> --- scripts/networks/networkxml2hostout/tck-testnet-3.dat | 39 +++++++++++++ scripts/networks/networkxml2hostout/tck-testnet-3.post.dat | 14 ++++ scripts/networks/networkxml2xmlin/tck-testnet-3.xml | 22 +++++++ 3 files changed, 75 insertions(+) Index: libvirt-tck/scripts/networks/networkxml2xmlin/tck-testnet-3.xml =================================================================== --- /dev/null +++ libvirt-tck/scripts/networks/networkxml2xmlin/tck-testnet-3.xml @@ -0,0 +1,22 @@ +<network> +<name>tck-testnet</name> +<uuid>aadc8920-502a-4774-ac2b-cd382a204d06</uuid> +<bridge name="tck-testbr" /> +<forward mode="nat" /> +<ip address="10.1.2.1" netmask="255.255.255.0"> +<dhcp> +<range start="10.1.2.2" end="10.1.2.254" /> +<host mac="00:16:3e:77:e2:ed" name="a.example.com" ip="10.1.2.10" /> +<host mac="00:16:3e:3e:a9:1a" name="b.example.com" ip="10.1.2.11" /> +</dhcp> +</ip> +<ip family="ipv4" address="192.168.123.1" netmask="255.255.255.0"> +</ip> +<ip family="ipv6" address="2001:db8:ac10:fe01::1" prefix="64"> +</ip> +<ip family="ipv6" address="2001:db8:ac10:fd01::1" prefix="64"> +</ip> +<ip family="ipv4" address="10.24.10.1"> +</ip> +</network> + Index: libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.dat =================================================================== --- /dev/null +++ libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.dat @@ -0,0 +1,39 @@ +#iptables -t nat -L -n | grep ' 10\.1\.2\.' +MASQUERADE tcp -- 10.1.2.0/24 !10.1.2.0/24 masq ports: 1024-65535 +MASQUERADE udp -- 10.1.2.0/24 !10.1.2.0/24 masq ports: 1024-65535 +MASQUERADE all -- 10.1.2.0/24 !10.1.2.0/24 +#iptables -n -L FORWARD | grep ' 10\.1\.2\.' +ACCEPT all -- 0.0.0.0/0 10.1.2.0/24 state RELATED,ESTABLISHED +ACCEPT all -- 10.1.2.0/24 0.0.0.0/0 +#ip6tables -n -L FORWARD | grep ' 2001:db8:ac10' +ACCEPT all ::/0 2001:db8:ac10:fd01::/64 +ACCEPT all 2001:db8:ac10:fd01::/64 ::/0 +ACCEPT all ::/0 2001:db8:ac10:fe01::/64 +ACCEPT all 2001:db8:ac10:fe01::/64 ::/0 +#ps aux | sed -n '/dnsmasq .*10\.1\.2\./ s|.*\(dnsmasq [[:print:]*]\)|\1|p' +dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/tck-testnet.pid --conf-file= --listen-address 10.1.2.1 --except-interface lo --dhcp-range 10.1.2.2,10.1.2.254 --dhcp-lease-max=253 --dhcp-no-override +#ps aux | sed -n '/radvd --.*tck\-testnet\-/ s|.*\(radvd [[:print:]*]\)|\1|p' +radvd --debug 1 --config /var/lib/libvirt/radvd/tck-testnet-radvd.conf --pidfile /var/run/libvirt/network/tck-testnet-radvd.pid-bin +#route -n | grep '10\.1\.2\.' +10.1.2.0 0.0.0.0 255.255.255.0 U 0 0 0 tck-testbr +#route -n | grep '192\.168\.123\.' +192.168.123.0 0.0.0.0 255.255.255.0 U 0 0 0 tck-testbr +#route -n | grep '10\.0\.0\.0' +10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 tck-testbr +#brctl show | grep tck-testbr +tck-testbr 8000.000000000000 yes +#ifconfig tck-testbr | grep ':10\.1\.2\.' + inet addr:10.1.2.1 Bcast:10.1.2.255 Mask:255.255.255.0 +#ifconfig tck-testbr | grep 'inet6 addr: 2001' + inet6 addr: 2001:db8:ac10:fd01::1/64 Scope:Global + inet6 addr: 2001:db8:ac10:fe01::1/64 Scope:Global +#ip addr show tck-testbr | grep "inet " + inet 10.1.2.1/24 brd 10.1.2.255 scope global tck-testbr + inet 192.168.123.1/24 brd 192.168.123.255 scope global tck-testbr + inet 10.24.10.1/8 brd 10.255.255.255 scope global tck-testbr +#ip route show dev tck-testbr +10.1.2.0/24 proto kernel scope link src 10.1.2.1 +192.168.123.0/24 proto kernel scope link src 192.168.123.1 +10.0.0.0/8 proto kernel scope link src 10.24.10.1 +#virsh net-list | grep tck-testnet +tck-testnet active no Index: libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat =================================================================== --- /dev/null +++ libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat @@ -0,0 +1,14 @@ +#iptables -t nat -L -n | grep ' 10\.1\.2\.' +#iptables -n -L FORWARD | grep ' 10\.1\.2\.' +#ip6tables -n -L FORWARD | grep ' 2001:db8:ac10' +#ps aux | sed -n '/dnsmasq .*10\.1\.2\./ s|.*\(dnsmasq [[:print:]*]\)|\1|p' +#ps aux | sed -n '/radvd --.*tck\-testnet\-/ s|.*\(radvd [[:print:]*]\)|\1|p' +#route -n | grep '10\.1\.2\.' +#route -n | grep '192\.168\.123\.' +#route -n | grep '10\.0\.0\.0' +#brctl show | grep tck-testbr +#ifconfig tck-testbr 2>/dev/null | grep ':10\.1\.2\.' +#ifconfig tck-testbr 2>/dev/null | grep 'inet6 addr: 2001' +#ip addr show tck-testbr 2>/dev/null | grep "inet " +#ip route show dev tck-testbr 2>/dev/null +#virsh net-list | grep tck-testnet

On 01/04/2011 06:44 PM, Stefan Berger wrote:
v2: - added test cases using 'ip addr ...' and 'ip route ...' commands
This patch adds a couple of test cases for the recently added network ipv6 support.
I don't really feel qualified to do a good review of patches for libvirt-tck, but since you've taken the time to add in tests for code that I wrote, I felt it my responsibility to respond :-) First - Thanks for adding this in! Looks like I need to be careful where I run the libvirt-tck, as one of the networks chosen for testing will clobber the route to an important internal network (10.0.0.0/8) for the duration of the test. Aside from that, and the indenting issue I mention below, it looks like these tests follow the pattern of previous network tests you've already committed, and they seem to be looking at the right things (although they seem a bit fragile - any change to the way we invoke radvd or dnsmasq will cause the test to fail, right?), so I would give a conditional ACK (after fixing the indentation) just because more testing is better than less, if for no other reason :-)
Signed-off-by: Stefan Berger<stefanb@us.ibm.com>
--- scripts/networks/networkxml2hostout/tck-testnet-3.dat | 39 +++++++++++++ scripts/networks/networkxml2hostout/tck-testnet-3.post.dat | 14 ++++ scripts/networks/networkxml2xmlin/tck-testnet-3.xml | 22 +++++++ 3 files changed, 75 insertions(+)
Index: libvirt-tck/scripts/networks/networkxml2xmlin/tck-testnet-3.xml =================================================================== --- /dev/null +++ libvirt-tck/scripts/networks/networkxml2xmlin/tck-testnet-3.xml @@ -0,0 +1,22 @@ +<network> +<name>tck-testnet</name> +<uuid>aadc8920-502a-4774-ac2b-cd382a204d06</uuid> +<bridge name="tck-testbr" /> +<forward mode="nat" /> +<ip address="10.1.2.1" netmask="255.255.255.0"> +<dhcp> +<range start="10.1.2.2" end="10.1.2.254" /> +<host mac="00:16:3e:77:e2:ed" name="a.example.com" ip="10.1.2.10" /> +<host mac="00:16:3e:3e:a9:1a" name="b.example.com" ip="10.1.2.11" /> +</dhcp> +</ip> +<ip family="ipv4" address="192.168.123.1" netmask="255.255.255.0"> +</ip> +<ip family="ipv6" address="2001:db8:ac10:fe01::1" prefix="64"> +</ip> +<ip family="ipv6" address="2001:db8:ac10:fd01::1" prefix="64"> +</ip> +<ip family="ipv4" address="10.24.10.1"> +</ip> +</network> +
It might look nicer for this XML to be indented.
Index: libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.dat =================================================================== --- /dev/null +++ libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.dat @@ -0,0 +1,39 @@ +#iptables -t nat -L -n | grep ' 10\.1\.2\.' +MASQUERADE tcp -- 10.1.2.0/24 !10.1.2.0/24 masq ports: 1024-65535 +MASQUERADE udp -- 10.1.2.0/24 !10.1.2.0/24 masq ports: 1024-65535 +MASQUERADE all -- 10.1.2.0/24 !10.1.2.0/24 +#iptables -n -L FORWARD | grep ' 10\.1\.2\.' +ACCEPT all -- 0.0.0.0/0 10.1.2.0/24 state RELATED,ESTABLISHED +ACCEPT all -- 10.1.2.0/24 0.0.0.0/0 +#ip6tables -n -L FORWARD | grep ' 2001:db8:ac10' +ACCEPT all ::/0 2001:db8:ac10:fd01::/64 +ACCEPT all 2001:db8:ac10:fd01::/64 ::/0 +ACCEPT all ::/0 2001:db8:ac10:fe01::/64 +ACCEPT all 2001:db8:ac10:fe01::/64 ::/0 +#ps aux | sed -n '/dnsmasq .*10\.1\.2\./ s|.*\(dnsmasq [[:print:]*]\)|\1|p' +dnsmasq --strict-order --bind-interfaces --pid-file=/var/run/libvirt/network/tck-testnet.pid --conf-file= --listen-address 10.1.2.1 --except-interface lo --dhcp-range 10.1.2.2,10.1.2.254 --dhcp-lease-max=253 --dhcp-no-override +#ps aux | sed -n '/radvd --.*tck\-testnet\-/ s|.*\(radvd [[:print:]*]\)|\1|p' +radvd --debug 1 --config /var/lib/libvirt/radvd/tck-testnet-radvd.conf --pidfile /var/run/libvirt/network/tck-testnet-radvd.pid-bin +#route -n | grep '10\.1\.2\.' +10.1.2.0 0.0.0.0 255.255.255.0 U 0 0 0 tck-testbr +#route -n | grep '192\.168\.123\.' +192.168.123.0 0.0.0.0 255.255.255.0 U 0 0 0 tck-testbr +#route -n | grep '10\.0\.0\.0' +10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 tck-testbr +#brctl show | grep tck-testbr +tck-testbr 8000.000000000000 yes +#ifconfig tck-testbr | grep ':10\.1\.2\.' + inet addr:10.1.2.1 Bcast:10.1.2.255 Mask:255.255.255.0 +#ifconfig tck-testbr | grep 'inet6 addr: 2001' + inet6 addr: 2001:db8:ac10:fd01::1/64 Scope:Global + inet6 addr: 2001:db8:ac10:fe01::1/64 Scope:Global +#ip addr show tck-testbr | grep "inet " + inet 10.1.2.1/24 brd 10.1.2.255 scope global tck-testbr + inet 192.168.123.1/24 brd 192.168.123.255 scope global tck-testbr + inet 10.24.10.1/8 brd 10.255.255.255 scope global tck-testbr +#ip route show dev tck-testbr +10.1.2.0/24 proto kernel scope link src 10.1.2.1 +192.168.123.0/24 proto kernel scope link src 192.168.123.1 +10.0.0.0/8 proto kernel scope link src 10.24.10.1 +#virsh net-list | grep tck-testnet +tck-testnet active no Index: libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat =================================================================== --- /dev/null +++ libvirt-tck/scripts/networks/networkxml2hostout/tck-testnet-3.post.dat @@ -0,0 +1,14 @@ +#iptables -t nat -L -n | grep ' 10\.1\.2\.' +#iptables -n -L FORWARD | grep ' 10\.1\.2\.' +#ip6tables -n -L FORWARD | grep ' 2001:db8:ac10' +#ps aux | sed -n '/dnsmasq .*10\.1\.2\./ s|.*\(dnsmasq [[:print:]*]\)|\1|p' +#ps aux | sed -n '/radvd --.*tck\-testnet\-/ s|.*\(radvd [[:print:]*]\)|\1|p' +#route -n | grep '10\.1\.2\.' +#route -n | grep '192\.168\.123\.' +#route -n | grep '10\.0\.0\.0' +#brctl show | grep tck-testbr +#ifconfig tck-testbr 2>/dev/null | grep ':10\.1\.2\.' +#ifconfig tck-testbr 2>/dev/null | grep 'inet6 addr: 2001' +#ip addr show tck-testbr 2>/dev/null | grep "inet " +#ip route show dev tck-testbr 2>/dev/null +#virsh net-list | grep tck-testnet
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list

On 01/05/2011 01:10 AM, Laine Stump wrote:
On 01/04/2011 06:44 PM, Stefan Berger wrote:
v2: - added test cases using 'ip addr ...' and 'ip route ...' commands
This patch adds a couple of test cases for the recently added network ipv6 support.
I don't really feel qualified to do a good review of patches for libvirt-tck, but since you've taken the time to add in tests for code that I wrote, I felt it my responsibility to respond :-)
First - Thanks for adding this in!
Looks like I need to be careful where I run the libvirt-tck, as one of the networks chosen for testing will clobber the route to an important internal network (10.0.0.0/8) for the duration of the test. We could choose the private network 172.16.0.0/12 instead, if that helps for most people.
Aside from that, and the indenting issue I mention below, it looks like these tests follow the pattern of previous network tests you've already committed, and they seem to be looking at the right things (although they seem a bit fragile - any change to the way we invoke radvd or dnsmasq will cause the test to fail, right?), so I would give a Correct. In case of a change the tests would need to be adapted. Any suggestion on how this can be prevented are welcome.
conditional ACK (after fixing the indentation) just because more testing is better than less, if for no other reason :-)
Signed-off-by: Stefan Berger<stefanb@us.ibm.com>
--- scripts/networks/networkxml2hostout/tck-testnet-3.dat | 39 +++++++++++++ scripts/networks/networkxml2hostout/tck-testnet-3.post.dat | 14 ++++ scripts/networks/networkxml2xmlin/tck-testnet-3.xml | 22 +++++++ 3 files changed, 75 insertions(+)
Index: libvirt-tck/scripts/networks/networkxml2xmlin/tck-testnet-3.xml =================================================================== --- /dev/null +++ libvirt-tck/scripts/networks/networkxml2xmlin/tck-testnet-3.xml @@ -0,0 +1,22 @@ +<network> +<name>tck-testnet</name> +<uuid>aadc8920-502a-4774-ac2b-cd382a204d06</uuid> +<bridge name="tck-testbr" /> +<forward mode="nat" /> +<ip address="10.1.2.1" netmask="255.255.255.0"> +<dhcp> +<range start="10.1.2.2" end="10.1.2.254" /> +<host mac="00:16:3e:77:e2:ed" name="a.example.com" ip="10.1.2.10" /> +<host mac="00:16:3e:3e:a9:1a" name="b.example.com" ip="10.1.2.11" /> +</dhcp> +</ip> +<ip family="ipv4" address="192.168.123.1" netmask="255.255.255.0"> +</ip> +<ip family="ipv6" address="2001:db8:ac10:fe01::1" prefix="64"> +</ip> +<ip family="ipv6" address="2001:db8:ac10:fd01::1" prefix="64"> +</ip> +<ip family="ipv4" address="10.24.10.1"> +</ip> +</network> +
It might look nicer for this XML to be indented.
I will indent it. Stefan

On 01/05/2011 06:02 PM, Stefan Berger wrote:
Looks like I need to be careful where I run the libvirt-tck, as one of the networks chosen for testing will clobber the route to an important internal network (10.0.0.0/8) for the duration of the test. We could choose the private network 172.16.0.0/12 instead, if that helps for most people.
Would it make sense to choose a subnet of one of the reserved private ranges, to further reduce the likelihood of collisions; maybe something like: 172.28.0.0/16 ?
+</ip> +</network> +
It might look nicer for this XML to be indented.
I will indent it.
Or perhaps you had indentation, but this is a case of thunderbird's formatting bug where it corrupts spacing before <,>,and & when quoting or pasting in text? -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

On Thu, Jan 06, 2011 at 08:14:01AM -0700, Eric Blake wrote:
On 01/05/2011 06:02 PM, Stefan Berger wrote:
Looks like I need to be careful where I run the libvirt-tck, as one of the networks chosen for testing will clobber the route to an important internal network (10.0.0.0/8) for the duration of the test. We could choose the private network 172.16.0.0/12 instead, if that helps for most people.
Would it make sense to choose a subnet of one of the reserved private ranges, to further reduce the likelihood of collisions; maybe something like:
172.28.0.0/16
I think the choice of subnet should be added to the configuration file. A default of 127.28.0.0/16 is fine, as long as people can override it easily if it causes trouble. The Sys::Virt::TCK->generic_network method would then return you a Sys::Virt::TCK::NetworkBuilder instance with the ip details filled in from the config file. So all test cases should 'just work' if they use the convenience APIs for building network XML. Daniel

On 01/06/2011 10:14 AM, Eric Blake wrote:
Looks like I need to be careful where I run the libvirt-tck, as one of the networks chosen for testing will clobber the route to an important internal network (10.0.0.0/8) for the duration of the test. We could choose the private network 172.16.0.0/12 instead, if that helps for most people. Would it make sense to choose a subnet of one of the reserved private ranges, to further reduce the likelihood of collisions; maybe something
On 01/05/2011 06:02 PM, Stefan Berger wrote: like:
172.28.0.0/16
?
Also that would be fine with me. 172.28.255.240/4 would just be as good for the couple of seconds the test runs and verifies that the data makes it into the host configuration.
+</ip> +</network> + It might look nicer for this XML to be indented.
I will indent it. Or perhaps you had indentation, but this is a case of thunderbird's formatting bug where it corrupts spacing before<,>,and& when quoting or pasting in text?
Yes, that's what happened. Stefan
participants (4)
-
Daniel P. Berrange
-
Eric Blake
-
Laine Stump
-
Stefan Berger