Author: mzugec Date: Wed Nov 25 17:22:28 2009 New Revision: 59760 URL: http://svn.opensuse.org/viewcvs/yast?rev=59760&view=rev Log: added testsuites for YaPI Added: branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.err branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.out branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.ycp Modified: branches/SuSE-Code-11-SP1-Branch/network/VERSION branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes Modified: branches/SuSE-Code-11-SP1-Branch/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/VERSION?rev=59760&r1=59759&r2=59760&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/VERSION (original) +++ branches/SuSE-Code-11-SP1-Branch/network/VERSION Wed Nov 25 17:22:28 2009 @@ -1 +1 @@ -2.17.112 +2.17.113 Modified: branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes?rev=59760&r1=59759&r2=59760&view=diff ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes (original) +++ branches/SuSE-Code-11-SP1-Branch/network/package/yast2-network.changes Wed Nov 25 17:22:28 2009 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Wed Nov 25 17:21:41 CET 2009 - mzugec@suse.de + +- added testsuites for YaPI +- 2.17.113 + +------------------------------------------------------------------- Mon Nov 23 13:07:13 CET 2009 - mzugec@suse.de - exclude nfsroot devices from bridged slaves (bnc#557688) Added: branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.err URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.err?rev=59760&view=auto ============================================================================== (empty) Added: branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.out URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.out?rev=59760&view=auto ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.out (added) +++ branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.out Wed Nov 25 17:22:28 2009 @@ -0,0 +1,49 @@ +Read .target.tmpdir nil +Log Failed to set temporary directory: nil +Read .sysconfig.network.dhcp.DHCLIENT_SET_HOSTNAME "no" +Read .sysconfig.network.dhcp.WRITE_HOSTNAME_TO_HOSTS "no" +Read .target.size "/etc/install.inf" 27 +Read .etc.install_inf nil +Read .sysconfig.network.config.NETCONFIG_DNS_POLICY nil +Read .sysconfig.network.config.NETCONFIG_DNS_STATIC_SERVERS "208.67.222.222 208.67.220.220" +Read .sysconfig.network.config.NETCONFIG_DNS_STATIC_SEARCHLIST "suse.cz suse.de" +Read .target.size "/etc/HOSTNAME" 27 +Read .target.string "/etc/HOSTNAME" "laptop.suse.cz" +Read .target.size "/etc/sysconfig/network/routes" 27 +Read .routes [$["destination":"default", "gateway":"10.20.30.40"]] +Read .sysconfig.sysctl.IP_FORWARD nil +Dir .network.section: ["eth0", "eth1"] +Dir .network.value."eth0": ["BOOTPROTO"] +Read .network.value."eth0".BOOTPROTO "dhcp4" +Dir .network.value."eth1": ["BOOTPROTO", "IPADDR"] +Read .network.value."eth1".BOOTPROTO "static" +Read .network.value."eth1".IPADDR "1.2.3.4/24" +Read .target.size "/etc/install.inf" 27 +Dir .etc.install_inf: [] +Read .target.string "/proc/cmdline" "laptop.suse.cz" +Read .probe.netcard nil +Log hardware detection failure +Read .etc.install_inf.BrokenModules nil +Read .udev_persistent.net nil +Dir .modprobe.network.options: [] +Read .udev_persistent.drivers nil +Read .target.lstat "/etc/sysconfig/network/ifcfg-eth-pcmcia" nil +Read .target.lstat "/etc/sysconfig/network/ifcfg-eth-usb" nil +Read .target.lstat "/etc/sysconfig/network/ifcfg-tr-pcmcia" nil +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":$["domain":"suse.cz", "name":"laptop"], "interfaces":$["eth0":$["bootproto":"dhcp4"], "eth1":$["bootproto":"static", "ipaddr":"1.2.3.4/24"]], "routes":$["default":$["via":"10.20.30.40"]]] +Return $["error":"", "exit":"0"] +Read .target.size "/etc/sysconfig/network/routes" 27 +Read .routes [$["destination":"default", "gateway":"10.20.30.40"]] +Read .sysconfig.sysctl.IP_FORWARD nil +Write .sysconfig.sysctl.IP_FORWARD "no" true +Write .sysconfig.sysctl.IPV6_FORWARD "no" true +Execute .target.bash "echo 0 > /proc/sys/net/ipv4/ip_forward" 0 +Execute .target.bash "echo 0 > /proc/sys/net/ipv6/conf/all/forwarding" 0 +Read .target.size "/etc/sysconfig/network/routes" 27 +Execute .target.bash "/bin/cp /etc/sysconfig/network/routes /etc/sysconfig/network/routes.YaST2save" 0 +Write .routes [$["destination":"default", "device":"-", "gateway":"10.20.30.40", "netmask":"-"]] true +Return $["error":"", "exit":"0"] +Return $["error":"A valid IP address consists of four integers\nin the range 0-255 separated by dots.", "exit":"-1"] Added: branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.ycp?rev=59760&view=auto ============================================================================== --- branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.ycp (added) +++ branches/SuSE-Code-11-SP1-Branch/network/testsuite/tests/Network_YaPI.ycp Wed Nov 25 17:22:28 2009 @@ -0,0 +1,55 @@ +{ +include "testsuite.ycp"; +import "YaPI::NETWORK"; + +map READ = $[ + "target" : $[ + "size":27, + "string" : "laptop.suse.cz", + "bash_output" : "laptop.suse.cz" + ], + "sysconfig": $[ + "network" : $[ + "config" : $[ + "NETCONFIG_DNS_STATIC_SERVERS" : "208.67.222.222 208.67.220.220", + "NETCONFIG_DNS_STATIC_SEARCHLIST" : "suse.cz suse.de" + ], + "dhcp" : $[ + "DHCLIENT_SET_HOSTNAME" : "no", + "WRITE_HOSTNAME_TO_HOSTS" : "no" + ] + ], + ], + "network" : $[ + "section" : $[ "eth0":$[], "eth1":$[] ], + "value" : $[ + "eth0" : $[ + "BOOTPROTO" : "dhcp4" + ], + "eth1" : $[ + "BOOTPROTO" : "static", + "IPADDR" : "1.2.3.4/24" + ]], + ], + "routes" : [ $["destination":"default", "gateway":"10.20.30.40"] ] +]; + +map EXEC = $[ + "target" : $[ + "bash_output" : $[ + "exit" : 0, + "stdout" : "laptop.suse.cz" + ] + ] + ]; + +TEST(``(YaPI::NETWORK::Read()), [READ, $[], EXEC], nil); + +TEST(``(YaPI::NETWORK::Write($[])), [$[], $[], $[]], nil); + +// test correct default route +TEST(``(YaPI::NETWORK::Write($["route":$["default":$["via":"10.20.30.40"]]])), [READ], nil); + +// test incorrect default route (invalid gw IP) +TEST(``(YaPI::NETWORK::Write($["route":$["default":$["via":"10.20.30"]]])), [READ], nil); +} -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org