commit yast2-network for openSUSE:Factory
Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2016-09-17 14:35:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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 2016-09-08 17:38:15.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2016-09-17 14:35:18.000000000 +0200 @@ -1,0 +2,7 @@ +Wed Sep 7 11:23:16 UTC 2016 - mfilka@suse.com + +- bnc#993587 + - extended fix from 3.1.168 to cover also virtual interfaces +- 3.1.170 + +------------------------------------------------------------------- Old: ---- yast2-network-3.1.169.tar.bz2 New: ---- yast2-network-3.1.170.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.WKnXVk/_old 2016-09-17 14:35:19.000000000 +0200 +++ /var/tmp/diff_new_pack.WKnXVk/_new 2016-09-17 14:35:19.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.169 +Version: 3.1.170 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-network-3.1.169.tar.bz2 -> yast2-network-3.1.170.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/package/yast2-network.changes new/yast2-network-3.1.170/package/yast2-network.changes --- old/yast2-network-3.1.169/package/yast2-network.changes 2016-09-06 10:01:22.000000000 +0200 +++ new/yast2-network-3.1.170/package/yast2-network.changes 2016-09-14 13:00:26.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Sep 7 11:23:16 UTC 2016 - mfilka@suse.com + +- bnc#993587 + - extended fix from 3.1.168 to cover also virtual interfaces +- 3.1.170 + +------------------------------------------------------------------- Sat Sep 3 20:02:55 UTC 2016 - mfilka@suse.com - bnc#988157 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/package/yast2-network.spec new/yast2-network-3.1.170/package/yast2-network.spec --- old/yast2-network-3.1.169/package/yast2-network.spec 2016-09-06 10:01:22.000000000 +0200 +++ new/yast2-network-3.1.170/package/yast2-network.spec 2016-09-14 13:00:26.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.169 +Version: 3.1.170 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/src/include/network/routines.rb new/yast2-network-3.1.170/src/include/network/routines.rb --- old/yast2-network-3.1.169/src/include/network/routines.rb 2016-09-06 10:01:22.000000000 +0200 +++ new/yast2-network-3.1.170/src/include/network/routines.rb 2016-09-14 13:00:26.000000000 +0200 @@ -686,7 +686,7 @@ # @param Shell command to run # @return whether command execution succeeds def Run(command) - ret = SCR.Execute(path(".target.bash"), command) == 0 + ret = SCR.Execute(path(".target.bash"), command).zero? Builtins.y2error("Run <%1>: Command execution failed.", command) if !ret @@ -694,9 +694,13 @@ end # TODO: end - # Return list of all interfaces present in the system (not only configured ones as NetworkInterfaces::List does). + # Return list of all interfaces present in the system. + # + # It means all interfaces which exists in the system at the time. + # /sys filesystem is used for checking that. # # @return [Array] of interface names. + # FIXME: rename e.g. to sys_interfaces def GetAllInterfaces result = RunAndRead("ls /sys/class/net") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/src/modules/Lan.rb new/yast2-network-3.1.170/src/modules/Lan.rb --- old/yast2-network-3.1.169/src/modules/Lan.rb 2016-09-06 10:01:22.000000000 +0200 +++ new/yast2-network-3.1.170/src/modules/Lan.rb 2016-09-14 13:00:26.000000000 +0200 @@ -214,51 +214,27 @@ down end + # Checks local configuration if IPv6 is allowed + # + # return [Boolean] true when IPv6 is enabled in the system def readIPv6 - @ipv6 = true + ipv6 = true - methods = - # "module" : $[ - # "filelist" : ["ipv6", "50-ipv6.conf"], - # "filepath" : "/etc/modprobe.d/", - # "regexp" : "^[[:space:]]*(install ipv6 /bin/true)" - # ] - { - "builtin" => { - "filelist" => ["sysctl.conf"], - "filepath" => "/etc/", - "regexp" => "^[[:space:]]*(net.ipv6.conf.all.disable_ipv6)[[:space:]]*=[[:space:]]*1" - } - } + sysctl_path = "/etc/sysctl.conf" + ipv6_regexp = /^[[:space:]]*(net.ipv6.conf.all.disable_ipv6)[[:space:]]*=[[:space:]]*1/ - Builtins.foreach(methods) do |which, method| - filelist = Ops.get_list(method, "filelist", []) - filepath = Ops.get_string(method, "filepath", "") - regexp = Ops.get_string(method, "regexp", "") - Builtins.foreach(filelist) do |file| - filename = Builtins.sformat("%1/%2", filepath, file) - if FileUtils.Exists(filename) - Builtins.foreach( - Builtins.splitstring( - Convert.to_string(SCR.Read(path(".target.string"), filename)), - "\n" - ) - ) do |row| - if Ops.greater_than( - Builtins.size( - Builtins.regexptokenize(String.CutBlanks(row), regexp) - ), - 0 - ) - Builtins.y2milestone("IPv6 is disabled by '%1' method.", which) - @ipv6 = false - end - end - end - end + # sysctl.conf is kind of "mandatory" config file, use default + if !FileUtils.Exists(sysctl_path) + log.error("readIPv6: #{sysctl_path} is missing") + return true end - nil + lines = (SCR.Read(path(".target.string"), sysctl_path) || []).split("\n") + ipv6 = false if lines.any? { |row| row =~ ipv6_regexp } + + log.info("readIPv6: IPv6 is #{ipv6 ? "enabled" : "disabled"}") + + ipv6 end # Read all network settings from the SCR @@ -374,7 +350,7 @@ ProgressNextStage(_("Reading network configuration...")) if @gui NetworkConfig.Read - readIPv6 + @ipv6 = readIPv6 Builtins.sleep(sl) @@ -1138,10 +1114,14 @@ NetworkService.ReloadOrRestart if Stage.normal || !Linuxrc.usessh when :remote_installer + ifaces = LanItems.getNetworkInterfaces + # last instance handling "special" cases like ssh installation # FIXME: most probably not everything will be set properly log.info("Running in ssh/vnc installer -> just setting links up") - LanItems.reload_config(LanItems.GetAllInterfaces()) + log.info("Available interfaces: #{ifaces}") + + LanItems.reload_config(ifaces) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/src/modules/LanItems.rb new/yast2-network-3.1.170/src/modules/LanItems.rb --- old/yast2-network-3.1.169/src/modules/LanItems.rb 2016-09-06 10:01:22.000000000 +0200 +++ new/yast2-network-3.1.170/src/modules/LanItems.rb 2016-09-14 13:00:26.000000000 +0200 @@ -848,7 +848,10 @@ GetDeviceNames(GetNetcardInterfaces()) end - # get list of all configurations for "netcard" macro in NetworkInterfaces module + # Get list of all configured interfaces + # + # return [Array] list of strings - interface names (eth0, ...) + # FIXME: rename e.g. to configured_interfaces def getNetworkInterfaces configurations = NetworkInterfaces.FilterDevices("netcard") devtypes = NetworkInterfaces.CardRegex["netcard"].to_s.split("|") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/test/SCRStub.rb new/yast2-network-3.1.170/test/SCRStub.rb --- old/yast2-network-3.1.169/test/SCRStub.rb 2016-09-06 10:01:23.000000000 +0200 +++ new/yast2-network-3.1.170/test/SCRStub.rb 2016-09-14 13:00:26.000000000 +0200 @@ -50,12 +50,37 @@ # Yaml files are stored in the scr_read subdirectory of the data directory # and named after the yast path (without the leading '.'). # + # @param path_name [String] an SCR path, eg. ".etc.xinetd_conf.services" + # # @return Object - def stub_scr_read(path_name) + def yaml_stub_scr_read(path_name) file = File.join(DATA_PATH, "scr_read", path_name[1..-1] + ".yml") info = YAML.load_file(file) - path = Yast::Path.new(path_name) - allow(Yast::SCR).to receive(:Read).with(path).and_return info + mock_path(path_name, info) + end + + # Stubs calls to SCR.Read. Returns file content as a list of lines. + # + # Should be equivalent to ycp's SCR::Read(".target.string", path) + # + # @param path_name [String] an absolute filesystem path, eg. "/etc/sysctl.conf" + # + # @return [Array] list of lines + def string_stub_scr_read(path_name) + file = File.join(DATA_PATH, "scr_read", path_name[1..-1]) + info = File.read(file) + mock_path(".target.string", info, path_name) + end + + # Stubs SCR.Read for given target file using given content + def mock_path(target, content, params = nil) + path = Yast::Path.new(target) + + if params + allow(Yast::SCR).to receive(:Read).with(path, params).and_return content + else + allow(Yast::SCR).to receive(:Read).with(path).and_return content + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/test/data/scr_read/etc/sysctl.conf new/yast2-network-3.1.170/test/data/scr_read/etc/sysctl.conf --- old/yast2-network-3.1.169/test/data/scr_read/etc/sysctl.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.170/test/data/scr_read/etc/sysctl.conf 2016-09-14 13:00:26.000000000 +0200 @@ -0,0 +1,5 @@ +kernel.sysrq = 0 +net.ipv4.ip_forward = 0 +net.ipv4.tcp_syncookies = 1 +net.ipv6.conf.all.forwarding = 0 +net.ipv6.conf.all.disable_ipv6 = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/test/lan_test.rb new/yast2-network-3.1.170/test/lan_test.rb --- old/yast2-network-3.1.169/test/lan_test.rb 2016-09-06 10:01:23.000000000 +0200 +++ new/yast2-network-3.1.170/test/lan_test.rb 2016-09-14 13:00:26.000000000 +0200 @@ -210,3 +210,18 @@ expect(Yast::Lan.Modified).to be false end end + +describe "LanClass#readIPv6" do + it "reads IPv6 setup from /etc/sysctl.conf" do + allow(Yast::FileUtils).to receive(:Exists).and_return(true) + string_stub_scr_read("/etc/sysctl.conf") + + expect(Yast::Lan.readIPv6).to be false + end + + it "returns true when /etc/sysctl.conf is missing" do + allow(Yast::FileUtils).to receive(:Exists).and_return(false) + + expect(Yast::Lan.readIPv6).to be true + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.169/test/remote_test.rb new/yast2-network-3.1.170/test/remote_test.rb --- old/yast2-network-3.1.169/test/remote_test.rb 2016-09-06 10:01:23.000000000 +0200 +++ new/yast2-network-3.1.170/test/remote_test.rb 2016-09-14 13:00:26.000000000 +0200 @@ -150,7 +150,7 @@ describe ".configure_display_manager" do before do stub_scr_write - stub_scr_read(".etc.xinetd_conf.services") + yaml_stub_scr_read(".etc.xinetd_conf.services") allow(Package).to receive(:Installed).and_return true end
participants (1)
-
root@hilbert.suse.de