Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2020-06-14 18:14:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new.3606 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network" Sun Jun 14 18:14:59 2020 rev:425 rq:813549 version:4.3.5 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2020-06-10 00:40:10.393676317 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new.3606/yast2-network.changes 2020-06-14 18:15:04.150795199 +0200 @@ -1,0 +2,13 @@ +Thu Jun 11 08:24:34 UTC 2020 - Knut Anderssen <kanders...@suse.com> + +- Try to install the wireless-tools package when the package is + not installed and the wifi networks are scanned (bsc#1168479) +- 4.3.5 + +------------------------------------------------------------------- +Wed Jun 10 11:10:29 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Avoid error when accessing to Bond Slaves in s390 (bsc#1172444). +- 4.3.4 + +------------------------------------------------------------------- Old: ---- yast2-network-4.3.3.tar.bz2 New: ---- yast2-network-4.3.5.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.D3EXaT/_old 2020-06-14 18:15:05.262798932 +0200 +++ /var/tmp/diff_new_pack.D3EXaT/_new 2020-06-14 18:15:05.262798932 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.3.3 +Version: 4.3.5 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only ++++++ yast2-network-4.3.3.tar.bz2 -> yast2-network-4.3.5.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.3/package/yast2-network.changes new/yast2-network-4.3.5/package/yast2-network.changes --- old/yast2-network-4.3.3/package/yast2-network.changes 2020-06-08 20:35:38.000000000 +0200 +++ new/yast2-network-4.3.5/package/yast2-network.changes 2020-06-11 16:13:54.000000000 +0200 @@ -1,4 +1,17 @@ ------------------------------------------------------------------- +Thu Jun 11 08:24:34 UTC 2020 - Knut Anderssen <kanders...@suse.com> + +- Try to install the wireless-tools package when the package is + not installed and the wifi networks are scanned (bsc#1168479) +- 4.3.5 + +------------------------------------------------------------------- +Wed Jun 10 11:10:29 UTC 2020 - José Iván López González <jlo...@suse.com> + +- Avoid error when accessing to Bond Slaves in s390 (bsc#1172444). +- 4.3.4 + +------------------------------------------------------------------- Mon Jun 8 08:15:26 UTC 2020 - Knut Anderssen <kanders...@suse.com> - AutoYaST: Udev rules are written or copied to the target system diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.3/package/yast2-network.spec new/yast2-network-4.3.5/package/yast2-network.spec --- old/yast2-network-4.3.3/package/yast2-network.spec 2020-06-08 20:35:38.000000000 +0200 +++ new/yast2-network-4.3.5/package/yast2-network.spec 2020-06-11 16:13:54.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.3.3 +Version: 4.3.5 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only @@ -73,7 +73,7 @@ %build -%description +%description This package contains the YaST2 component for network configuration. %prep diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.3/src/include/network/lan/s390.rb new/yast2-network-4.3.5/src/include/network/lan/s390.rb --- old/yast2-network-4.3.3/src/include/network/lan/s390.rb 2020-06-08 20:35:38.000000000 +0200 +++ new/yast2-network-4.3.5/src/include/network/lan/s390.rb 2020-06-11 16:13:54.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (c) [2019] SUSE LLC +# Copyright (c) [2019-2020] SUSE LLC # # All Rights Reserved. # @@ -24,14 +24,15 @@ def initialize_network_lan_s390(_include_target) Yast.import "FileUtils" + Yast.import "Arch" end # Checks if driver was successfully loaded for particular device. def s390_DriverLoaded(devname) - return false if !Arch.s390 + return false if !Yast::Arch.s390 return false if devname.empty? - FileUtils.IsDirectory("#{SYS_DIR}/#{devname}") == true + Yast::FileUtils.IsDirectory("#{SYS_DIR}/#{devname}") == true end # Reads particular qeth attribute and returns its value as a string. @@ -41,14 +42,14 @@ def s390_ReadQethAttribute(devname, attrib) return nil if !s390_DriverLoaded(devname) - result = Convert.to_string( - SCR.Read( - path(".target.string"), - Builtins.sformat("%1/%2/device/%3", SYS_DIR, devname, attrib) + result = Yast::Convert.to_string( + Yast::SCR.Read( + Yast.path(".target.string"), + Yast::Builtins.sformat("%1/%2/device/%3", SYS_DIR, devname, attrib) ) ) - Builtins.regexpsub(result, "(.*)\n", "\\1") + Yast::Builtins.regexpsub(result, "(.*)\n", "\\1") end # Reads attributes for particular qeth based network device. @@ -72,27 +73,27 @@ result = {} qeth_layer2 = (s390_ReadQethAttribute(devname, "layer2") == "1") ? "yes" : "no" - result = Builtins.add(result, "QETH_LAYER2", qeth_layer2) + result = Yast::Builtins.add(result, "QETH_LAYER2", qeth_layer2) qeth_portno = s390_ReadQethAttribute(devname, "portno") - result = Builtins.add(result, "QETH_PORTNUMBER", qeth_portno) + result = Yast::Builtins.add(result, "QETH_PORTNUMBER", qeth_portno) # FIXME: another code handles chanids merged in one string separated by spaces. read_chan = s390_ReadQethAttribute(devname, "cdev0") write_chan = s390_ReadQethAttribute(devname, "cdev1") ctrl_chan = s390_ReadQethAttribute(devname, "cdev2") - qeth_chanids = Builtins.mergestring( + qeth_chanids = Yast::Builtins.mergestring( [read_chan, write_chan, ctrl_chan], " " ) - result = Builtins.add(result, "QETH_CHANIDS", qeth_chanids) + result = Yast::Builtins.add(result, "QETH_CHANIDS", qeth_chanids) # TODO: ipa_takover. study a bit. It cannot be read from /sys. Not visible using lsqeth, # qethconf configures it. - Builtins.y2debug("s390_ReadQethConfig: %1", result) + Yast::Builtins.y2debug("s390_ReadQethConfig: %1", result) - deep_copy(result) + Yast.deep_copy(result) end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.3/src/lib/y2network/widgets/wireless_essid.rb new/yast2-network-4.3.5/src/lib/y2network/widgets/wireless_essid.rb --- old/yast2-network-4.3.3/src/lib/y2network/widgets/wireless_essid.rb 2020-06-08 20:35:38.000000000 +0200 +++ new/yast2-network-4.3.5/src/lib/y2network/widgets/wireless_essid.rb 2020-06-11 16:13:54.000000000 +0200 @@ -22,6 +22,8 @@ require "yast2/feedback" Yast.import "String" +Yast.import "Package" +Yast.import "Stage" module Y2Network module Widgets @@ -110,21 +112,47 @@ end def handle - networks = essid_list + return unless scan_supported? + + @update_widget&.update_essid_list(fetch_essid_list) + nil + end + + private + + IWLIST_PKG = "wireless-tools".freeze + + def scan_supported? + return true if install_needed_packages + + Yast::Popup.Error( + _("The package %s was not installed. It is needed in order to " \ + "be able to scan the network") % IWLIST_PKG + ) + false + end + + # Require wireless-tools installation in order to be able to scan the + # wlan network (bsc#1112952, bsc#1168479) + # + # TODO: drop it when supported by wicked directly + def install_needed_packages + Yast::Stage.initial || + Yast::Package.Installed(IWLIST_PKG) || + Yast::Package.Install(IWLIST_PKG) + end + + def fetch_essid_list + networks = [] Yast2::Feedback.show("Obtaining essid list", headline: "Scanning network") do |_f| networks = essid_list log.info("Found networks: #{networks}") end - return unless @update_widget - - @update_widget.update_essid_list(networks) - nil + networks end - private - # TODO: own class and do not call directly in widget. def essid_list command = "#{link_up} && #{scan} | #{grep_and_cut_essid} | #{sort}" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.3/test/y2network/interface_config_builders/bonding_test.rb new/yast2-network-4.3.5/test/y2network/interface_config_builders/bonding_test.rb --- old/yast2-network-4.3.3/test/y2network/interface_config_builders/bonding_test.rb 2020-06-08 20:35:38.000000000 +0200 +++ new/yast2-network-4.3.5/test/y2network/interface_config_builders/bonding_test.rb 2020-06-11 16:13:54.000000000 +0200 @@ -1,6 +1,6 @@ #!/usr/bin/env rspec -# Copyright (c) [2019] SUSE LLC +# Copyright (c) [2019-2020] SUSE LLC # # All Rights Reserved. # @@ -47,8 +47,104 @@ end describe "#bondable_interfaces" do - it "returns array" do + before do + allow(config).to receive(:interfaces).and_return(interfaces_collection) + + allow(config).to receive(:connections).and_return(connection_configs_collection) + + allow(connection_config).to receive(:name).and_return(connection_name) + + allow(connection_config).to receive(:find_master).and_return(connection_master) + + allow(Yast::Arch).to receive(:s390).and_return(s390) + end + + let(:interfaces_collection) do + Y2Network::InterfacesCollection.new([interface1, interface2]) + end + + let(:connection_configs_collection) do + Y2Network::ConnectionConfigsCollection.new([connection_config]) + end + + let(:interface1) { Y2Network::Interface.new("iface1") } + + let(:interface2) { Y2Network::Interface.new("iface2") } + + let(:connection_config) { Y2Network::ConnectionConfig::Bonding.new } + + let(:connection_name) { "" } + + let(:connection_master) { nil } + + let(:s390) { false } + + shared_examples "interface filters" do + context "when an interface does not have a connection config yet" do + let(:connection_name) { "iface2" } # only iface2 has a config + + it "includes the interface without a connection config" do + expect(subject.bondable_interfaces).to include(interface1) + end + end + + context "when an interface has a connection config" do + let(:connection_name) { "iface1" } + + context "and there already is a master connection" do + let(:connection_master) do + instance_double(Y2Network::ConnectionConfig::Bonding, name: "bond1") + end + + it "does not include the interface" do + expect(subject.bondable_interfaces).to_not include(interface1) + end + end + + context "and there is no master connection yet" do + let(:connection_master) { nil } + + it "includes the interface" do + expect(subject.bondable_interfaces).to include(interface1) + end + end + end + end + + it "returns an array" do expect(subject.bondable_interfaces).to be_a(::Array) end + + context "when the architecture is s390" do + let(:s390) { true } + + before do + allow(Yast::FileUtils).to receive(:IsDirectory).and_return(true) + end + + context "and the interface has no L2 support" do + before do + allow(Yast::SCR).to receive(:Read).with(anything, /.*iface1.*\/layer2/).and_return("0\n") + end + + it "does not include the interface" do + expect(subject.bondable_interfaces).to_not include(interface1) + end + end + + context "and the interface has L2 support" do + before do + allow(Yast::SCR).to receive(:Read).with(anything, /.*iface1.*\/layer2/).and_return("1\n") + end + + include_examples "interface filters" + end + end + + context "when the architecture is not s390" do + let(:s390) { false } + + include_examples "interface filters" + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.3.3/test/y2network/widgets/wireless_essid_test.rb new/yast2-network-4.3.5/test/y2network/widgets/wireless_essid_test.rb --- old/yast2-network-4.3.3/test/y2network/widgets/wireless_essid_test.rb 2020-06-08 20:35:38.000000000 +0200 +++ new/yast2-network-4.3.5/test/y2network/widgets/wireless_essid_test.rb 2020-06-11 16:13:54.000000000 +0200 @@ -29,3 +29,56 @@ include_examples "CWM::CustomWidget" end + +describe Y2Network::Widgets::WirelessScan do + let(:builder) { Y2Network::InterfaceConfigBuilder.for("wlan") } + let(:essid) { Y2Network::Widgets::WirelessEssidName.new(builder) } + let(:installed) { true } + let(:initial_stage) { false } + let(:available_networks) { ["YaST", "Guests"] } + subject { described_class.new(builder, update: essid) } + + before do + allow(subject).to receive(:scan_supported?).and_return(installed) + allow(Yast::Package).to receive(:Installed).and_return(installed) + allow(Yast::Stage).to receive(:initial).and_return(initial_stage) + allow(subject).to receive(:fetch_essid_list).and_return(available_networks) + allow(essid).to receive(:update_essid_list) + end + + describe "#handle" do + context "when the package for scanning wireless networks is not installed" do + let(:installed) { false } + before do + allow(subject).to receive(:scan_supported?).and_call_original + end + + it "tries to install it" do + expect(Yast::Package).to receive(:Install).and_return(true) + subject.handle + end + + context "and failed installing the missing package" do + it "returns without scanning the available network" do + allow(Yast::Package).to receive(:Install).and_return(false) + expect(Yast::Popup).to receive(:Error).with(/was not installed/) + expect(subject).to_not receive(:fetch_essid_list) + + expect(subject.handle).to eql(nil) + end + end + end + + context "when the package for scanning wireless networks is installed" do + it "scans the list of available essids" do + expect(subject).to receive(:fetch_essid_list).and_return(available_networks) + subject.handle + end + + it "updates the widget with the list of the available essids with the obtained one" do + expect(essid).to receive(:update_essid_list).with(available_networks) + subject.handle + end + end + end +end