diff --git a/.travis.yml b/.travis.yml index bd4f79d6c..2903f5fe8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,10 @@ before_install: # disable rvm, use system Ruby - rvm reset - wget https://raw.githubusercontent.com/yast/yast-devtools/master/travis-tools/travis_setup.sh - - sh ./travis_setup.sh -p "yast2-devtools yast2-testsuite yast2 yast2-storage yast2-proxy yast2-country yast2-packager" -g rspec:2.14.1 + - sh ./travis_setup.sh -p "rake yast2-devtools yast2-testsuite yast2 yast2-storage yast2-proxy yast2-country yast2-packager" -g "rspec:2.14.1 yast-rake gettext" script: + - rake check:syntax + - rake check:pot - make -f Makefile.cvs - make - sudo make install diff --git a/package/yast2-network.changes b/package/yast2-network.changes index a685a3fb1..67b2bdf31 100644 --- a/package/yast2-network.changes +++ b/package/yast2-network.changes @@ -1,3 +1,40 @@ +------------------------------------------------------------------- +Fri Oct 17 07:45:24 UTC 2014 - mfilka@suse.com + +- bnc#898250, bnc#899363 + - ignore /etc/install.inf:usessh flag when the file is present in + installed system and always reload / restart network service in + case of updated configuration +- 3.1.109 + +------------------------------------------------------------------- +Thu Oct 10 17:10:42 CEST 2014 - schubi@suse.de + +- AutoYaST Routing Import: Initialize device list correctly. + (bnc#900352) +- 3.1.108 + +------------------------------------------------------------------- +Fri Oct 10 15:20:36 CEST 2014 - locilka@suse.com + +- Do not set default_route to "no" in auto-configuration in + inst-sys, just remove the entry completely (bnc#900466) +- 3.1.107 + +------------------------------------------------------------------- +Thu Oct 9 15:47:14 UTC 2014 - ancor@suse.com + +- Improved help text in "global options" (bnc#892678) +- 3.1.106 + +------------------------------------------------------------------- +Mon Oct 6 09:31:41 UTC 2014 - mfilka@suse.com + +- bnc#889287 + - during autoconfiguration at s390 use linuxrc's OSAHWAddr param + for LLADDR when available. +- 3.1.105 + ------------------------------------------------------------------- Tue Sep 30 10:15:38 UTC 2014 - ancor@suse.com diff --git a/package/yast2-network.spec b/package/yast2-network.spec index 8daa3114f..8d91388b7 100644 --- a/package/yast2-network.spec +++ b/package/yast2-network.spec @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.104 +Version: 3.1.109 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/include/network/lan/help.rb b/src/include/network/lan/help.rb index 248e64b88..3e3103a54 100644 --- a/src/include/network/lan/help.rb +++ b/src/include/network/lan/help.rb @@ -47,18 +47,23 @@ def initialize_network_lan_help(include_target) ), "managed" => # Network setup method help - # NetworkManager and ifup are programs + # NetworkManager and wicked are programs _( "

Network Setup Method

\n" + "

Use the NetworkManager as a desktop applet\n" + "managing connections for all interfaces. It is well suited\n" + "for switching among wired and wireless networks.

\n" ) + - # Network setup method help - # NetworkManager and wicked are programs _( "

Use wicked if you do not run a desktop environment\n" + "or need to use multiple interfaces at the same time.

\n" + ) + + # For systems not including NetworkManager by default (bnc#892678) + _( + "

NetworkManager is not part of every base\n" + + "installation repository. For example, to enable it on SUSE\n" + + "Linux Enterprise Server add the Workstation Extension\n" + + "repository and install the 'NetworkManager' package.

\n" ), "overview" => _( "

