[netcf-devel] [PATCH 2/3] tests: add a transform test for toplevel vlans

David Lutterkort lutter at redhat.com
Tue Jun 30 20:21:35 UTC 2009


---
 tests/initscripts/vlan.xml |   10 ++++++++++
 tests/interface/vlan.xml   |    9 +++++++++
 tests/test-initscripts.c   |    1 +
 3 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 tests/initscripts/vlan.xml
 create mode 100644 tests/interface/vlan.xml

diff --git a/tests/initscripts/vlan.xml b/tests/initscripts/vlan.xml
new file mode 100644
index 0000000..36ad0f2
--- /dev/null
+++ b/tests/initscripts/vlan.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0"?>
+<forest>
+  <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth0.42">
+    <node label="DEVICE" value="eth0.42"/>
+    <node label="VLAN" value="yes"/>
+    <node label="ONBOOT" value="yes"/>
+    <node label="BOOTPROTO" value="dhcp"/>
+    <node label="PEERDNS" value="no"/>
+  </tree>
+</forest>
diff --git a/tests/interface/vlan.xml b/tests/interface/vlan.xml
new file mode 100644
index 0000000..4ff73d6
--- /dev/null
+++ b/tests/interface/vlan.xml
@@ -0,0 +1,9 @@
+<interface type="vlan" name="eth0.42">
+  <start mode="onboot"/>
+  <protocol family="ipv4">
+    <dhcp peerdns="no"/>
+  </protocol>
+  <vlan tag="42">
+    <interface name="eth0"/>
+  </vlan>
+</interface>
diff --git a/tests/test-initscripts.c b/tests/test-initscripts.c
index 3f0545e..4ad9332 100644
--- a/tests/test-initscripts.c
+++ b/tests/test-initscripts.c
@@ -259,6 +259,7 @@ static void testTransforms(CuTest *tc) {
     assert_transforms(tc, "ethernet-static");
     assert_transforms(tc, "ethernet-static-no-prefix");
     assert_transforms(tc, "ethernet-dhcp");
+    assert_transforms(tc, "vlan");
 }
 
 int main(void) {
-- 
1.6.0.6



More information about the netcf-devel mailing list