[yast-commit] r58888 - in /trunk/network: VERSION package/yast2-network.changes src/lan/YaPI/NETWORK.pm testsuite/tests/Network_YaPI.out testsuite/tests/Network_YaPI.ycp
Author: mzugec Date: Thu Oct 1 16:49:07 2009 New Revision: 58888 URL: http://svn.opensuse.org/viewcvs/yast?rev=58888&view=rev Log: extend testsuites for YaPI->Write Modified: trunk/network/VERSION trunk/network/package/yast2-network.changes trunk/network/src/lan/YaPI/NETWORK.pm trunk/network/testsuite/tests/Network_YaPI.out trunk/network/testsuite/tests/Network_YaPI.ycp Modified: trunk/network/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/VERSION?rev=58888&r1=58887&r2=58888&view=diff ============================================================================== --- trunk/network/VERSION (original) +++ trunk/network/VERSION Thu Oct 1 16:49:07 2009 @@ -1 +1 @@ -2.18.49 +2.18.50 Modified: trunk/network/package/yast2-network.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.changes?rev=58888&r1=58887&r2=58888&view=diff ============================================================================== --- trunk/network/package/yast2-network.changes (original) +++ trunk/network/package/yast2-network.changes Thu Oct 1 16:49:07 2009 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Thu Oct 1 16:46:02 CEST 2009 - mzugec@suse.cz + +- YaPI: return map with return code and error message in Write + function + testsuite +- 2.18.50 + +------------------------------------------------------------------- Fri Sep 25 17:50:03 CEST 2009 - kmachalkova@suse.cz - Display simple firewall & SSH config dialog after clicking on Modified: trunk/network/src/lan/YaPI/NETWORK.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/src/lan/YaPI/NETWORK.pm?rev=58888&r1=58887&r2=58888&view=diff ============================================================================== --- trunk/network/src/lan/YaPI/NETWORK.pm (original) +++ trunk/network/src/lan/YaPI/NETWORK.pm Thu Oct 1 16:49:07 2009 @@ -153,8 +153,8 @@ sub Write { my $self = shift; my $args = shift; -# my %ret = ('exit'=>0, 'error'=>''); y2milestone("YaPI->Write with settings:", Dumper(\$args)); + # SAVE DEFAULT ROUTE if (exists($args->{'route'})){ my $route_ret = writeRoute($args); @@ -176,6 +176,8 @@ return $ifc_ret if ($ifc_ret->{'exit'} != 0); } + # return value for exit is type integer, but it'll be converted into string (in yast-perl-bindings) + # that means in rest-api it'll be {'exit'=>'0', 'error'=>''} return {'exit'=>0, 'error'=>''}; } Modified: trunk/network/testsuite/tests/Network_YaPI.out URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/testsuite/tests/Network_YaPI.out?rev=58888&r1=58887&r2=58888&view=diff ============================================================================== --- trunk/network/testsuite/tests/Network_YaPI.out (original) +++ trunk/network/testsuite/tests/Network_YaPI.out Thu Oct 1 16:49:07 2009 @@ -40,3 +40,16 @@ 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"] Modified: trunk/network/testsuite/tests/Network_YaPI.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/testsuite/tests/Network_YaPI.ycp?rev=58888&r1=58887&r2=58888&view=diff ============================================================================== --- trunk/network/testsuite/tests/Network_YaPI.ycp (original) +++ trunk/network/testsuite/tests/Network_YaPI.ycp Thu Oct 1 16:49:07 2009 @@ -38,6 +38,14 @@ ] ] ]; + 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
participants (1)
-
mzugec@svn.opensuse.org