Hey hey,

attached is a series of patches that enhance the network YaPI in
various ways. The patches are quite small and accompanied by tests if
they add functionality.

Cheers,
Justus
-- 
Justus Winter                               [email protected]

PRESENSE Technologies GmbH            Sachsenstr. 5, D-20097 HH
                                         USt-IdNr.: DE263765024
Geschäftsführer/Managing Directors       AG Hamburg, HRB 107844
Till Dörges           Jürgen Sander              Axel Theilmann

# HG changeset patch
# Parent 86f32535c8a91da88474e0e44642143b5e3a526a

diff -r 86f32535c8a9 network/src/lan/YaPI/NETWORK.pm
--- a/network/src/lan/YaPI/NETWORK.pm	Tue Aug 30 17:11:07 2011 +0200
+++ b/network/src/lan/YaPI/NETWORK.pm	Tue Aug 30 17:11:35 2011 +0200
@@ -153,7 +153,7 @@
         }
         $ip = $ip_row[0]."/".$prefix;
         my %config=("STARTMODE" => "auto",
-                    "BOOTPROTO" => $ifc->{'bootproto'},
+                    "BOOTPROTO" => defined $ifc->{'bootproto'}? $ifc->{'bootproto'}: 'static',
                     "IPADDR" => $ip
             );
         if (defined $ifc->{'mtu'}) {
# HG changeset patch
# Parent 3523d4a9b981ca33fee4f5add8a6f55626b07f1c

diff -r 3523d4a9b981 network/src/lan/YaPI/NETWORK.pm
--- a/network/src/lan/YaPI/NETWORK.pm	Tue Aug 30 17:11:36 2011 +0200
+++ b/network/src/lan/YaPI/NETWORK.pm	Tue Aug 30 17:15:44 2011 +0200
@@ -142,20 +142,20 @@
         NetworkInterfaces->Read();
         NetworkInterfaces->Add() unless NetworkInterfaces->Edit($dev);
         NetworkInterfaces->Name($dev);
-        my $ip = $ifc->{'ipaddr'};
-        my $prefix="32";
-        YaST::YCP::Import ("Netmask");
-        my @ip_row = split(/\//, $ip);
-        $prefix = $ip_row[$#ip_row];
-        if (Netmask->Check4($prefix) && $prefix =~ /\./){
-            y2milestone("Valid netmask: ", $prefix, " will change to prefixlen");
-            $prefix = Netmask->ToBits($prefix);
-        }
-        $ip = $ip_row[0]."/".$prefix;
         my %config=("STARTMODE" => "auto",
                     "BOOTPROTO" => defined $ifc->{'bootproto'}? $ifc->{'bootproto'}: 'static',
-                    "IPADDR" => $ip
             );
+        if (defined $ifc->{'ipaddr'}) {
+            my $prefix = "32";
+            YaST::YCP::Import ("Netmask");
+            my @ip_row = split(/\//, $ifc->{'ipaddr'});
+            $prefix = $ip_row[$#ip_row];
+            if (Netmask->Check4($prefix) && $prefix =~ /\./){
+                y2milestone("Valid netmask: ", $prefix, " will change to prefixlen");
+                $prefix = Netmask->ToBits($prefix);
+            }
+            $config{"IPADDR"} = $ip_row[0]."/".$prefix;
+        }
         if (defined $ifc->{'mtu'}) {
             $config{"MTU"} = $ifc->{'mtu'};
         }
# HG changeset patch
# Parent 8dc09b90e2ede347dddf8c192ee376e3fc7c91b5

diff -r 8dc09b90e2ed network/src/lan/YaPI/NETWORK.pm
--- a/network/src/lan/YaPI/NETWORK.pm	Tue Aug 30 17:06:48 2011 +0200
+++ b/network/src/lan/YaPI/NETWORK.pm	Tue Aug 30 17:07:26 2011 +0200
@@ -32,13 +32,12 @@
     foreach my $devnum (keys %{LanItems->Items}){
         LanItems->current($devnum);
         if (LanItems->IsItemConfigured()){
-            my %configuration = ();
             LanItems->SetItem();
-            if (LanItems->isCurrentDHCP()){
-                %configuration = ( 'bootproto' => LanItems->bootproto );
-            } elsif (LanItems->bootproto eq "static"){
-                %configuration = ( 'bootproto' => 'static' );
-
+            my %configuration = (
+                'startmode' => LanItems->startmode ne ''? LanItems->startmode: 'manual',
+                'bootproto' => LanItems->bootproto,
+            );
+            if (LanItems->bootproto eq "static"){
                 $configuration{'ipaddr'} = LanItems->ipaddr;
                 if (LanItems->prefix ne "") {
                      $configuration{'ipaddr'} .= "/" . LanItems->prefix
@@ -142,7 +141,7 @@
         NetworkInterfaces->Read();
         NetworkInterfaces->Add() unless NetworkInterfaces->Edit($dev);
         NetworkInterfaces->Name($dev);
-        my %config=("STARTMODE" => "auto",
+        my %config=("STARTMODE" => defined $ifc->{'startmode'}? $ifc->{'startmode'}: 'auto',
                     "BOOTPROTO" => defined $ifc->{'bootproto'}? $ifc->{'bootproto'}: 'static',
             );
         if (defined $ifc->{'ipaddr'}) {
diff -r 8dc09b90e2ed network/testsuite/tests/Network_YaPI.out
--- a/network/testsuite/tests/Network_YaPI.out	Tue Aug 30 17:06:48 2011 +0200
+++ b/network/testsuite/tests/Network_YaPI.out	Tue Aug 30 17:07:26 2011 +0200
@@ -13,24 +13,29 @@
 Read	.init.scripts.exists "SuSEfirewall2_init" false
 Read	.sysconfig.sysctl.IP_FORWARD nil
 Dir	.network.section: ["eth0", "eth1", "eth2", "eth3", "eth4"]
-Dir	.network.value."eth0": ["BOOTPROTO"]
+Dir	.network.value."eth0": ["BOOTPROTO", "STARTMODE"]
 Read	.network.value."eth0".BOOTPROTO "dhcp4"
-Dir	.network.value."eth1": ["BOOTPROTO", "IPADDR", "MTU"]
+Read	.network.value."eth0".STARTMODE "manual"
+Dir	.network.value."eth1": ["BOOTPROTO", "IPADDR", "MTU", "STARTMODE"]
 Read	.network.value."eth1".BOOTPROTO "static"
 Read	.network.value."eth1".IPADDR "1.2.3.4/24"
 Read	.network.value."eth1".MTU "1234"
-Dir	.network.value."eth2": ["BOOTPROTO", "IPADDR", "PREFIXLEN"]
+Read	.network.value."eth1".STARTMODE "auto"
+Dir	.network.value."eth2": ["BOOTPROTO", "IPADDR", "PREFIXLEN", "STARTMODE"]
 Read	.network.value."eth2".BOOTPROTO "static"
 Read	.network.value."eth2".IPADDR "1.2.3.5/24"
 Read	.network.value."eth2".PREFIXLEN ""
-Dir	.network.value."eth3": ["BOOTPROTO", "IPADDR", "PREFIXLEN"]
+Read	.network.value."eth2".STARTMODE "auto"
+Dir	.network.value."eth3": ["BOOTPROTO", "IPADDR", "PREFIXLEN", "STARTMODE"]
 Read	.network.value."eth3".BOOTPROTO "static"
 Read	.network.value."eth3".IPADDR "1.2.3.6"
 Read	.network.value."eth3".PREFIXLEN "24"
-Dir	.network.value."eth4": ["BOOTPROTO", "IPADDR", "NETMASK"]
+Read	.network.value."eth3".STARTMODE "auto"
+Dir	.network.value."eth4": ["BOOTPROTO", "IPADDR", "NETMASK", "STARTMODE"]
 Read	.network.value."eth4".BOOTPROTO "static"
 Read	.network.value."eth4".IPADDR "1.2.3.7"
 Read	.network.value."eth4".NETMASK "255.255.255.0"
+Read	.network.value."eth4".STARTMODE "auto"
 Read	.target.size "/etc/install.inf" 27
 Dir	.etc.install_inf: []
 Read	.target.string "/proc/cmdline" "laptop.suse.cz"
@@ -46,7 +51,12 @@
 Read	.target.lstat "/etc/sysconfig/network/ifcfg-tr-usb" nil
 Execute	.target.bash_output "hostname --fqdn" $["exit":0, "stdout":"laptop.suse.cz"]
 Execute	.target.bash_output "hostname --fqdn" $["exit":0, "stdout":"laptop.suse.cz"]
-Return	$["dns":$["nameservers":["208.67.222.222", "208.67.220.220"], "searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1", "domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":""], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":""], "eth3":$["bootproto":"static", "ipaddr":"1.2.3.6/24", "mtu":""], "eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":""]], "routes":$["default":$["via":"10.20.30.40"]]]
+Return	$["dns":$["nameservers":["208.67.222.222", "208.67.220.220"], "searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1", "domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":"", "startmode":"manual"], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234", "startmode":"auto"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":"", "startmode":"auto"], "eth3":$["bootproto":"static", "ipaddr":"1.2.3.6/24", "mtu":"", "startmode":"auto"], "eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"]], "routes":$["default":$["via":"10.20.30.40"]]]
+Return	$["error":"", "exit":"0"]
+Write	.network.value."eth0".BOOTPROTO "dhcp4" true
+Write	.network.value."eth0".STARTMODE "auto" true
+Write	.network nil true
+Read	.init.scripts.exists "network" false
 Return	$["error":"", "exit":"0"]
 Read	.target.size "/etc/sysconfig/network/routes" 27
 Read	.routes [$["destination":"default", "gateway":"10.20.30.40"]]
@@ -85,4 +95,4 @@
 Read	.target.lstat "/etc/sysconfig/network/ifcfg-tr-usb" nil
 Execute	.target.bash_output "hostname --fqdn" $["exit":0, "stdout":"laptop.suse.cz"]
 Execute	.target.bash_output "hostname --fqdn" $["exit":0, "stdout":"laptop.suse.cz"]
-Return	$["dns":$["nameservers":["208.67.222.222", "208.67.220.220"], "searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1", "domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":""], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":""], "eth3":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":""], "eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":""]], "routes":$["default":$["via":"10.20.30.40"]]]
+Return	$["dns":$["nameservers":["208.67.222.222", "208.67.220.220"], "searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1", "domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":"", "startmode":"auto"], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234", "startmode":"auto"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":"", "startmode":"auto"], "eth3":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"], "eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"]], "routes":$["default":$["via":"10.20.30.40"]]]
diff -r 8dc09b90e2ed network/testsuite/tests/Network_YaPI.ycp
--- a/network/testsuite/tests/Network_YaPI.ycp	Tue Aug 30 17:06:48 2011 +0200
+++ b/network/testsuite/tests/Network_YaPI.ycp	Tue Aug 30 17:07:26 2011 +0200
@@ -35,24 +35,29 @@
                         ],
 	  "value" : $[
 		"eth0" : $[
+		    "STARTMODE" : "manual",
 		    "BOOTPROTO" : "dhcp4"
 		  ],
 	        "eth1" : $[
+		    "STARTMODE" : "auto",
 		    "BOOTPROTO" : "static",
 		    "IPADDR"	: "1.2.3.4/24",
                     "MTU"	: "1234",
                   ],
 	        "eth2" : $[
+		    "STARTMODE" : "auto",
 		    "BOOTPROTO" : "static",
 		    "IPADDR"	: "1.2.3.5/24",
                     "PREFIXLEN"	: "",
                   ],
 	        "eth3" : $[
+		    "STARTMODE" : "auto",
 		    "BOOTPROTO" : "static",
 		    "IPADDR"	: "1.2.3.6",
                     "PREFIXLEN" : "24",
 		  ],
 	        "eth4" : $[
+		    "STARTMODE" : "auto",
 		    "BOOTPROTO" : "static",
 		    "IPADDR"	: "1.2.3.7",
                     "NETMASK"   : "255.255.255.0",
@@ -75,6 +80,9 @@
 
 TEST(``(YaPI::NETWORK::Write($[])), [$[], $[], $[]], nil);
 
+// test manipulation of the startmode
+TEST(``(YaPI::NETWORK::Write($["interface":$["eth0":$["bootproto":"dhcp4", "STARTMODE":"auto"]]])), [READ], nil);
+
 // test correct default route
 TEST(``(YaPI::NETWORK::Write($["route":$["default":$["via":"10.20.30.40"]]])), [READ], nil);
 
# HG changeset patch
# Parent f36a7d22eaf8c138fdc3920ee8f03a32ce61087d

diff -r f36a7d22eaf8 network/src/lan/YaPI/NETWORK.pm
--- a/network/src/lan/YaPI/NETWORK.pm	Tue Aug 30 16:17:50 2011 +0200
+++ b/network/src/lan/YaPI/NETWORK.pm	Tue Aug 30 16:36:16 2011 +0200
@@ -44,6 +44,12 @@
                 }
             }
             $configuration{'mtu'} = LanItems->mtu;
+            if (LanItems->vlan_id){
+                $configuration{'vlan_id'} = LanItems->vlan_id;
+            }
+            if (LanItems->vlan_etherdevice){
+                $configuration{'vlan_etherdevice'} = LanItems->vlan_etherdevice;
+            }
             $interfaces{LanItems->interfacename}=\%configuration;
         } elsif (LanItems->getCurrentItem()->{'hwinfo'}->{'type'} eq "eth") {
             my $device = LanItems->getCurrentItem()->{"hwinfo"}->{"dev_name"};
@@ -161,6 +167,12 @@
         if (defined $ifc->{'mtu'}) {
             $config{"MTU"} = $ifc->{'mtu'};
         }
+        if (defined $ifc->{'vlan_id'}) {
+            $config{"VLAN_ID"} = $ifc->{'vlan_id'};
+        }
+        if (defined $ifc->{'vlan_etherdevice'}) {
+            $config{"ETHERDEVICE"} = $ifc->{'vlan_etherdevice'};
+        }
         NetworkInterfaces->Current(\%config);
         NetworkInterfaces->Commit();
         NetworkInterfaces->Write("");
diff -r f36a7d22eaf8 network/testsuite/tests/Network_YaPI.out
--- a/network/testsuite/tests/Network_YaPI.out	Tue Aug 30 16:17:50 2011 +0200
+++ b/network/testsuite/tests/Network_YaPI.out	Tue Aug 30 16:36:16 2011 +0200
@@ -12,7 +12,7 @@
 Execute	.target.bash "rpm -q --whatprovides SuSEfirewall2" 0
 Read	.init.scripts.exists "SuSEfirewall2_init" false
 Read	.sysconfig.sysctl.IP_FORWARD nil
-Dir	.network.section: ["eth0", "eth1", "eth2", "eth3", "eth4"]
+Dir	.network.section: ["eth0", "eth1", "eth2", "eth3", "eth4", "eth5", "eth5.23"]
 Dir	.network.value."eth0": ["BOOTPROTO", "STARTMODE"]
 Read	.network.value."eth0".BOOTPROTO "dhcp4"
 Read	.network.value."eth0".STARTMODE "manual"
@@ -36,6 +36,15 @@
 Read	.network.value."eth4".IPADDR "1.2.3.7"
 Read	.network.value."eth4".NETMASK "255.255.255.0"
 Read	.network.value."eth4".STARTMODE "auto"
+Dir	.network.value."eth5": ["BOOTPROTO", "STARTMODE"]
+Read	.network.value."eth5".BOOTPROTO "static"
+Read	.network.value."eth5".STARTMODE "auto"
+Dir	.network.value."eth5.23": ["BOOTPROTO", "ETHERDEVICE", "IPADDR", "STARTMODE", "VLAN_ID"]
+Read	.network.value."eth5.23".BOOTPROTO "static"
+Read	.network.value."eth5.23".ETHERDEVICE "eth5"
+Read	.network.value."eth5.23".IPADDR "1.2.3.8/24"
+Read	.network.value."eth5.23".STARTMODE "auto"
+Read	.network.value."eth5.23".VLAN_ID "23"
 Read	.target.size "/etc/install.inf" 27
 Dir	.etc.install_inf: []
 Read	.target.string "/proc/cmdline" "laptop.suse.cz"
@@ -51,7 +60,7 @@
 Read	.target.lstat "/etc/sysconfig/network/ifcfg-tr-usb" nil
 Execute	.target.bash_output "hostname --fqdn" $["exit":0, "stdout":"laptop.suse.cz"]
 Execute	.target.bash_output "hostname --fqdn" $["exit":0, "stdout":"laptop.suse.cz"]
-Return	$["dns":$["nameservers":["208.67.222.222", "208.67.220.220"], "searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1", "domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":"", "startmode":"manual"], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234", "startmode":"auto"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":"", "startmode":"auto"], "eth3":$["bootproto":"static", "ipaddr":"1.2.3.6/24", "mtu":"", "startmode":"auto"], "eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"]], "routes":$["default":$["via":"10.20.30.40"]]]
+Return	$["dns":$["nameservers":["208.67.222.222", "208.67.220.220"], "searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1", "domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":"", "startmode":"manual"], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234", "startmode":"auto"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":"", "startmode":"auto"], "eth3":$["bootproto":"static", "ipaddr":"1.2.3.6/24", "mtu":"", "startmode":"auto"], "eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"], "eth5":$["bootproto":"static", "ipaddr":"", "mtu":"", "startmode":"auto"], "eth5.23":$["bootproto":"static", "ipaddr":"1.2.3.8/24", "mtu":"", "startmode":"auto", "vlan_etherdevice":"eth5", "vlan_id":"23"]], "routes":$["default":$["via":"10.20.30.40"]]]
 Return	$["error":"", "exit":"0"]
 Write	.network.value."eth0".BOOTPROTO "dhcp4" true
 Write	.network.value."eth0".STARTMODE "auto" true
