Hello community, here is the log from the commit of package yast2-network for openSUSE:Leap:15.2 checked in at 2020-04-08 12:47:50 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/yast2-network (Old) and /work/SRC/openSUSE:Leap:15.2/.yast2-network.new.3248 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network" Wed Apr 8 12:47:50 2020 rev:125 rq:791110 version:4.2.65 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/yast2-network/yast2-network.changes 2020-03-26 05:40:57.719265816 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.yast2-network.new.3248/yast2-network.changes 2020-04-08 12:47:52.214326934 +0200 @@ -1,0 +2,17 @@ +Thu Apr 2 11:33:49 UTC 2020 - Imobach Gonzalez Sosa <[email protected]> + +- AutoYaST: Do not try to activate network devices that are already + active in S390 systems (bsc#1163149). Related to jsc#SLE-7396. +- AutoYaST: Allow to use spaces or colons to separate channel IDs + in the "chanids" element. +- 4.2.65 + +------------------------------------------------------------------- +Fri Mar 27 14:30:34 UTC 2020 - Knut Anderssen <[email protected]> + +- Refresh the current system cached network configuration with the + one written avoiding inconsistencies during installation + (bsc#1162987) +- 4.2.64 + +------------------------------------------------------------------- Old: ---- yast2-network-4.2.63.tar.bz2 New: ---- yast2-network-4.2.65.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.0wH2Tj/_old 2020-04-08 12:47:52.694327175 +0200 +++ /var/tmp/diff_new_pack.0wH2Tj/_new 2020-04-08 12:47:52.694327175 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.2.63 +Version: 4.2.65 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only ++++++ yast2-network-4.2.63.tar.bz2 -> yast2-network-4.2.65.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/package/yast2-network.changes new/yast2-network-4.2.65/package/yast2-network.changes --- old/yast2-network-4.2.63/package/yast2-network.changes 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/package/yast2-network.changes 2020-04-02 15:02:55.000000000 +0200 @@ -1,4 +1,21 @@ ------------------------------------------------------------------- +Thu Apr 2 11:33:49 UTC 2020 - Imobach Gonzalez Sosa <[email protected]> + +- AutoYaST: Do not try to activate network devices that are already + active in S390 systems (bsc#1163149). Related to jsc#SLE-7396. +- AutoYaST: Allow to use spaces or colons to separate channel IDs + in the "chanids" element. +- 4.2.65 + +------------------------------------------------------------------- +Fri Mar 27 14:30:34 UTC 2020 - Knut Anderssen <[email protected]> + +- Refresh the current system cached network configuration with the + one written avoiding inconsistencies during installation + (bsc#1162987) +- 4.2.64 + +------------------------------------------------------------------- Thu Mar 19 13:52:31 UTC 2020 - Knut Anderssen <[email protected]> - AutoYaST: do not crash when defined dns section whitout hostname diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/package/yast2-network.spec new/yast2-network-4.2.65/package/yast2-network.spec --- old/yast2-network-4.2.63/package/yast2-network.spec 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/package/yast2-network.spec 2020-04-02 15:02:55.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.2.63 +Version: 4.2.65 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/src/lib/network/network_autoyast.rb new/yast2-network-4.2.65/src/lib/network/network_autoyast.rb --- old/yast2-network-4.2.63/src/lib/network/network_autoyast.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/src/lib/network/network_autoyast.rb 2020-04-02 15:02:55.000000000 +0200 @@ -125,15 +125,20 @@ devices_section = Y2Network::AutoinstProfile::S390DevicesSection .new_from_hashes(profile_devices) connections = Y2Network::Autoinst::S390DevicesReader.new(devices_section).config - connections.each do |conn| + connections.each do |conn| builder = Y2Network::InterfaceConfigBuilder.for(conn.type, config: conn) activator = Y2Network::S390DeviceActivator.for(builder) + if !activator.configured_interface.empty? + log.info "Interface #{activator.configured_interface} is already active. " \ + "Skipping the activation." + next + end + log.info "Created interface #{activator.configured_interface}" if activator.configure rescue RuntimeError => e log.error("An error ocurred when trying to activate the s390 device: #{conn.inspect}") - log.error("Error: #{e.sinpect}") - + log.error("Error: #{e.inspect}") end true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/src/lib/y2network/autoinst/s390_devices_reader.rb new/yast2-network-4.2.65/src/lib/y2network/autoinst/s390_devices_reader.rb --- old/yast2-network-4.2.63/src/lib/y2network/autoinst/s390_devices_reader.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/src/lib/y2network/autoinst/s390_devices_reader.rb 2020-04-02 15:02:55.000000000 +0200 @@ -66,18 +66,30 @@ end def load_qeth(config, device_section) - chanids = device_section.chanids - config.read_channel, config.write_channel, config.data_channel = chanids.split(" ") + config.read_channel, config.write_channel, config.data_channel = + chanids_from(device_section.chanids) config.layer2 = device_section.layer2 end def load_ctc(config, device_section) - config.read_channel, config.write_channel = device_section.chanids.split(" ") + config.read_channel, config.write_channel = chanids_from(device_section.chanids) config.protocol = device_section.protocol end def load_lcs(config, device_section) - config.read_channel, config.write_channel = device_section.chanids.split(" ") + config.read_channel, config.write_channel = chanids_from(device_section.chanids) + end + + # Separator used for the list of channel IDs + CHANIDS_SEPARATOR = ":".freeze + private_constant :CHANIDS_SEPARATOR + + # Returns the list of channel IDs from a string + # + # @param ids [String] String representing the channel IDs + # @return [Array<String>] + def chanids_from(ids) + ids.to_s.split(CHANIDS_SEPARATOR) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/src/lib/y2network/autoinst_profile/s390_device_section.rb new/yast2-network-4.2.65/src/lib/y2network/autoinst_profile/s390_device_section.rb --- old/yast2-network-4.2.63/src/lib/y2network/autoinst_profile/s390_device_section.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/src/lib/y2network/autoinst_profile/s390_device_section.rb 2020-04-02 15:02:55.000000000 +0200 @@ -44,7 +44,7 @@ define_attr_accessors # @!attribute chanids - # @return [String] channel device id separated by spaces + # @return [String] channel device id separated by spaces or colons # @!attribute layer2 # @return [Boolean] Whether layer2 is enabler or not @@ -71,6 +71,17 @@ result end + # Creates an instance based on the profile representation used by the AutoYaST modules + # (array of hashes objects). + # + # @param hash [Hash] Networking section from an AutoYaST profile + # @return [S390DeviceSection] + def self.new_from_hashes(hash) + result = new + result.init_from_hashes(hash) + result + end + # Method used by {.new_from_network} to populate the attributes when cloning a network s390 # device # @@ -91,6 +102,26 @@ true end + + # Method used by {.new_from_hashes} to populate the attributes when importing a profile + # + # @param hash [Hash] see {.new_from_hashes} + def init_from_hashes(hash) + super + self.chanids = normalized_chanids(hash["chanids"]) if hash["chanids"] + end + + private + + # Normalizes the list of channel IDs + # + # It replaces spaces with colons. + # + # @param ids [String] String representing the channel IDs + # @return [String] + def normalized_chanids(ids) + ids.gsub(/\ +/, ":") + end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/src/lib/y2network/hwinfo.rb new/yast2-network-4.2.65/src/lib/y2network/hwinfo.rb --- old/yast2-network-4.2.63/src/lib/y2network/hwinfo.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/src/lib/y2network/hwinfo.rb 2020-04-02 15:02:55.000000000 +0200 @@ -37,7 +37,7 @@ read_hardware @netcards = ReadHardware("netcard").map do |attrs| name = attrs["dev_name"] - extra_attrs = name ? extra_attrs_for(name) : {} + extra_attrs = name.to_s.empty? ? {} : extra_attrs_for(name) Hwinfo.new(attrs.merge(extra_attrs)) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/src/modules/Lan.rb new/yast2-network-4.2.65/src/modules/Lan.rb --- old/yast2-network-4.2.63/src/modules/Lan.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/src/modules/Lan.rb 2020-04-02 15:02:55.000000000 +0200 @@ -506,6 +506,8 @@ target = :sysconfig if Mode.auto yast_config.write(original: system_config, target: target) + # Force a refresh of the system_config bsc#1162987 + add_config(:system, yast_config.copy) Progress.set(orig) Builtins.sleep(sl) @@ -862,20 +864,14 @@ # ssh, we should not restart network because systemctl # hangs in that case. (bnc#885640) action = :reload_restart if Stage.normal || !Linuxrc.usessh - action = :force_restart if LanItems.force_restart action = :remote_installer if Stage.initial && (Linuxrc.usessh || Linuxrc.vnc) case action - when :force_restart - log.info("Network service activation forced") - NetworkService.Restart - when :reload_restart log.info("Attempting to reload network service, normal stage #{Stage.normal}, " \ "ssh: #{Linuxrc.usessh}") NetworkService.ReloadOrRestart if Stage.normal || !Linuxrc.usessh - when :remote_installer connection_names = yast_config&.connections&.map(&:name) || [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/src/modules/LanItems.rb new/yast2-network-4.2.65/src/modules/LanItems.rb --- old/yast2-network-4.2.63/src/modules/LanItems.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/src/modules/LanItems.rb 2020-04-02 15:02:55.000000000 +0200 @@ -65,9 +65,6 @@ # Which operation is pending? @operation = nil - # in special cases when rcnetwork reload is not enought - @force_restart = false - @description = "" @type = "" @@ -800,7 +797,6 @@ publish_variable :driver_options, "map <string, any>" publish_variable :autoinstall_settings, "map" publish_variable :operation, "symbol" - publish_variable :force_restart, "boolean" publish_variable :description, "string" publish_variable :type, "string" # note: read-only param. Any modification is ignored. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/test/lan_test.rb new/yast2-network-4.2.65/test/lan_test.rb --- old/yast2-network-4.2.63/test/lan_test.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/test/lan_test.rb 2020-04-02 15:02:55.000000000 +0200 @@ -90,12 +90,10 @@ let(:eth0) { Y2Network::ConnectionConfig::Ethernet.new.tap { |c| c.name = "eth0" } } let(:eth1) { Y2Network::ConnectionConfig::Ethernet.new.tap { |c| c.name = "eth1" } } - let(:force_restart) { false } let(:installation) { false } before do subject.add_config(:yast, yast_config) - allow(Yast::LanItems).to receive(:force_restart).and_return(force_restart) allow(Yast::Stage).to receive(:normal).and_return(!installation) allow(Yast::Stage).to receive(:initial).and_return(installation) end @@ -109,24 +107,11 @@ end context "when asked in normal mode" do - context "and a restart is not forced" do - it "tries to reload network service" do - expect(Yast::NetworkService) - .to receive(:ReloadOrRestart) + it "tries to reload network service" do + expect(Yast::NetworkService) + .to receive(:ReloadOrRestart) - Yast::Lan.send(:activate_network_service) - end - end - - context "and a restart is forced" do - let(:force_restart) { true } - - it "tries to restart the network service" do - expect(Yast::NetworkService) - .to receive(:Restart) - - Yast::Lan.send(:activate_network_service) - end + Yast::Lan.send(:activate_network_service) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/test/network_autoyast_test.rb new/yast2-network-4.2.65/test/network_autoyast_test.rb --- old/yast2-network-4.2.63/test/network_autoyast_test.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/test/network_autoyast_test.rb 2020-04-02 15:02:55.000000000 +0200 @@ -23,6 +23,8 @@ require "network/network_autoyast" require "y2network/sysconfig/config_reader" +require "y2network/s390_device_activators/qeth" + Yast.import "Profile" Yast.import "Lan" @@ -30,7 +32,7 @@ subject(:network_autoyast) { Yast::NetworkAutoYast.instance } let(:config) do Y2Network::Config.new( - interfaces: [], + interfaces: Y2Network::InterfacesCollection.new([]), routing: Y2Network::Routing.new(tables: []), dns: Y2Network::DNS.new, source: :sysconfig @@ -341,4 +343,54 @@ end end end + + describe "#activate_s390_devices" do + let(:section) do + [ + { + "chanids" => "0.0.0800 0.0.0801 0.0.0802", + "type" => "qeth" + } + ] + end + + let(:activator) do + instance_double( + Y2Network::S390DeviceActivators::Qeth, + configured_interface: configured_interface + ) + end + + let(:configured_interface) { "" } + + before do + allow(Y2Network::S390DeviceActivators::Qeth).to receive(:new) + .and_return(activator) + end + + it "activates the given device" do + expect(activator).to receive(:configure) + subject.activate_s390_devices(section) + end + + context "if the device is already active" do + let(:configured_interface) { "eth0" } + + it "does not activate the device" do + expect(activator).to_not receive(:configure) + subject.activate_s390_devices(section) + end + end + + context "if the activation fails" do + before do + allow(activator).to receive(:configure).and_raise(RuntimeError) + end + + it "logs the error" do + expect(subject.log).to receive(:error).at_least(1) + subject.activate_s390_devices(section) + end + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/test/y2network/autoinst/s390_devices_reader_test.rb new/yast2-network-4.2.65/test/y2network/autoinst/s390_devices_reader_test.rb --- old/yast2-network-4.2.63/test/y2network/autoinst/s390_devices_reader_test.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/test/y2network/autoinst/s390_devices_reader_test.rb 2020-04-02 15:02:55.000000000 +0200 @@ -51,8 +51,19 @@ describe "#config" do it "builds a new Y2Network::ConnectionConfigsCollection" do - expect(subject.config).to be_a Y2Network::ConnectionConfigsCollection - expect(subject.config.size).to eq(2) + expect(subject.config).to contain_exactly( + an_object_having_attributes( + read_channel: "0.0.0700", + write_channel: "0.0.0701", + data_channel: "0.0.0702" + ), + an_object_having_attributes( + read_channel: "0.0.0800", + write_channel: "0.0.0801", + data_channel: "0.0.0802", + layer2: true + ) + ) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.63/test/y2network/autoinst_profile/s390_device_section_test.rb new/yast2-network-4.2.65/test/y2network/autoinst_profile/s390_device_section_test.rb --- old/yast2-network-4.2.63/test/y2network/autoinst_profile/s390_device_section_test.rb 2020-03-20 23:08:58.000000000 +0100 +++ new/yast2-network-4.2.65/test/y2network/autoinst_profile/s390_device_section_test.rb 2020-04-02 15:02:55.000000000 +0200 @@ -59,10 +59,26 @@ } end - it "loads properly boot protocol" do + it "loads properly type, chanids and boot protocol" do section = described_class.new_from_hashes(hash) expect(section.type).to eq "ctc" + expect(section.chanids).to eq("0.0.0800:0.0.0801") expect(section.protocol).to eq "1" end + + context "using the old syntax for chanids" do + let(:hash) do + { + "type" => "ctc", + "chanids" => "0.0.0800 0.0.0801", + "protocol" => "1" + } + end + + it "loads properly the chanids" do + section = described_class.new_from_hashes(hash) + expect(section.chanids).to eq("0.0.0800:0.0.0801") + end + end end end
