Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2018-11-01 19:09:24 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-network" Thu Nov 1 19:09:24 2018 rev:393 rq:645685 version:4.1.15 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2018-09-04 22:50:51.463909529 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2018-11-01 19:09:26.250032826 +0100 @@ -1,0 +2,72 @@ +Wed Oct 31 08:37:13 UTC 2018 - mfilka@suse.com + +- bnc#1111925 + - always propose wpa_supplicant when configuring wlan +- bsc#1113080 + - Fix detection of peap mode (jreidinger@suse.com) +- Propose most commonly used setup for WPA by default +- 4.1.15 + +------------------------------------------------------------------- +Wed Oct 24 13:12:33 UTC 2018 - jreidinger@suse.com + +- Fix detection of peap mode (bsc#1113080) +- 4.1.14 + +------------------------------------------------------------------- +Tue Oct 16 19:29:30 UTC 2018 - knut.anderssen@suse.com + +- Simplified the installation network proposal collecting all the + configured dhcp interfaces in a single entry (fate#326480) +- 4.1.13 + +------------------------------------------------------------------- +Tue Oct 16 09:02:26 UTC 2018 - mfilka@suse.com + +- bsc#1110598 + - fixed path to license file +- 4.1.12 + +------------------------------------------------------------------- +Mon Oct 15 08:38:58 UTC 2018 - mfilka@suse.com + +- fate#323454 + - wicked compatible parsing of NTP servers from dhcp leases +- 4.1.11 + +------------------------------------------------------------------- +Thu Oct 4 21:46:23 UTC 2018 - knut.anderssen@suse.com + +- Fixes to the networking AY schema (bsc#1108852) + - Added missed s390 device 'layer2' boolean element. +- 4.1.10 + +------------------------------------------------------------------- +Wed Oct 3 07:33:01 UTC 2018 - mfilka@suse.com + +- bnc#1105230 + - do not crash with internal error when 0.0.0.0 netmask is used + in the routing tab +- Activate s390 network devices before applying udev naming rules, + avoiding "Invalid key/value pair in + /etc/udev/rules.d/70-persistent-net.rules" (bsc#1095761) + (by mvidner@suse.com) +- 4.1.9 + +------------------------------------------------------------------- +Tue Oct 2 19:59:14 UTC 2018 - mfilka@suse.com + +- bnc#1109312 + - fixed internal error (replaced calls to LanItems::FreeDevices + which was removed) +- 4.1.8 + +------------------------------------------------------------------- +Tue Sep 18 07:31:10 UTC 2018 - mfilka@suse.com + +- bnc#964856 + - adapted to changes in NetworkInterfaces API + - GetFreeDevice and GetFreeDevices was dropped +- 4.1.7 + +------------------------------------------------------------------- Old: ---- yast2-network-4.1.6.tar.bz2 New: ---- yast2-network-4.1.15.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.Xbp1zh/_old 2018-11-01 19:09:26.742032852 +0100 +++ /var/tmp/diff_new_pack.Xbp1zh/_new 2018-11-01 19:09:26.746032852 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.1.6 +Version: 4.1.15 Release: 0 BuildArch: noarch @@ -107,7 +107,7 @@ %dir %{yast_docdir} %doc %{yast_docdir}/CONTRIBUTING.md -%license %{yast_docdir}/COPYING +%license COPYING %doc %{yast_docdir}/README.md %changelog ++++++ yast2-network-4.1.6.tar.bz2 -> yast2-network-4.1.15.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/doc/Makefile.am new/yast2-network-4.1.15/doc/Makefile.am --- old/yast2-network-4.1.6/doc/Makefile.am 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/doc/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,12 +0,0 @@ -# -# Makefile.am for y2c_network/doc -# - -SUBDIRS = autodocs - -htmldir = $(docdir) - -doc_DATA = autoinst -html_DATA = devices.html - -EXTRA_DIST = $(doc_DATA) $(html_DATA) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/package/yast2-network.changes new/yast2-network-4.1.15/package/yast2-network.changes --- old/yast2-network-4.1.6/package/yast2-network.changes 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/package/yast2-network.changes 2018-10-31 10:03:07.000000000 +0100 @@ -1,4 +1,76 @@ ------------------------------------------------------------------- +Wed Oct 31 08:37:13 UTC 2018 - mfilka@suse.com + +- bnc#1111925 + - always propose wpa_supplicant when configuring wlan +- bsc#1113080 + - Fix detection of peap mode (jreidinger@suse.com) +- Propose most commonly used setup for WPA by default +- 4.1.15 + +------------------------------------------------------------------- +Wed Oct 24 13:12:33 UTC 2018 - jreidinger@suse.com + +- Fix detection of peap mode (bsc#1113080) +- 4.1.14 + +------------------------------------------------------------------- +Tue Oct 16 19:29:30 UTC 2018 - knut.anderssen@suse.com + +- Simplified the installation network proposal collecting all the + configured dhcp interfaces in a single entry (fate#326480) +- 4.1.13 + +------------------------------------------------------------------- +Tue Oct 16 09:02:26 UTC 2018 - mfilka@suse.com + +- bsc#1110598 + - fixed path to license file +- 4.1.12 + +------------------------------------------------------------------- +Mon Oct 15 08:38:58 UTC 2018 - mfilka@suse.com + +- fate#323454 + - wicked compatible parsing of NTP servers from dhcp leases +- 4.1.11 + +------------------------------------------------------------------- +Thu Oct 4 21:46:23 UTC 2018 - knut.anderssen@suse.com + +- Fixes to the networking AY schema (bsc#1108852) + - Added missed s390 device 'layer2' boolean element. +- 4.1.10 + +------------------------------------------------------------------- +Wed Oct 3 07:33:01 UTC 2018 - mfilka@suse.com + +- bnc#1105230 + - do not crash with internal error when 0.0.0.0 netmask is used + in the routing tab +- Activate s390 network devices before applying udev naming rules, + avoiding "Invalid key/value pair in + /etc/udev/rules.d/70-persistent-net.rules" (bsc#1095761) + (by mvidner@suse.com) +- 4.1.9 + +------------------------------------------------------------------- +Tue Oct 2 19:59:14 UTC 2018 - mfilka@suse.com + +- bnc#1109312 + - fixed internal error (replaced calls to LanItems::FreeDevices + which was removed) +- 4.1.8 + +------------------------------------------------------------------- +Tue Sep 18 07:31:10 UTC 2018 - mfilka@suse.com + +- bnc#964856 + - adapted to changes in NetworkInterfaces API + - GetFreeDevice and GetFreeDevices was dropped +- 4.1.7 + +------------------------------------------------------------------- Wed Aug 22 07:19:45 UTC 2018 - dgonzalez@suse.com - Update calls to YaST2 systemd classes (related to fate#319428) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/package/yast2-network.spec new/yast2-network-4.1.15/package/yast2-network.spec --- old/yast2-network-4.1.6/package/yast2-network.spec 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/package/yast2-network.spec 2018-10-31 10:03:07.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.1.6 +Version: 4.1.15 Release: 0 BuildArch: noarch @@ -107,7 +107,7 @@ %dir %{yast_docdir} %doc %{yast_docdir}/CONTRIBUTING.md -%license %{yast_docdir}/COPYING +%license COPYING %doc %{yast_docdir}/README.md %changelog diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/autoyast-rnc/networking.rnc new/yast2-network-4.1.15/src/autoyast-rnc/networking.rnc --- old/yast2-network-4.1.6/src/autoyast-rnc/networking.rnc 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/autoyast-rnc/networking.rnc 2018-10-31 10:03:07.000000000 +0100 @@ -98,6 +98,7 @@ device = element (device | listentry) { element type { text }? & + element layer2 { BOOLEAN}? & element chanids { text }? & element portname { text }? & element protocol { text }? & diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/clients/host_auto.rb new/yast2-network-4.1.15/src/clients/host_auto.rb --- old/yast2-network-4.1.6/src/clients/host_auto.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/clients/host_auto.rb 2018-10-31 10:03:07.000000000 +0100 @@ -145,7 +145,7 @@ # Semantic AutoYaST profile check # # Problems will be stored in AutoInstall.issues_list. - # @param [Hash] input autoyast settings + # @param imported_hosts [Hash] autoyast settings def check_profile_for_errors(imported_hosts) # Checking for empty hostnames imported_hosts.each do |ip, hosts| diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/clients/lan_auto.rb new/yast2-network-4.1.15/src/clients/lan_auto.rb --- old/yast2-network-4.1.6/src/clients/lan_auto.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/clients/lan_auto.rb 2018-10-31 10:03:07.000000000 +0100 @@ -59,7 +59,7 @@ Builtins.y2milestone("Lan autoinst callback: #{@func}") if @func == "Summary" - @ret = Ops.get_string(Lan.Summary("summary"), 0, "") + @ret = Lan.Summary("summary") elsif @func == "Reset" Lan.Import({}) @ret = {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/data/network/sysconfig_defaults.yml new/yast2-network-4.1.15/src/data/network/sysconfig_defaults.yml --- old/yast2-network-4.1.6/src/data/network/sysconfig_defaults.yml 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/data/network/sysconfig_defaults.yml 2018-10-31 10:03:07.000000000 +0100 @@ -27,7 +27,7 @@ WIRELESS_BITRATE: auto WIRELESS_AP: '' WIRELESS_POWER: '' -WIRELESS_EAP_MODE: '' +WIRELESS_EAP_MODE: 'PEAP' WIRELESS_WPA_IDENTITY: '' WIRELESS_WPA_PASSWORD: '' WIRELESS_WPA_ANONID: '' @@ -35,7 +35,7 @@ WIRELESS_CLIENT_KEY: '' WIRELESS_CLIENT_KEY_PASSWORD: '' WIRELESS_CA_CERT: '' -WIRELESS_EAP_AUTH: '' +WIRELESS_EAP_AUTH: 'MSCHAPV2' WIRELESS_PEAP_VERSION: '' WIRELESS_AP_SCANMODE: '1' BONDING_MODULE_OPTS: mode=active-backup miimon=100 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/include/network/lan/hardware.rb new/yast2-network-4.1.15/src/include/network/lan/hardware.rb --- old/yast2-network-4.1.6/src/include/network/lan/hardware.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/include/network/lan/hardware.rb 2018-10-31 10:03:07.000000000 +0100 @@ -33,6 +33,9 @@ module Yast module NetworkLanHardwareInclude + # how many device names is proposed in Hardware dialog + NEW_DEVICES_COUNT = 10 + def initialize_network_lan_hardware(include_target) Yast.import "UI" @@ -240,24 +243,8 @@ Builtins.y2milestone("hotplug=%1", LanItems.hotplug) - Ops.set( - @hardware, - "devices", - LanItems.FreeDevices(Ops.get_string(@hardware, "realtype", "")) - ) # TODO: id-, bus-, ... here - if !Builtins.contains( - Ops.get_list(@hardware, "devices", []), - Ops.get_string(@hardware, "device", "") - ) - Ops.set( - @hardware, - "devices", - Builtins.prepend( - Ops.get_list(@hardware, "devices", []), - Ops.get_string(@hardware, "device", "") - ) - ) - end + # list of free device names when e.g. adding new device + @hardware["devices"] = LanItems.new_type_devices(@hardware["realtype"], NEW_DEVICES_COUNT) Ops.set( @hardware, @@ -344,7 +331,7 @@ Id(:ifcfg_name), Opt(:editable, :hstretch), _("&Configuration Name"), - [@hardware["device"] || ""] + @hardware["devices"] ) ) @@ -612,9 +599,7 @@ UI.ChangeWidget( Id(:ifcfg_name), :Items, - LanItems.FreeDevices(@hardware["realtype"]).map do |index| - @hardware["realtype"] + index - end + LanItems.new_type_devices(@hardware["realtype"], NEW_DEVICES_COUNT) ) end Builtins.y2debug("type=%1", Ops.get_string(@hardware, "type", "")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/include/network/lan/wireless.rb new/yast2-network-4.1.15/src/include/network/lan/wireless.rb --- old/yast2-network-4.1.6/src/include/network/lan/wireless.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/include/network/lan/wireless.rb 2018-10-31 10:03:07.000000000 +0100 @@ -76,11 +76,11 @@ "opt" => [:notify], "items" => [ # combo box item, one of WPA EAP modes - ["TTLS", _("TTLS")], - # combo box item, one of WPA EAP modes ["PEAP", _("PEAP")], # combo box item, one of WPA EAP modes - ["TLS", _("TLS")] + ["TLS", _("TLS")], + # combo box item, one of WPA EAP modes + ["TTLS", _("TTLS")] ], "help" => _( "<p>WPA-EAP uses a RADIUS server to authenticate users. There\n" \ @@ -1182,7 +1182,7 @@ InitializeWidget(key) # enable/disable mode = Ops.get_string(LanItems.wl_wpa_eap, "WPA_EAP_MODE", "") - UI.ChangeWidget(Id(key), :Enabled, mode == "peap") + UI.ChangeWidget(Id(key), :Enabled, mode.casecmp("peap").zero?) nil end @@ -1350,9 +1350,7 @@ auth_names = { # combo box item, any of EAP authentication methods - "" => _( - "Any" - ), + "" => _("Any"), # combo box item, an EAP authentication method "MD5" => _("MD5"), # combo box item, an EAP authentication method @@ -1362,13 +1360,9 @@ # combo box item, an EAP authentication method "PAP" => _("PAP"), # combo box item, an EAP authentication method - "MSCHAP" => _( - "MSCHAPv1" - ), + "MSCHAP" => _("MSCHAPv1"), # combo box item, an EAP authentication method - "MSCHAPV2" => _( - "MSCHAPv2" - ) + "MSCHAPV2" => _("MSCHAPv2") } auth_items = { "TTLS" => ["", "MD5", "GTC", "CHAP", "PAP", "MSCHAP", "MSCHAPV2"], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/include/network/services/routing.rb new/yast2-network-4.1.15/src/include/network/services/routing.rb --- old/yast2-network-4.1.6/src/include/network/services/routing.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/include/network/services/routing.rb 2018-10-31 10:03:07.000000000 +0100 @@ -222,7 +222,7 @@ end route = Builtins.add(route, val) val = Convert.to_string(UI.QueryWidget(Id(:genmask), :Value)) - if val != "-" && val != "0.0.0.0" && !valid_netmask?(val) + if val != "-" && !valid_netmask?(val) # Popup::Error text Popup.Error(_("Subnetmask is invalid.")) UI.SetFocus(Id(:genmask)) @@ -379,9 +379,19 @@ nil end + # Checks if the param is valid IPv4 / IPv6 + # + # @param gw [String] IPv4 or IPv6 address + # @return [Bolean] true if given param is valid + def valid_gateway?(gw) + !gw.nil? && (gw.empty? || IP.Check(gw)) + end + + # An input validator for the Routing dialog def validateRouting(_key, _event) gw = UI.QueryWidget(Id(:gw), :Value) - return true if gw == "" || IP.Check(gw) + + return true if valid_gateway?(gw) Popup.Error(_("The default gateway is invalid.")) UI.SetFocus(Id(:gw)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/lib/network/clients/network_proposal.rb new/yast2-network-4.1.15/src/lib/network/clients/network_proposal.rb --- old/yast2-network-4.1.6/src/lib/network/clients/network_proposal.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/lib/network/clients/network_proposal.rb 2018-10-31 10:03:07.000000000 +0100 @@ -24,7 +24,7 @@ def make_proposal(_) { - "preformatted_proposal" => Yast::Lan.Summary("summary").first, + "preformatted_proposal" => Yast::Lan.Summary("proposal"), "label_proposal" => [Yast::LanItems.summary("one_line")] } end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/lib/network/lan_items_summary.rb new/yast2-network-4.1.15/src/lib/network/lan_items_summary.rb --- old/yast2-network-4.1.6/src/lib/network/lan_items_summary.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/lib/network/lan_items_summary.rb 2018-10-31 10:03:07.000000000 +0100 @@ -56,6 +56,29 @@ Summary.DevicesList(items) end + # Generates a summary in RichText format for the configured interfaces + # + # @example + # LanItemsSummary.new.proposal + # => "<ul><li><p>Configured with DHCP: eth0, eth1<br></p></li>" \ + # "<li><p>br0 (Bridge)<br>IP address: 192.168.122.60/24" \ + # "<br>Bridge Ports: eth2 eth3</p></li></ul>" + # + # @see Summary + # @return [String] summary in RichText + def proposal + items = [] + + items << "<li>#{dhcp_summary}</li>" unless LanItems.find_dhcp_ifaces.empty? + items << "<li>#{static_summary}</li>" unless LanItems.find_static_ifaces.empty? + items << "<li>#{bridge_summary}</li>" unless bridges.empty? + items << "<li>#{bonding_summary}</li>" unless bonds.empty? + + return Summary.NotConfigured if items.empty? + + Summary.DevicesList(items) + end + # Generates a one line text summary for the configured interfaces. # # @example with one configured interface @@ -109,5 +132,49 @@ LanItems.DeviceProtocol(ifcfg) end end + + # Return a summary of the interfaces configurew with DHCP + # + # @return [String] interfaces configured with DHCP summary + def dhcp_summary + # TRANSLATORS: %s is the list of interfaces configured by DHCP + _("Configured with DHCP: %s") % LanItems.find_dhcp_ifaces.sort.join(", ") + end + + # Return a summary of the interfaces configured statically + # + # @return [String] statically configured interfaces summary + def static_summary + # TRANSLATORS: %s is the list of interfaces configured by DHCP + _("Statically configured: %s") % LanItems.find_static_ifaces.sort.join(", ") + end + + # Return a summary of the configured bridge interfaces + # + # @return [String] bridge configured interfaces summary + def bridge_summary + _("Bridges: %s") % bridges.map { |n| "#{n} (#{LanItems.bridge_slaves(n).sort.join(", ")})" } + end + + # Return a summary of the configured bonding interfaces + # + # @return [String] bonding configured interfaces summary + def bonding_summary + _("Bonds: %s") % bonds.map { |n| "#{n} (#{LanItems.GetBondSlaves(n).sort.join(", ")})" } + end + + # Convenience method that obtains the list of bonding configured interfaces + # + # @return [Array<String>] bonding configured interface names + def bonds + LanItems.getNetworkInterfaces("bond").sort + end + + # Convenience method that obtains the list of bridge configured interfaces + # + # @return [Array<String>] bridge configured interface names + def bridges + LanItems.getNetworkInterfaces("br").sort + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/lib/network/network_autoyast.rb new/yast2-network-4.1.15/src/lib/network/network_autoyast.rb --- old/yast2-network-4.1.6/src/lib/network/network_autoyast.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/lib/network/network_autoyast.rb 2018-10-31 10:03:07.000000000 +0100 @@ -17,6 +17,7 @@ def initialize # import has to be done here, there are some collisions otherwise + Yast.import "Arch" Yast.import "Lan" Yast.import "LanItems" Yast.import "Linuxrc" @@ -72,6 +73,10 @@ no_rules &&= ex_udev_rules.empty? return if no_rules + # for the purpose of setting the persistent names, create the devices 1st + s390_devices = ay_networking_section.fetch("s390-devices", {}) + s390_devices.each { |rule| LanItems.createS390Device(rule) } if Arch.s390 + LanItems.Read # implicitly defined udev rules are overwritten by explicit ones in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/lib/network/wicked.rb new/yast2-network-4.1.15/src/lib/network/wicked.rb --- old/yast2-network-4.1.6/src/lib/network/wicked.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/lib/network/wicked.rb 2018-10-31 10:03:07.000000000 +0100 @@ -16,5 +16,21 @@ SCR.Execute(BASH_PATH, "wicked ifreload #{devs.join(" ")}").zero? end + + # Parses wicked runtime configuration and returns list of ntp servers + # + # @param iface [String] network device + # @return [Array<String>] list of NTP servers + def parse_ntp_servers(iface) + raise ArgumentError, "A network device has to be specified" if iface.nil? || iface.empty? + raise "Parsing NTP Servers not supported for network service in use" if !NetworkService.is_wicked + + lease_files = ["ipv4", "ipv6"].map { |ip| "/var/lib/wicked/lease-#{iface}-dhcp-#{ip}.xml" } + lease_files.find_all { |f| File.file?(f) }.reduce([]) do |stack, file| + result = SCR.Execute(path(".target.bash_output"), "wicked xpath --file #{file} \"%{//ntp/server}\"") + + stack + result.fetch("stdout", "").split("\n") + end + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/modules/Lan.rb new/yast2-network-4.1.15/src/modules/Lan.rb --- old/yast2-network-4.1.6/src/modules/Lan.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/modules/Lan.rb 2018-10-31 10:03:07.000000000 +0100 @@ -794,26 +794,18 @@ end # Create a textual summary and a list of unconfigured devices - # @param [String] mode "split": split configured and unconfigured?<br /> - # "summary": add resolver and routing symmary, - # "proposal": for proposal, add links for direct config + # @param [String] mode "summary": add resolver and routing summary, + # "proposal": for proposal also with resolver an routing summary # @return summary of the current configuration def Summary(mode) - sum = LanItems.BuildLanOverview - - # Testing improved summary - if mode == "summary" - Ops.set( - sum, - 0, - Ops.add( - Ops.add(Ops.get_string(sum, 0, ""), DNS.Summary), - Routing.Summary - ) - ) + case mode + when "summary" + "#{LanItems.BuildLanOverview.first}#{DNS.Summary}#{Routing.Summary}" + when "proposal" + "#{LanItems.summary(:proposal)}#{DNS.Summary}#{Routing.Summary}" + else + LanItems.BuildLanOverview.first end - - deep_copy(sum) end # Create a textual summary for the general network settings @@ -948,7 +940,7 @@ # then each configuration (except bridges) move to the bridge # and add old device name into bridge_ports LanItems.Items.each do |current, config| - bridge_name = format("br%s", NetworkInterfaces.GetFreeDevice("br")) + bridge_name = LanItems.new_type_device("br") next unless connected_and_bridgeable?(bridge_name, current, config) LanItems.current = current # first configure all connected unconfigured devices with dhcp (with default parameters) @@ -972,9 +964,8 @@ if NetworkService.is_network_manager pkgs << "NetworkManager" if !PackageSystem.Installed("NetworkManager") elsif !PackageSystem.Installed("wpa_supplicant") - # we have to add wpa_supplicant when wpa is in game, wicked relies on it - pkgs << "wpa_supplicant" if !NetworkInterfaces.Locate("WIRELESS_AUTH_MODE", "psk").empty? - pkgs << "wpa_supplicant" if !NetworkInterfaces.Locate("WIRELESS_AUTH_MODE", "eap").empty? + # we have to add wpa_supplicant when wlan is in game, wicked relies on it + pkgs << "wpa_supplicant" if !LanItems.find_type_ifaces("wlan").empty? end pkgs.uniq! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/src/modules/LanItems.rb new/yast2-network-4.1.15/src/modules/LanItems.rb --- old/yast2-network-4.1.6/src/modules/LanItems.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/src/modules/LanItems.rb 2018-10-31 10:03:07.000000000 +0100 @@ -931,6 +931,18 @@ GetDeviceNames(GetNetcardInterfaces()) end + # Finds all items of given device type + # + # @param type [String] device type + # @return [Array] list of device names + def find_type_ifaces(type) + items = GetNetcardInterfaces().select do |iface| + GetDeviceType(iface) == type + end + + GetDeviceNames(items) + end + # Finds all NICs configured with DHCP # # @return [Array<String>] list of NIC names which are configured to use (any) dhcp @@ -940,6 +952,15 @@ end end + # Find all NICs configured statically + # + # @return [Array<String>] list of NIC names which have a static config + def find_static_ifaces + find_by_sysconfig do |ifcfg| + ifcfg.fetch("BOOTPROTO", "").match(/static/i) + end + end + # Finds all devices which has DHCLIENT_SET_HOSTNAME set to "yes" # # @return [Array<String>] list of NIC names which has the option set to "yes" @@ -971,14 +992,15 @@ # Get list of all configured interfaces # + # @param type [String] only obtains configured interfaces of the given type # return [Array] list of strings - interface names (eth0, ...) # FIXME: rename e.g. to configured_interfaces - def getNetworkInterfaces + def getNetworkInterfaces(type = nil) configurations = NetworkInterfaces.FilterDevices("netcard") - devtypes = NetworkInterfaces.CardRegex["netcard"].to_s.split("|") + devtypes = type ? [type] : NetworkInterfaces.CardRegex["netcard"].to_s.split("|") - devtypes.inject([]) do |acc, type| - conf = configurations[type].to_h + devtypes.inject([]) do |acc, conf_type| + conf = configurations[conf_type].to_h acc.concat(conf.keys) end end @@ -1667,13 +1689,6 @@ #------------------- # PRIVATE FUNCTIONS - # Return 10 free devices - # @param [String] type device type - # @return [Array] of 10 free devices - def FreeDevices(type) - NetworkInterfaces.GetFreeDevices(type, 10) - end - def SetDefaultsForHW Builtins.y2milestone("SetDefaultsForHW type %1", @type) @mtu = "1492" if Arch.s390 && Builtins.contains(["lcs", "eth"], @type) @@ -1868,7 +1883,7 @@ # FIXME: encapsulate into LanItems.GetItemType ? @type = Ops.get_string(@Items, [@current, "hwinfo", "type"], "eth") - @device = @type + NetworkInterfaces.GetFreeDevice(@type) + @device = new_type_device(@type) # TODO: instead of udev use hwinfo dev_name NetworkInterfaces.Name = GetItemUdev("NAME") @@ -2530,6 +2545,52 @@ ret end + # Returns unused name for device of given type + # + # When already having eth0, eth1, enp0s3 devices (eth type) and asks for new + # device of eth type it will e.g. return eth2 as a free name. + # + # Method always returns name in the oldfashioned schema (eth0, br1, ...) + # + # @raise [ArgumentError] when type is nil or empty + # @param type [String] device type + # @return [String] available device name + def new_type_device(type) + new_type_devices(type, 1).first + end + + # Returns a list of unused names for devices of given type + # + # Also @see new_type_device + # + # @raise [ArgumentError] when type is nil or empty + # @param type [String] device type + # @param count [Integer] requested count of names + # @return [Array<String>] list of free names, empty if count is < 1 + def new_type_devices(type, count) + raise ArgumentError, "Valid device type expected" if type.nil? || type.empty? + return [] if count < 1 + + known_devs = find_type_ifaces(type) + + candidates = (0..known_devs.size + count - 1).map { |c| "#{type}#{c}" } + + (candidates - known_devs)[0..count - 1] + end + + # Returns hash of NTP servers + # + # Provides map with NTP servers obtained via any of dhcp aware interfaces + # + # @return [Hash<String, Array<String>] key is device name, value + # is list of ntp servers obtained from the device + def dhcp_ntp_servers + dhcp_ifaces = find_dhcp_ifaces + + result = dhcp_ifaces.map { |iface| [iface, parse_ntp_servers(iface)] }.to_h + result.delete_if { |_, ntps| ntps.empty? } + end + # This helper allows YARD to extract DSL-defined attributes. # Unfortunately YARD has problems with the Capitalized ones, # so those must be done manually. @@ -2540,8 +2601,6 @@ publish variable: name, type: type end - private - # Returns a formated string with the interfaces that are part of a bridge # or of a bond interface. # @@ -2570,6 +2629,8 @@ false end + private + # Checks if given lladdr can be written into ifcfg # # @param lladdr [String] logical link address, usually MAC address in case @@ -2763,7 +2824,7 @@ # # ifcfg hash<string, string> is in form { <sysconfig_key> -> <value> } # - # @return [Array] list of device names + # @return [Array<String>] list of device names def find_by_sysconfig items = GetNetcardInterfaces().select do |iface| ifcfg = GetDeviceMap(iface) || {} @@ -2882,7 +2943,6 @@ publish function: :isCurrentDHCP, type: "boolean ()" publish function: :GetItemDescription, type: "string ()" publish function: :SelectHWMap, type: "void (map)" - publish function: :FreeDevices, type: "list (string)" publish function: :SetDefaultsForHW, type: "void ()" publish function: :SetDeviceVars, type: "void (map, map)" publish function: :Select, type: "boolean (string)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/t/add-del.t new/yast2-network-4.1.15/t/add-del.t --- old/yast2-network-4.1.6/t/add-del.t 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/t/add-del.t 2018-10-31 10:03:07.000000000 +0100 @@ -23,7 +23,7 @@ echo "ok 1 $BASEDEVICE: found" echo "# add a (virtual) interface" -$YAST lan add name=vlan50 ethdevice=$BASEDEVICE bootproto=dhcp || tapfail +$YAST lan add name=vlan50 type=vlan ethdevice=$BASEDEVICE bootproto=dhcp || tapfail echo "ok 2 vlan50: added" # check it has worked diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/Makefile.am new/yast2-network-4.1.15/test/Makefile.am --- old/yast2-network-4.1.6/test/Makefile.am 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/test/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,41 +0,0 @@ -TESTS = \ - alias_dialog_test.rb \ - bond_test.rb \ - bridge_test.rb \ - build_lan_overview_test.rb \ - complex_test.rb \ - default_route_test.rb \ - dns_service_test.rb \ - dns_test.rb \ - edit_nic_name_test.rb \ - hardware_test.rb \ - host_test.rb \ - ifroute_test.rb \ - inst_setup_dhcp_test.rb \ - install_inf_convertor_test.rb \ - lan_items_export_test.rb \ - lan_items_helpers_test.rb \ - lan_items_read_test.rb \ - lan_items_rollback_test.rb \ - lan_test.rb \ - lan_udev_auto_test.rb \ - link_handlers_test.rb \ - netcard_test.rb \ - network_autoconfiguration_test.rb \ - network_autoyast_test.rb \ - new_device_startmode_test.rb \ - read_hardware_test.rb \ - remote_test.rb \ - routines_test.rb \ - routing_test.rb \ - routing_helpers_test.rb \ - s390_helpers_test.rb \ - suse_firewall_4_network_test.rb \ - udev_test.rb \ - widgets_test.rb \ - yaml_defaults_test.rb - -TEST_EXTENSIONS = .rb -RB_LOG_COMPILER = rspec --format doc -VERBOSE = 1 -EXTRA_DIST = $(TESTS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/bridge_test.rb new/yast2-network-4.1.15/test/bridge_test.rb --- old/yast2-network-4.1.6/test/bridge_test.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/test/bridge_test.rb 2018-10-31 10:03:07.000000000 +0100 @@ -70,6 +70,8 @@ allow(Yast::NetworkInterfaces).to receive(:FilterDevices).with("netcard") { netconfig_items } allow(Yast::NetworkInterfaces).to receive(:adapt_old_config!) allow(Yast::NetworkInterfaces).to receive(:CleanHotplugSymlink).and_return(true) + allow(Yast::NetworkInterfaces).to receive(:GetType).and_call_original + allow(Yast::NetworkInterfaces).to receive(:GetType).with("tun0").and_return("tun") # tun type detection relies on sysfs allow(Yast::LanItems).to receive(:ReadHardware) { hwinfo_items } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/build_lan_overview_test.rb new/yast2-network-4.1.15/test/build_lan_overview_test.rb --- old/yast2-network-4.1.6/test/build_lan_overview_test.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/test/build_lan_overview_test.rb 2018-10-31 10:03:07.000000000 +0100 @@ -45,6 +45,13 @@ allow(Yast::NetworkInterfaces) .to receive(:Current) .and_return(wlan_ifcfg) + allow(Yast::NetworkInterfaces) + .to receive(:GetType) + .and_call_original + allow(Yast::NetworkInterfaces) + .to receive(:GetType) + .with("wlan0") + .and_return("wlan") allow(FastGettext) .to receive(:locale) .and_return("de") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/inst_setup_dhcp_test.rb new/yast2-network-4.1.15/test/inst_setup_dhcp_test.rb --- old/yast2-network-4.1.6/test/inst_setup_dhcp_test.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/test/inst_setup_dhcp_test.rb 2018-10-31 10:03:07.000000000 +0100 @@ -8,28 +8,33 @@ subject { Yast::SetupDhcp.instance } describe "#main" do + let(:nac) { Yast::NetworkAutoconfiguration.instance } - it "returns :next when autoconfiguration is performed" do - allow(Yast::NetworkAutoconfiguration) + it "returns :next when autoconfiguration is not performed" do + allow(nac) .to receive(:any_iface_active?) .and_return(true) expect(subject.main).to eql :next end - it "returns :next when autoconfiguration is not performed" do - allow(Yast::NetworkAutoconfiguration) + it "returns :next when autoconfiguration is performed" do + allow(nac) .to receive(:any_iface_active?) .and_return(false) + allow(nac) + .to receive(:configure_dhcp) + .and_return(true) expect(subject.main).to eql :next end it "runs network dhcp autoconfiguration if no active interfaces" do - allow(Yast::NetworkAutoconfiguration) + allow(nac) .to receive(:any_iface_active?) .and_return(false) - expect(Yast::NetworkAutoconfiguration.instance) + + expect(nac) .to receive(:configure_dhcp) subject.main @@ -37,6 +42,10 @@ context "in the initial Stage" do it "writes DHCLIENT_SET_HOSTNAME in /etc/sysconfig/network/dhcp" do + allow(nac) + .to receive(:any_iface_active?) + .and_return(true) + expect(Yast::Stage).to receive(:initial).and_return(true) expect(subject).to receive(:set_dhcp_hostname!) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/lan_items_helpers_test.rb new/yast2-network-4.1.15/test/lan_items_helpers_test.rb --- old/yast2-network-4.1.6/test/lan_items_helpers_test.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/test/lan_items_helpers_test.rb 2018-10-31 10:03:07.000000000 +0100 @@ -97,6 +97,13 @@ allow(Yast::NetworkInterfaces).to receive(:FilterDevices) { NETCONFIG_ITEMS } expect(Yast::LanItems.getNetworkInterfaces).to match_array(EXPECTED_INTERFACES) end + + context "when a type is given" do + it "returns the list of known interfaces of the given type" do + allow(Yast::NetworkInterfaces).to receive(:FilterDevices) { NETCONFIG_ITEMS } + expect(Yast::LanItems.getNetworkInterfaces("br")).to eql(["br0"]) + end + end end describe "LanItemsClass#s390_correct_lladdr" do @@ -311,6 +318,117 @@ end end +describe "LanItems#find_type_ifaces" do + let(:mocked_items) do + { + 0 => { "ifcfg" => "eth0" }, + 1 => { "hwinfo" => { "dev_name" => "enp0s3" } }, + 2 => { "ifcfg" => "bond0" } + } + end + + before(:each) do + allow(Yast::LanItems).to receive(:Items).and_return(mocked_items) + + allow(Yast::LanItems).to receive(:GetDeviceType).and_return("eth") + allow(Yast::LanItems).to receive(:GetDeviceType).with(0).and_return("eth") + allow(Yast::LanItems).to receive(:GetDeviceType).with(1).and_return("eth") + allow(Yast::LanItems).to receive(:GetDeviceType).with(2).and_return("bond") + end + + it "lists all eth devices when asked for" do + expect(Yast::LanItems.send(:find_type_ifaces, "eth")).to eql ["eth0", "enp0s3"] + end + + it "returns an empty array when invalid type is given" do + expect(Yast::LanItems.send(:find_type_ifaces, nil)).to eql [] + end +end + +context "When proposing device names candidates" do + before(:each) do + allow(Yast::LanItems).to receive(:find_type_ifaces).and_return([]) + allow(Yast::LanItems).to receive(:find_type_ifaces).with("eth").and_return(["eth0", "eth2", "eth3"]) + end + + describe "LanItems#new_type_device" do + it "generates a valid device name" do + expect(Yast::LanItems.new_type_device("br")).to eql "br0" + expect(Yast::LanItems.new_type_device("eth")).to eql "eth1" + end + + it "raises an error when no type is provided" do + expect { Yast::LanItems.new_type_device(nil) }.to raise_error(ArgumentError) + end + end + + describe "LanItems#new_type_devices" do + it "generates as many new device names as requested" do + candidates = Yast::LanItems.new_type_devices("eth", 10) + + expect(candidates.size).to eql 10 + expect(candidates).not_to include("eth0", "eth2", "eth3") + end + + it "returns empty lists for device name count < 1" do + expect(Yast::LanItems.new_type_devices("eth", 0)).to be_empty + expect(Yast::LanItems.new_type_devices("eth", -1)).to be_empty + end + end + + describe "LanItems#dhcp_ntp_servers" do + it "lists ntp servers for every device which provides them" do + result = { + "eth0" => ["1.0.0.1"], + "eth1" => ["1.0.0.2", "1.0.0.3"] + } + + allow(Yast::LanItems) + .to receive(:parse_ntp_servers) + .and_return([]) + allow(Yast::LanItems) + .to receive(:parse_ntp_servers) + .with("eth0") + .and_return(["1.0.0.1"]) + allow(Yast::LanItems) + .to receive(:parse_ntp_servers) + .with("eth1") + .and_return(["1.0.0.2", "1.0.0.3"]) + allow(Yast::LanItems) + .to receive(:find_dhcp_ifaces) + .and_return(["eth0", "eth1", "eth2"]) + + expect(Yast::LanItems.dhcp_ntp_servers).to eql result + end + end +end + +describe "LanItems#dhcp_ntp_servers" do + it "lists ntp servers for every device which provides them" do + result = { + "eth0" => ["1.0.0.1"], + "eth1" => ["1.0.0.2", "1.0.0.3"] + } + + allow(Yast::LanItems) + .to receive(:parse_ntp_servers) + .and_return([]) + allow(Yast::LanItems) + .to receive(:parse_ntp_servers) + .with("eth0") + .and_return(["1.0.0.1"]) + allow(Yast::LanItems) + .to receive(:parse_ntp_servers) + .with("eth1") + .and_return(["1.0.0.2", "1.0.0.3"]) + allow(Yast::LanItems) + .to receive(:find_dhcp_ifaces) + .and_return(["eth0", "eth1", "eth2"]) + + expect(Yast::LanItems.dhcp_ntp_servers).to eql result + end +end + describe "DHCLIENT_SET_HOSTNAME helpers" do def mock_items(dev_maps) # mock LanItems#Items diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/lan_items_summary_test.rb new/yast2-network-4.1.15/test/lan_items_summary_test.rb --- old/yast2-network-4.1.6/test/lan_items_summary_test.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/test/lan_items_summary_test.rb 2018-10-31 10:03:07.000000000 +0100 @@ -12,7 +12,10 @@ [ { "BOOTPROTO" => "dhcp" }, { "BOOTPROTO" => "none" }, - { "IPADDR" => "1.2.3.4", "NETMASK" => "255.255.255.0" } + { "BOOTPROTO" => "static", + "IPADDR" => "1.2.3.4", + "NETMASK" => "255.255.255.0", + "BRIDGE_PORTS" => "eth1" } ].freeze end @@ -27,9 +30,11 @@ before do allow(Yast::LanItems).to receive(:Items).and_return(items) allow(Yast::LanItems).to receive(:IsItemConfigured).and_return(true) + allow(Yast::NetworkInterfaces).to receive(:FilterDevices).with("netcard").and_return("br" => { "br0" => dhcp_maps[2] }) dhcp_maps.each_with_index do |item, index| allow(Yast::LanItems).to receive(:GetDeviceMap).with(index).and_return(item) end + allow(subject).to receive(:bridges).and_return(["br0"]) end describe "#default" do @@ -49,6 +54,26 @@ end end + describe "#proposal" do + it "returns a Richtext summary of the configured interfaces" do + expect(subject.proposal) + .to eql "<ul>" \ + "<li>Configured with DHCP: eth0</li>" \ + "<li>Statically configured: br0</li>" \ + "<li>Bridges: br0 (eth1)</li>" \ + "</ul>" + end + + it "returns Summary.NotConfigured in case of not configured interfaces" do + allow(Yast::LanItems).to receive(:find_dhcp_ifaces).and_return([]) + allow(Yast::LanItems).to receive(:find_static_ifaces).and_return([]) + allow(subject).to receive(:bridges).and_return([]) + allow(subject).to receive(:bonds).and_return([]) + + expect(subject.proposal).to eql Yast::Summary.NotConfigured + end + end + describe "#one_line" do it "returns a plain text summary of the configured interfaces in one line" do expect(subject.one_line).to eql(MULTIPLE_INTERFACES) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/lan_test.rb new/yast2-network-4.1.15/test/lan_test.rb --- old/yast2-network-4.1.6/test/lan_test.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/test/lan_test.rb 2018-10-31 10:03:07.000000000 +0100 @@ -24,22 +24,10 @@ .and_return(false) end - it "does not list wpa_supplicant package when WIRELESS_AUTH_MODE is not psk or eap" do - expect(Yast::NetworkInterfaces) - .to receive(:Locate) - .with("WIRELESS_AUTH_MODE", /(psk|eap)/) - .at_least(:once) - .and_return([]) - - expect(Yast::Lan.Packages).not_to include "wpa_supplicant" - end - - it "lists wpa_supplicant package when WIRELESS_AUTH_MODE is psk or eap" do - # when checking options, LanClass#Packages currently cares only if - # WIRELESS_AUTH_MODE={psk, eap} is present - expect(Yast::NetworkInterfaces) - .to receive(:Locate) - .with("WIRELESS_AUTH_MODE", /(psk|eap)/) + it "always proposes wpa_supplicant" do + expect(Yast::LanItems) + .to receive(:find_type_ifaces) + .with("wlan") .at_least(:once) .and_return(["place_holder"]) @@ -319,7 +307,6 @@ describe "LanClass#ProposeVirtualized" do before do - allow(Yast::NetworkInterfaces).to receive(:GetFreeDevice).with("br").and_return("1") allow(Yast::LanItems).to receive(:IsCurrentConfigured).and_return(true) allow(Yast::Lan).to receive(:ProposeItem) allow(Yast::Lan).to receive(:configure_as_bridge!) @@ -367,20 +354,20 @@ end it "configures a new bridge with the given interface as a bridge port" do - expect(Yast::Lan).to receive(:configure_as_bridge!).with("eth0", "br1") + expect(Yast::Lan).to receive(:configure_as_bridge!).with("eth0", "br0") Yast::Lan.ProposeVirtualized end it "configures the given interface as a bridge port" do - expect(Yast::Lan).to receive(:configure_as_bridge!).with("eth0", "br1").and_return(true) + expect(Yast::Lan).to receive(:configure_as_bridge!).with("eth0", "br0").and_return(true) expect(Yast::Lan).to receive(:configure_as_bridge_port).with("eth0") Yast::Lan.ProposeVirtualized end it "refreshes lan items with the new interfaces" do - expect(Yast::Lan).to receive(:configure_as_bridge!).with("eth0", "br1").and_return(true) + expect(Yast::Lan).to receive(:configure_as_bridge!).with("eth0", "br0").and_return(true) expect(Yast::Lan).to receive(:configure_as_bridge_port).with("eth0") expect(Yast::Lan).to receive(:refresh_lan_items) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/network_proposal_test.rb new/yast2-network-4.1.15/test/network_proposal_test.rb --- old/yast2-network-4.1.6/test/network_proposal_test.rb 2018-08-23 18:01:38.000000000 +0200 +++ new/yast2-network-4.1.15/test/network_proposal_test.rb 2018-10-31 10:03:07.000000000 +0100 @@ -1,3 +1,4 @@ +#!/usr/bin/env rspec require_relative "test_helper" require "network/clients/network_proposal" @@ -9,7 +10,7 @@ before do stub_const("Yast::Wizard", double.as_null_object) allow(Yast::LanItems).to receive(:summary).with("one_line").and_return("one_line_summary") - allow(Yast::Lan).to receive(:Summary).with("summary").and_return(["rich_text_summary", ""]) + allow(Yast::Lan).to receive(:Summary).with("proposal").and_return("rich_text_summary") end describe "#description" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.6/test/wireless_test.rb new/yast2-network-4.1.15/test/wireless_test.rb --- old/yast2-network-4.1.6/test/wireless_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-4.1.15/test/wireless_test.rb 2018-10-31 10:03:07.000000000 +0100 @@ -0,0 +1,31 @@ +#!/usr/bin/env rspec + +require_relative "test_helper" + +require "yast" + +Yast.import "LanItems" + +class WirelessTestClass < Yast::Module + def initialize + Yast.include self, "network/lan/address.rb" # defines my2debug, but nothing mention it + Yast.include self, "network/lan/wireless.rb" + end +end + +describe "WirelessInclude" do + subject { WirelessTestClass.new } + + describe "#InitPeapVersion" do + before do + allow(Yast::UI).to receive(:ChangeWidget) + end + + it "Enables widget if WPA_EAP_MODE is PEAP" do + Yast::LanItems.wl_wpa_eap["WPA_EAP_MODE"] = "PEAP" + expect(Yast::UI).to receive(:ChangeWidget).with(Id("test"), :Enabled, true) + + subject.InitPeapVersion("test") + end + end +end