@@ -79,6 +88,14 @@
 Write	.network nil true
 Read	.init.scripts.exists "network" false
 Return	$["error":"", "exit":"0"]
+Write	.network.value."eth5.23".BOOTPROTO "static" true
+Write	.network.value."eth5.23".ETHERDEVICE "eth5" true
+Write	.network.value."eth5.23".IPADDR "1.2.3.8/24" true
+Write	.network.value."eth5.23".STARTMODE "auto" true
+Write	.network.value."eth5.23".VLAN_ID "42" true
+Write	.network nil true
+Read	.init.scripts.exists "network" false
+Return	$["error":"", "exit":"0"]
 Read	.target.size "/etc/sysconfig/network/routes" 27
 Read	.routes [$["destination":"default", "gateway":"10.20.30.40"]]
 Read	.init.scripts.exists "SuSEfirewall2_init" false
@@ -95,4 +112,4 @@
 Read	.target.lstat "/etc/sysconfig/network/ifcfg-tr-usb" nil
 Execute	.target.bash_output "hostname --fqdn" $["exit":0, "stdout":"laptop.suse.cz"]
 Execute	.target.bash_output "hostname --fqdn" $["exit":0, "stdout":"laptop.suse.cz"]
-Return	$["dns":$["nameservers":["208.67.222.222", "208.67.220.220"], "searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1", "domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":"", "startmode":"auto"], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234", "startmode":"auto"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":"", "startmode":"auto"], "eth3":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"], "eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"]], "routes":$["default":$["via":"10.20.30.40"]]]
+Return	$["dns":$["nameservers":["208.67.222.222", "208.67.220.220"], "searches":["suse.cz", "suse.de"]], "hostname":$["dhcp_hostname":"1", "domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4", "mtu":"", "startmode":"auto"], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24", "mtu":"1234", "startmode":"auto"], "eth2":$["bootproto":"static", "ipaddr":"1.2.3.5/24", "mtu":"", "startmode":"auto"], "eth3":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"], "eth4":$["bootproto":"static", "ipaddr":"1.2.3.7/24", "mtu":"", "startmode":"auto"], "eth5":$["bootproto":"static", "ipaddr":"", "mtu":"", "startmode":"auto"], "eth5.23":$["bootproto":"static", "ipaddr":"1.2.3.8/24", "mtu":"", "startmode":"auto", "vlan_etherdevice":"eth5", "vlan_id":"42"]], "routes":$["default":$["via":"10.20.30.40"]]]
diff -r f36a7d22eaf8 network/testsuite/tests/Network_YaPI.ycp
--- a/network/testsuite/tests/Network_YaPI.ycp	Tue Aug 30 16:17:50 2011 +0200
+++ b/network/testsuite/tests/Network_YaPI.ycp	Tue Aug 30 16:36:16 2011 +0200
@@ -32,6 +32,8 @@
                         "eth2":$[],
                         "eth3":$[],
                         "eth4":$[],