Network Card Overview
\n" + diff --git a/src/lib/network/install_inf_convertor.rb b/src/lib/network/install_inf_convertor.rb index 2abd9f115..22b9b05f3 100644 --- a/src/lib/network/install_inf_convertor.rb +++ b/src/lib/network/install_inf_convertor.rb @@ -346,7 +346,7 @@ def create_wlan_ifcfg end def create_s390_ifcfg(hardware) - hwaddr = InstallInf["HWAddr"] + hwaddr = InstallInf["OSAHWAddr"] return "" if hwaddr.empty? netdevice = dev_name diff --git a/src/lib/network/network_autoconfiguration.rb b/src/lib/network/network_autoconfiguration.rb index a05378c1a..cf1371492 100644 --- a/src/lib/network/network_autoconfiguration.rb +++ b/src/lib/network/network_autoconfiguration.rb @@ -206,7 +206,7 @@ def set_default_route_flag_if_wan_dev?(devname) set_default_route_flag(devname, "yes") if !activate_changes([devname]) - log.warn("Cannot reach reference server via #{devname}") + log.warn("Cannot activate default_route for device #{devname}") return false end @@ -218,7 +218,10 @@ def set_default_route_flag_if_wan_dev?(devname) log.info("Release notes can be reached via #{devname}: #{reached}") if !reached - set_default_route_flag(devname, "no") + # bsc#900466: Device is currently used for default route, but the test + # did not work, removing the default_route flag completely. + log.info "Removing default_route flag for device #{devname}" + set_default_route_flag(devname, nil) activate_changes([devname]) end diff --git a/src/modules/Lan.rb b/src/modules/Lan.rb index 1b0c137b2..6e506d5ae 100644 --- a/src/modules/Lan.rb +++ b/src/modules/Lan.rb @@ -614,14 +614,8 @@ def Write ) end - if LanItems.force_restart - NetworkService.Restart - else - # If the second installation stage has been called by yast.ssh via - # ssh, we should not restart network cause systemctl - # hangs in that case. (bnc#885640) - NetworkService.ReloadOrRestart if !Linuxrc.usessh - end + activate_network_service + Builtins.sleep(sl) end @@ -1153,6 +1147,24 @@ def HaveXenBridge publish :function => :Packages, :type => "list ()" publish :function => :AutoPackages, :type => "map ()" publish :function => :HaveXenBridge, :type => "boolean ()" + + private + def activate_network_service + if LanItems.force_restart + log.info("Network service activation forced") + NetworkService.Restart + else + log.info( + ("Attempting to reload network service, normal stage %s, ssh: %s") % + [Stage.normal, Linuxrc.usessh] + ) + # If the second installation stage has been called by yast.ssh via + # ssh, we should not restart network cause systemctl + # hangs in that case. (bnc#885640) + NetworkService.ReloadOrRestart if Stage.normal || !Linuxrc.usessh + end + end + end Lan = LanClass.new diff --git a/src/modules/Routing.rb b/src/modules/Routing.rb index fef648539..9ab636ec5 100644 --- a/src/modules/Routing.rb +++ b/src/modules/Routing.rb @@ -337,6 +337,11 @@ def write_routes(routes) # @return true if success def Import(settings) settings = deep_copy(settings) + + # Getting a list of devices which have already been imported by Lan.Import + # (bnc#900352) + @devices = NetworkInterfaces.List("") + ip_forward = Ops.get_boolean(settings, "ip_forward", false) ipv4_forward = Ops.get_boolean(settings, "ipv4_forward", ip_forward) ipv6_forward = Ops.get_boolean(settings, "ipv6_forward", ip_forward) diff --git a/test/ifroute_test.rb b/test/ifroute_test.rb index c3d6f6c57..b067a96a1 100755 --- a/test/ifroute_test.rb +++ b/test/ifroute_test.rb @@ -128,3 +128,55 @@ expect(Routing.write_routes(ROUTES_WITH_DEV)).to be true end end + +describe "Routing#Write" do + AY_ROUTES = [ + # empty AY config + {}, + # some routes + { + "routes" => [ + { + "destination" => "192.168.1.0", + "device" => "eth0", + "gateway" => "10.1.188.1", + "netmask" => "255.255.255.0" + }, + { + "destination" => "10.1.230.0", + "device" => "eth0", + "gateway" => "10.1.18.254", + "netmask" => "255.255.255.0" + }, + { + "destination" => "default", + "device" => "eth0", + "gateway" => "172.24.88.1", + "netmask" => "-" + }, + ] + } + ] + + AY_ROUTES.each_with_index do |ay_test, i| + it "does write route configuration files, ##{i}" do + # Devices which have already been imported by Lan.Import have to be read. + # (bnc#900352) + allow(NetworkInterfaces). + to receive(:List). + with(""). + and_return(["eth0"]) + + Routing.Import(ay_test) + + expect(Routing). + to receive(:write_route_file). + twice. + with(kind_of(String), ay_test.fetch("routes", [])). + and_return true + + Routing.Write + end + end + +end diff --git a/test/install_inf_convertor_test.rb b/test/install_inf_convertor_test.rb index b3a2b1a34..e5fe237e3 100755 --- a/test/install_inf_convertor_test.rb +++ b/test/install_inf_convertor_test.rb @@ -283,7 +283,7 @@ expect(Yast::InstallInfConvertor::InstallInf) .to receive(:[]) - .with("HWAddr") + .with("OSAHWAddr") .and_return(HWADDR) expect(Yast::InstallInfConvertor.instance.send(:create_s390_ifcfg, nil).strip!) .to eql ("LLADDR='#{HWADDR}'") diff --git a/test/lan_test.rb b/test/lan_test.rb index b729f82a9..5a0c31c91 100755 --- a/test/lan_test.rb +++ b/test/lan_test.rb @@ -84,3 +84,56 @@ end end + +describe "LanClass#activate_network_service" do + + Yast.import "Stage" + Yast.import "NetworkService" + + [0, 1].each do |linuxrc_usessh| + ssh_flag = linuxrc_usessh != 0 + + context "when linuxrc %s usessh flag" % ssh_flag ? "sets" : "doesn't set" do + before(:each) do + allow(Yast::Linuxrc) + .to receive(:usessh) + .and_return(ssh_flag) + end + + context "when asked in normal mode" do + before(:each) do + allow(Yast::Stage) + .to receive(:normal) + .and_return(true) + end + + it "tries to reload network service" do + expect(Yast::NetworkService) + .to receive(:ReloadOrRestart) + + Yast::Lan.send(:activate_network_service) + end + end + + context "when asked during installation" do + before(:each) do + allow(Yast::Stage) + .to receive(:normal) + .and_return(false) + end + + it "updates network service according usessh flag" do + if ssh_flag + expect(Yast::NetworkService) + .not_to receive(:ReloadOrRestart) + else + expect(Yast::NetworkService) + .to receive(:ReloadOrRestart) + end + + Yast::Lan.send(:activate_network_service) + end + end + end + end +end diff --git a/test/network_autoconfiguration_test.rb b/test/network_autoconfiguration_test.rb index abe0f7d62..d9a8b03d7 100755 --- a/test/network_autoconfiguration_test.rb +++ b/test/network_autoconfiguration_test.rb @@ -171,7 +171,7 @@ def set(section, key, value) it "configures just one NIC to have a default route" do expect { instance.configure_dhcp }.to_not raise_error result = Yast::NetworkInterfaces.FilterDevices("") - expect(result["eth"]["eth0"]["DHCLIENT_SET_DEFAULT_ROUTE"]).to eq "yes" - expect(result["eth"]["eth1"]["DHCLIENT_SET_DEFAULT_ROUTE"]).to_not eq "yes" + expect(result["eth"]["eth0"]["DHCLIENT_SET_DEFAULT_ROUTE"]).to eq "yes" + expect(result["eth"]["eth1"]["DHCLIENT_SET_DEFAULT_ROUTE"]).to eq nil end end diff --git a/test/routing_test.rb b/test/routing_test.rb index 797584729..bcf00e7e5 100755 --- a/test/routing_test.rb +++ b/test/routing_test.rb @@ -242,9 +242,9 @@ def fw_independent_write_expects exported = Routing.Export expect(exported["ipv4_forward"]) - .to be_equal(ay_test["ipv4_forward"]) if ay_test.has_key?("ipv4_forward") + .to eql(ay_test[:input]["ipv4_forward"]) if ay_test[:input].has_key?("ipv4_forward") expect(exported["ipv6_forward"]) - .to be_equal(ay_test["ipv6_forward"]) if ay_test.has_key?("ipv6_forward") + .to eql(ay_test[:input]["ipv6_forward"]) if ay_test[:input].has_key?("ipv6_forward") end end end