Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2015-09-24 07:15:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-network" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2015-08-29 20:02:36.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2015-09-24 07:15:48.000000000 +0200 @@ -1,0 +2,8 @@ +Wed Sep 16 09:06:48 UTC 2015 - mfilka@suse.com + +- bnc#945947 + - Routing module returns correct return code when invoked from + command line +- 3.1.129 + +------------------------------------------------------------------- Old: ---- yast2-network-3.1.128.tar.bz2 New: ---- yast2-network-3.1.129.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.1LY1XW/_old 2015-09-24 07:15:49.000000000 +0200 +++ /var/tmp/diff_new_pack.1LY1XW/_new 2015-09-24 07:15:49.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.128 +Version: 3.1.129 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-network-3.1.128.tar.bz2 -> yast2-network-3.1.129.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.128/package/yast2-network.changes new/yast2-network-3.1.129/package/yast2-network.changes --- old/yast2-network-3.1.128/package/yast2-network.changes 2015-08-28 09:02:14.000000000 +0200 +++ new/yast2-network-3.1.129/package/yast2-network.changes 2015-09-16 13:17:10.000000000 +0200 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Wed Sep 16 09:06:48 UTC 2015 - mfilka@suse.com + +- bnc#945947 + - Routing module returns correct return code when invoked from + command line +- 3.1.129 + +------------------------------------------------------------------- Thu Aug 27 20:29:41 UTC 2015 - mfilka@suse.com - bnc#846201 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.128/package/yast2-network.spec new/yast2-network-3.1.129/package/yast2-network.spec --- old/yast2-network-3.1.128/package/yast2-network.spec 2015-08-28 09:02:14.000000000 +0200 +++ new/yast2-network-3.1.129/package/yast2-network.spec 2015-09-16 13:17:10.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.128 +Version: 3.1.129 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.128/src/modules/Routing.rb new/yast2-network-3.1.129/src/modules/Routing.rb --- old/yast2-network-3.1.128/src/modules/Routing.rb 2015-08-28 09:02:14.000000000 +0200 +++ new/yast2-network-3.1.129/src/modules/Routing.rb 2015-09-16 13:17:10.000000000 +0200 @@ -72,6 +72,7 @@ Yast.import "Map" Yast.import "Mode" Yast.import "SuSEFirewall" + Yast.import "FileUtils" Yast.include self, "network/runtime.rb" Yast.include self, "network/routines.rb" @@ -287,6 +288,24 @@ ret end + # Clear file with routes definitions for particular device + # + # @param device is a device name (eth0) or special string Routes::ANY_DEVICE + # @return [true, false] if succeedes + def clear_route_file(device) + # work around bnc#19476 + if device == ANY_DEVICE + filename = ROUTES_FILE + + return SCR.Write(path(".target.string"), filename, "") + else + filename = "#{ROUTES_DIR}/ifroute-#{device}" + + return SCR.Execute(path(".target.remove"), filename) if FileUtils.Exists(filename) + return true + end + end + # From *routes*, select those belonging to *device* and write # an appropriate config file. # @param device device name, or "-" for global routes @@ -295,23 +314,15 @@ def write_route_file(device, routes) routes = routes.select { |r| r["device"] == device } - if routes.empty? - # work around bnc#19476 - if device == ANY_DEVICE - filename = ROUTES_FILE - return SCR.Write(path(".target.string"), filename, "") - else - filename = "#{ROUTES_DIR}/ifroute-#{device}" - return SCR.Execute(path(".target.remove"), filename) - end + return clear_route_file(device) if routes.empty? + + if device == ANY_DEVICE + scr_path = path(".routes") else - if device == ANY_DEVICE - scr_path = path(".routes") - else - scr_path = register_ifroute_agent_for_device(device) - end - return SCR.Write(scr_path, routes) + scr_path = register_ifroute_agent_for_device(device) end + + SCR.Write(scr_path, routes) end # Updates routing configuration files @@ -323,7 +334,7 @@ # @return [true, false] if it succeedes def write_routes(routes) # create if not exists, otherwise backup - if SCR.Read(path(".target.size"), ROUTES_FILE) > 0 + if FileUtils.Exists(ROUTES_FILE) SCR.Execute( path(".target.bash"), "/bin/cp #{ROUTES_FILE} #{ROUTES_FILE}.YaST2save" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.128/test/ifroute_test.rb new/yast2-network-3.1.129/test/ifroute_test.rb --- old/yast2-network-3.1.128/test/ifroute_test.rb 2015-08-28 09:02:14.000000000 +0200 +++ new/yast2-network-3.1.129/test/ifroute_test.rb 2015-09-16 13:17:10.000000000 +0200 @@ -94,10 +94,9 @@ ] it "writes device assigned routes into correct ifroute file" do - allow(Yast::SCR) - .to receive(:Read) - .with(path(".target.size"), Yast::RoutingClass::ROUTES_FILE) - .and_return(1) + allow(Yast::FileUtils) + .to receive(:Exists) + .and_return(true) allow(Yast::Routing) .to receive(:devices) .and_return(["eth0", "eth1", "eth2"]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.128/testsuite/tests/Network_YaPI.out new/yast2-network-3.1.129/testsuite/tests/Network_YaPI.out --- old/yast2-network-3.1.128/testsuite/tests/Network_YaPI.out 2015-08-28 09:02:14.000000000 +0200 +++ new/yast2-network-3.1.129/testsuite/tests/Network_YaPI.out 2015-09-16 13:17:10.000000000 +0200 @@ -300,14 +300,21 @@ Write .etc.sysctl_conf."net.ipv6.conf.all.forwarding" "0" true Write .etc.sysctl_conf nil true Execute .target.bash "sysctl -w net.ipv6.conf.all.forwarding=0" 0 -Read .target.size "/etc/sysconfig/network/routes" 27 +Read .target.stat "/etc/sysconfig/network/routes" $["exists":true] Execute .target.bash "/bin/cp /etc/sysconfig/network/routes /etc/sysconfig/network/routes.YaST2save" 0 +Read .target.stat "/etc/sysconfig/network/ifroute-eth0" $["exists":true] Execute .target.remove "/etc/sysconfig/network/ifroute-eth0" 0 +Read .target.stat "/etc/sysconfig/network/ifroute-eth1" $["exists":true] Execute .target.remove "/etc/sysconfig/network/ifroute-eth1" 0 +Read .target.stat "/etc/sysconfig/network/ifroute-eth2" $["exists":true] Execute .target.remove "/etc/sysconfig/network/ifroute-eth2" 0 +Read .target.stat "/etc/sysconfig/network/ifroute-eth3" $["exists":true] Execute .target.remove "/etc/sysconfig/network/ifroute-eth3" 0 +Read .target.stat "/etc/sysconfig/network/ifroute-eth4" $["exists":true] Execute .target.remove "/etc/sysconfig/network/ifroute-eth4" 0 +Read .target.stat "/etc/sysconfig/network/ifroute-eth5" $["exists":true] Execute .target.remove "/etc/sysconfig/network/ifroute-eth5" 0 +Read .target.stat "/etc/sysconfig/network/ifroute-eth5.23" $["exists":true] Execute .target.remove "/etc/sysconfig/network/ifroute-eth5.23" 0 Write .routes [$["destination":"default", "device":"-", "gateway":"10.20.30.40", "netmask":"-"]] true Log assertion failure, expected '$["error":"A valid IP address consists of four integers\nin the range 0-255 separated by dots.", "exit":"-1"]', got '$["error":"A valid IPv4 address consists of four integers\nin the range 0-255 separated by dots.", "exit":"-1"]'