+                        "eth5":$[],
+                        "eth5.23":$[],
                         ],
 	  "value" : $[
 		"eth0" : $[
@@ -62,6 +64,17 @@
 		    "IPADDR"	: "1.2.3.7",
                     "NETMASK"   : "255.255.255.0",
 		  ],
+	        "eth5" : $[
+		    "STARTMODE" : "auto",
+		    "BOOTPROTO" : "static",
+		  ],
+	        "eth5.23" : $[
+		    "STARTMODE"   : "auto",
+		    "BOOTPROTO"   : "static",
+		    "IPADDR"	  : "1.2.3.8/24",
+		    "VLAN_ID"     : "23",
+		    "ETHERDEVICE" : "eth5",
+		  ],
           ],
     ],
     "routes" : [ $["destination":"default", "gateway":"10.20.30.40"] ]
@@ -89,7 +102,12 @@
 // test incorrect default route (invalid gw IP)
 TEST(``(YaPI::NETWORK::Write($["route":$["default":$["via":"10.20.30"]]])), [READ], nil);
 
+// test setting the network prefix length for an interface that was previously configured via netmask
 TEST(``(YaPI::NETWORK::Write($["interface":$["eth3":$["bootproto":"static", "ipaddr":"1.2.3.7/24"]]])), [READ], nil);
+
+// test vlan_id change
+TEST(``(YaPI::NETWORK::Write($["interface":$["eth5.23":$["bootproto":"static", "ipaddr":"1.2.3.8/24", "vlan_etherdevice":"eth5", "vlan_id":"42"]]])), [READ], nil);
+
 TEST(``(YaPI::NETWORK::Read()), [READ, $[], EXEC], nil);
 
 }

Attachment: signature.asc
Description: PGP signature

Reply via email to