On Thu, Sep 24, 2009 at 04:32:23PM -0700, David Lutterkort wrote:
Exercise the various variations on how an interface can be set up for
IPv6
---
tests/initscripts/ipv6-autoconf-dhcp.xml | 10 ++++++++++
tests/initscripts/ipv6-autoconf.xml | 10 ++++++++++
tests/initscripts/ipv6-dhcp.xml | 10 ++++++++++
tests/initscripts/ipv6-local.xml | 10 ++++++++++
tests/initscripts/ipv6-static-multi.xml | 12 ++++++++++++
tests/initscripts/ipv6-static.xml | 12 ++++++++++++
tests/interface/ipv6-autoconf-dhcp.xml | 7 +++++++
tests/interface/ipv6-autoconf.xml | 6 ++++++
tests/interface/ipv6-dhcp.xml | 6 ++++++
tests/interface/ipv6-local.xml | 4 ++++
tests/interface/ipv6-static-multi.xml | 8 ++++++++
tests/interface/ipv6-static.xml | 7 +++++++
tests/test-initscripts.c | 7 +++++++
13 files changed, 109 insertions(+), 0 deletions(-)
create mode 100644 tests/initscripts/ipv6-autoconf-dhcp.xml
create mode 100644 tests/initscripts/ipv6-autoconf.xml
create mode 100644 tests/initscripts/ipv6-dhcp.xml
create mode 100644 tests/initscripts/ipv6-local.xml
create mode 100644 tests/initscripts/ipv6-static-multi.xml
create mode 100644 tests/initscripts/ipv6-static.xml
create mode 100644 tests/interface/ipv6-autoconf-dhcp.xml
create mode 100644 tests/interface/ipv6-autoconf.xml
create mode 100644 tests/interface/ipv6-dhcp.xml
create mode 100644 tests/interface/ipv6-local.xml
create mode 100644 tests/interface/ipv6-static-multi.xml
create mode 100644 tests/interface/ipv6-static.xml
diff --git a/tests/initscripts/ipv6-autoconf-dhcp.xml
b/tests/initscripts/ipv6-autoconf-dhcp.xml
new file mode 100644
index 0000000..f755fa4
--- /dev/null
+++ b/tests/initscripts/ipv6-autoconf-dhcp.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<forest>
+ <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth0">
+ <node label="DEVICE" value="eth0"/>
+ <node label="ONBOOT" value="yes"/>
+ <node label="IPV6INIT" value="yes"/>
+ <node label="IPV6_AUTOCONF" value="yes"/>
+ <node label="DHCPV6" value="yes"/>
+ </tree>
+</forest>
diff --git a/tests/initscripts/ipv6-autoconf.xml b/tests/initscripts/ipv6-autoconf.xml
new file mode 100644
index 0000000..637864c
--- /dev/null
+++ b/tests/initscripts/ipv6-autoconf.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<forest>
+ <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth0">
+ <node label="DEVICE" value="eth0"/>
+ <node label="ONBOOT" value="yes"/>
+ <node label="IPV6INIT" value="yes"/>
+ <node label="IPV6_AUTOCONF" value="yes"/>
+ <node label="DHCPV6" value="no"/>
+ </tree>
+</forest>
diff --git a/tests/initscripts/ipv6-dhcp.xml b/tests/initscripts/ipv6-dhcp.xml
new file mode 100644
index 0000000..c87f0ce
--- /dev/null
+++ b/tests/initscripts/ipv6-dhcp.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<forest>
+ <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth0">
+ <node label="DEVICE" value="eth0"/>
+ <node label="ONBOOT" value="yes"/>
+ <node label="IPV6INIT" value="yes"/>
+ <node label="IPV6_AUTOCONF" value="no"/>
+ <node label="DHCPV6" value="yes"/>
+ </tree>
+</forest>
diff --git a/tests/initscripts/ipv6-local.xml b/tests/initscripts/ipv6-local.xml
new file mode 100644
index 0000000..96294f8
--- /dev/null
+++ b/tests/initscripts/ipv6-local.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<forest>
+ <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth0">
+ <node label="DEVICE" value="eth0"/>
+ <node label="ONBOOT" value="yes"/>
+ <node label="IPV6INIT" value="yes"/>
+ <node label="IPV6_AUTOCONF" value="no"/>
+ <node label="DHCPV6" value="no"/>
+ </tree>
+</forest>
diff --git a/tests/initscripts/ipv6-static-multi.xml
b/tests/initscripts/ipv6-static-multi.xml
new file mode 100644
index 0000000..afbbfb1
--- /dev/null
+++ b/tests/initscripts/ipv6-static-multi.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<forest>
+ <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth0">
+ <node label="DEVICE" value="eth0"/>
+ <node label="ONBOOT" value="yes"/>
+ <node label="IPV6INIT" value="yes"/>
+ <node label="IPV6_AUTOCONF" value="no"/>
+ <node label="DHCPV6" value="no"/>
+ <node label="IPV6ADDR" value="3ffe:ffff:0:5::1/128"/>
+ <node label="IPV6ADDR_SECONDARIES" value="3ffe:ffff:0:5::3/128
3ffe:ffff:0:5::5/128"/>
+ </tree>
+</forest>
diff --git a/tests/initscripts/ipv6-static.xml b/tests/initscripts/ipv6-static.xml
new file mode 100644
index 0000000..187b1dc
--- /dev/null
+++ b/tests/initscripts/ipv6-static.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<forest>
+ <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth0">
+ <node label="DEVICE" value="eth0"/>
+ <node label="ONBOOT" value="yes"/>
+ <node label="IPV6INIT" value="yes"/>
+ <node label="IPV6_AUTOCONF" value="no"/>
+ <node label="DHCPV6" value="no"/>
+ <node label="IPV6ADDR" value="3ffe:ffff:0:5::1/128"/>
+ <node label="IPV6_DEFAULTGW"
value="3ffe:ffff:1234:5678::1"/>
+ </tree>
+</forest>
diff --git a/tests/interface/ipv6-autoconf-dhcp.xml
b/tests/interface/ipv6-autoconf-dhcp.xml
new file mode 100644
index 0000000..3799b81
--- /dev/null
+++ b/tests/interface/ipv6-autoconf-dhcp.xml
@@ -0,0 +1,7 @@
+<interface type="ethernet" name="eth0">
+ <start mode="onboot"/>
+ <protocol family="ipv6">
+ <autoconf/>
+ <dhcp/>
+ </protocol>
+</interface>
diff --git a/tests/interface/ipv6-autoconf.xml b/tests/interface/ipv6-autoconf.xml
new file mode 100644
index 0000000..7c7dbb4
--- /dev/null
+++ b/tests/interface/ipv6-autoconf.xml
@@ -0,0 +1,6 @@
+<interface type="ethernet" name="eth0">
+ <start mode="onboot"/>
+ <protocol family="ipv6">
+ <autoconf/>
+ </protocol>
+</interface>
diff --git a/tests/interface/ipv6-dhcp.xml b/tests/interface/ipv6-dhcp.xml
new file mode 100644
index 0000000..ca7d792
--- /dev/null
+++ b/tests/interface/ipv6-dhcp.xml
@@ -0,0 +1,6 @@
+<interface type="ethernet" name="eth0">
+ <start mode="onboot"/>
+ <protocol family="ipv6">
+ <dhcp/>
+ </protocol>
+</interface>
diff --git a/tests/interface/ipv6-local.xml b/tests/interface/ipv6-local.xml
new file mode 100644
index 0000000..db96c9a
--- /dev/null
+++ b/tests/interface/ipv6-local.xml
@@ -0,0 +1,4 @@
+<interface type="ethernet" name="eth0">
+ <start mode="onboot"/>
+ <protocol family="ipv6"/>
+</interface>
diff --git a/tests/interface/ipv6-static-multi.xml
b/tests/interface/ipv6-static-multi.xml
new file mode 100644
index 0000000..753e904
--- /dev/null
+++ b/tests/interface/ipv6-static-multi.xml
@@ -0,0 +1,8 @@
+<interface type="ethernet" name="eth0">
+ <start mode="onboot"/>
+ <protocol family="ipv6">
+ <ip address="3ffe:ffff:0:5::1" prefix="128"/>
+ <ip address="3ffe:ffff:0:5::3" prefix="128"/>
+ <ip address="3ffe:ffff:0:5::5" prefix="128"/>
+ </protocol>
+</interface>
diff --git a/tests/interface/ipv6-static.xml b/tests/interface/ipv6-static.xml
new file mode 100644
index 0000000..31a452b
--- /dev/null
+++ b/tests/interface/ipv6-static.xml
@@ -0,0 +1,7 @@
+<interface type="ethernet" name="eth0">
+ <start mode="onboot"/>
+ <protocol family="ipv6">
+ <ip address="3ffe:ffff:0:5::1" prefix="128"/>
+ <route gateway="3ffe:ffff:1234:5678::1"/>
+ </protocol>
+</interface>
diff --git a/tests/test-initscripts.c b/tests/test-initscripts.c
index 56d430e..0f2a887 100644
--- a/tests/test-initscripts.c
+++ b/tests/test-initscripts.c
@@ -183,6 +183,13 @@ static void testTransforms(CuTest *tc) {
assert_transforms(tc, "ethernet-static-no-prefix");
assert_transforms(tc, "ethernet-dhcp");
assert_transforms(tc, "vlan");
+
+ assert_transforms(tc, "ipv6-local");
+ assert_transforms(tc, "ipv6-static");
+ assert_transforms(tc, "ipv6-dhcp");
+ assert_transforms(tc, "ipv6-autoconf");
+ assert_transforms(tc, "ipv6-autoconf-dhcp");
+ assert_transforms(tc, "ipv6-static-multi");
}
int main(void) {
ACK, these cover the scenarios I'd outlined earlier
The only possible extra thing is that I have a feeling it is possible to
enable IPv6 by default on all interfaces using NETWORKING_IPV6=yes in
/etc/sysconfig/network, even without needing IPV6INIT=yes in the per-if
config files. Would need to refer to the code / docs for initscripts to
be sure of that though, and its easily added in later if required
Daniel
--
|: Red Hat, Engineering, London -o-
http://people.redhat.com/berrange/ :|
|:
http://libvirt.org -o-
http://virt-manager.org -o-
http://ovirt.org :|
|:
http://autobuild.org -o-
http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|