Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2019-11-20 10:27:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new.26869 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network" Wed Nov 20 10:27:23 2019 rev:413 rq:749514 version:4.2.28 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2019-10-16 09:11:35.844037853 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new.26869/yast2-network.changes 2019-11-20 10:27:24.878564404 +0100 @@ -1,0 +2,39 @@ +Tue Nov 19 12:05:21 UTC 2019 - David Diaz <[email protected]> + +- Do not crash when wrapping text (bsc#1157161) +- 4.2.28 + +------------------------------------------------------------------- +Tue Nov 12 13:35:02 UTC 2019 - Josef Reidinger <[email protected]> + +- fix importing dhclient_set_hostname key from autoyast profile + (bsc#1152021) +- 4.2.27 + +------------------------------------------------------------------- +Sun Nov 10 09:28:14 UTC 2019 - Knut Anderssen <[email protected]> + +- Wireless: Fix wpa auth modes selection removing the prefix from + the combobox value which is not used when writing the config. + (bsc#1155639) +- 4.2.26 + +------------------------------------------------------------------- +Fri Nov 8 13:15:15 UTC 2019 - Knut Anderssen <[email protected]> + +- Live installation: + - Do not try to configure dhcp when NetworkManager is in use. + - Show the general tab in the lan client allowing to switch + between backends when systemd is running. + - Do not do a netconfig update during an installation for not + breaking the current resolv configuration. +- 4.2.25 + +------------------------------------------------------------------- +Fri Nov 1 08:43:31 UTC 2019 - Josef Reidinger <[email protected]> + +- fix typo in remote desktop file (thanks for contribution + to Markus S aka kamikazow) (bsc#1155584) +- 4.2.24 + +------------------------------------------------------------------- Old: ---- yast2-network-4.2.23.tar.bz2 New: ---- yast2-network-4.2.28.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.pthWSm/_old 2019-11-20 10:27:25.278564483 +0100 +++ /var/tmp/diff_new_pack.pthWSm/_new 2019-11-20 10:27:25.278564483 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.2.23 +Version: 4.2.28 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only @@ -33,8 +33,9 @@ #for install task BuildRequires: yast2-storage-ng BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) -# CFA::Sysctl -BuildRequires: yast2 >= 4.2.25 +# NetworkService check if Systemd is running for determining +# the current network backend +BuildRequires: yast2 >= 4.2.31 BuildRequires: yast2-packager >= 4.0.18 # Product control need xml agent BuildRequires: yast2-xml ++++++ yast2-network-4.2.23.tar.bz2 -> yast2-network-4.2.28.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/package/yast2-network.changes new/yast2-network-4.2.28/package/yast2-network.changes --- old/yast2-network-4.2.23/package/yast2-network.changes 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/package/yast2-network.changes 2019-11-19 13:31:29.000000000 +0100 @@ -1,4 +1,43 @@ ------------------------------------------------------------------- +Tue Nov 19 12:05:21 UTC 2019 - David Diaz <[email protected]> + +- Do not crash when wrapping text (bsc#1157161) +- 4.2.28 + +------------------------------------------------------------------- +Tue Nov 12 13:35:02 UTC 2019 - Josef Reidinger <[email protected]> + +- fix importing dhclient_set_hostname key from autoyast profile + (bsc#1152021) +- 4.2.27 + +------------------------------------------------------------------- +Sun Nov 10 09:28:14 UTC 2019 - Knut Anderssen <[email protected]> + +- Wireless: Fix wpa auth modes selection removing the prefix from + the combobox value which is not used when writing the config. + (bsc#1155639) +- 4.2.26 + +------------------------------------------------------------------- +Fri Nov 8 13:15:15 UTC 2019 - Knut Anderssen <[email protected]> + +- Live installation: + - Do not try to configure dhcp when NetworkManager is in use. + - Show the general tab in the lan client allowing to switch + between backends when systemd is running. + - Do not do a netconfig update during an installation for not + breaking the current resolv configuration. +- 4.2.25 + +------------------------------------------------------------------- +Fri Nov 1 08:43:31 UTC 2019 - Josef Reidinger <[email protected]> + +- fix typo in remote desktop file (thanks for contribution + to Markus S aka kamikazow) (bsc#1155584) +- 4.2.24 + +------------------------------------------------------------------- Tue Oct 15 08:48:26 UTC 2019 - Josef Reidinger <[email protected]> - Fix crash caused by type in widget method (caused in 4.2.22 by diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/package/yast2-network.spec new/yast2-network-4.2.28/package/yast2-network.spec --- old/yast2-network-4.2.23/package/yast2-network.spec 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/package/yast2-network.spec 2019-11-19 13:31:29.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.2.23 +Version: 4.2.28 Release: 0 Summary: YaST2 - Network Configuration License: GPL-2.0-only @@ -33,8 +33,9 @@ #for install task BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) BuildRequires: yast2-storage-ng -# CFA::Sysctl -BuildRequires: yast2 >= 4.2.25 +# NetworkService check if Systemd is running for determining +# the current network backend +BuildRequires: yast2 >= 4.2.31 BuildRequires: yast2-packager >= 4.0.18 # Product control need xml agent BuildRequires: yast2-xml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/clients/inst_lan.rb new/yast2-network-4.2.28/src/clients/inst_lan.rb --- old/yast2-network-4.2.23/src/clients/inst_lan.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/clients/inst_lan.rb 2019-11-19 13:31:29.000000000 +0100 @@ -35,6 +35,7 @@ Yast.import "UI" Yast.import "Lan" Yast.import "GetInstArgs" + Yast.import "NetworkService" Yast.include self, "network/lan/wizards.rb" @@ -49,7 +50,8 @@ # keep network configuration state in @@conf_net to gurantee same # behavior when walking :back in installation workflow if !defined?(@@network_configured) - @@network_configured = !Yast::Lan.yast_config.connections.empty? + @@network_configured = + NetworkService.network_manager? ? true : !Lan.yast_config.connections.empty? end log.info("Configured network found: #{@@network_configured}") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/desktop/org.opensuse.yast.Remote.desktop new/yast2-network-4.2.28/src/desktop/org.opensuse.yast.Remote.desktop --- old/yast2-network-4.2.23/src/desktop/org.opensuse.yast.Remote.desktop 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/desktop/org.opensuse.yast.Remote.desktop 2019-11-19 13:31:29.000000000 +0100 @@ -19,6 +19,6 @@ Exec=xdg-su -c "/sbin/yast2 remote" Name=YaST Remote Administration -GenericName=Remove Administration (VNC) +GenericName=Remote Administration (VNC) Comment=Set up remote administration StartupNotify=true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/include/network/lan/complex.rb new/yast2-network-4.2.28/src/include/network/lan/complex.rb --- old/yast2-network-4.2.23/src/include/network/lan/complex.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/include/network/lan/complex.rb 2019-11-19 13:31:29.000000000 +0100 @@ -55,6 +55,7 @@ Yast.import "CWMTab" Yast.import "Stage" Yast.import "LanItems" + Yast.import "Systemd" Yast.include include_target, "network/routines.rb" Yast.include include_target, "network/lan/help.rb" @@ -258,7 +259,7 @@ caption = _("Network Settings") widget_descr = { "tab" => CWMTab.CreateWidget( - "tab_order" => if Stage.normal + "tab_order" => if Systemd.Running ["global", "overview", "resolv", "route"] else ["overview", "resolv", "route"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/network/clients/inst_setup_dhcp.rb new/yast2-network-4.2.28/src/lib/network/clients/inst_setup_dhcp.rb --- old/yast2-network-4.2.23/src/lib/network/clients/inst_setup_dhcp.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/network/clients/inst_setup_dhcp.rb 2019-11-19 13:31:29.000000000 +0100 @@ -21,6 +21,8 @@ Yast.import "Linuxrc" Yast.import "DNS" +Yast.import "Systemd" +Yast.import "NetworkService" module Yast class SetupDhcp @@ -31,10 +33,14 @@ nac = NetworkAutoconfiguration.instance set_dhcp_hostname! if Stage.initial - if !nac.any_iface_active? - nac.configure_dhcp + if Yast::NetworkService.wicked? + if !nac.any_iface_active? + nac.configure_dhcp + else + log.info("Automatic DHCP configuration not started - an interface is already configured") + end else - log.info("Automatic DHCP configuration not started - an interface is already configured") + log.info("Network is not managed by wicked, skipping DHCP setup") end # if this is not wrapped in a def, ruby -cw says diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/network/clients/save_network.rb new/yast2-network-4.2.28/src/lib/network/clients/save_network.rb --- old/yast2-network-4.2.23/src/lib/network/clients/save_network.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/network/clients/save_network.rb 2019-11-19 13:31:29.000000000 +0100 @@ -81,6 +81,7 @@ ETC = "/etc/".freeze SYSCONFIG = "/etc/sysconfig/network/".freeze + NETWORK_MANAGER = "/etc/NetworkManager/".freeze def CopyConfiguredNetworkFiles return if Mode.autoinst && !NetworkAutoYast.instance.keep_net_config? @@ -99,6 +100,13 @@ { dir: ETC, file: DNSClass::HOSTNAME_FILE } ] + # NetworkManager is usually the default in a live installation. Any + # configuration applied during the installation should be present in the + # target system. + if Y2Network::ProposalSettings.instance.network_service == :network_manager + copy_recipes << { dir: NETWORK_MANAGER + "/system-connections/", file: "*" } + end + # just copy files copy_recipes.each do |recipe| # can be shell pattern like ifcfg-* @@ -314,7 +322,13 @@ log.info("Setting network service according to product preferences") - case Y2Network::ProposalSettings.instance.network_service + backend = Y2Network::ProposalSettings.instance.network_service + # NetworkServices caches the selected backend. That is, it assumes the + # state in the inst-sys and the chroot is the same but that is not true + # at all specially in a live installation where NM is the backend by + # default. For detecting changes we should reset the cache first. + NetworkService.reset! + case backend when :network_manager log.info("- using NetworkManager") NetworkService.use_network_manager diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/network/network_autoconfiguration.rb new/yast2-network-4.2.28/src/lib/network/network_autoconfiguration.rb --- old/yast2-network-4.2.23/src/lib/network/network_autoconfiguration.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/network/network_autoconfiguration.rb 2019-11-19 13:31:29.000000000 +0100 @@ -34,6 +34,7 @@ Yast.import "Lan" Yast.import "LanItems" Yast.import "NetworkInterfaces" + Yast.import "NetworkService" Yast.import "Package" Yast.import "DNS" Yast.import "Arch" @@ -45,11 +46,11 @@ # # returns [Boolean] true when at least one interface is active def any_iface_active? + Yast::Lan.Read(:cache) config.interfaces.any? { |c| config.connections.by_name(c.name) && active_config?(c.name) } end def configure_dhcp - Yast::Lan.Read(:cache) Yast.include self, "network/routines.rb" # TODO: needed only for phy_connected # find out network devices suitable for dhcp autoconfiguration. @@ -114,7 +115,7 @@ def configure_dns DNS.Read # handles NetworkConfig too log.info("NetworkAutoconfiguration: proposing DNS / Hostname configuration") - DNS.Write + DNS.Write(netconfig_update: false) end # Proposes updates for /etc/hosts diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/autoinst/interfaces_reader.rb new/yast2-network-4.2.28/src/lib/y2network/autoinst/interfaces_reader.rb --- old/yast2-network-4.2.23/src/lib/y2network/autoinst/interfaces_reader.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/autoinst/interfaces_reader.rb 2019-11-19 13:31:29.000000000 +0100 @@ -123,6 +123,11 @@ config.ethtool_options = interface_section.ethtool_options end config.firewall_zone = interface_section.zone if interface_section.zone + if !interface_section.dhclient_set_hostname.empty? + config.dhclient_set_hostname = interface_section.dhclient_set_hostname == "yes" + end + + config end def load_wireless(config, interface_section) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/autoinst_profile/interface_section.rb new/yast2-network-4.2.28/src/lib/y2network/autoinst_profile/interface_section.rb --- old/yast2-network-4.2.23/src/lib/y2network/autoinst_profile/interface_section.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/autoinst_profile/interface_section.rb 2019-11-19 13:31:29.000000000 +0100 @@ -150,7 +150,7 @@ # @return [String] no clue what it means, but it is ignored now. # @!attribute dhclient_set_hostname - # @return [String] if dhcp sets hostname. It is plain text, values? + # @return [String] if dhcp sets hostname. "yes" if sets, "no" not set and nil not specified # @!attribute bonding_master # @return [String] ??? @@ -289,6 +289,11 @@ @broadcast = config.ip.broadcast.address.to_s if config.ip.broadcast end + @dhclient_set_hostname = case config.dhclient_set_hostname + when true then "yes" + when false then "no" + when nil then "" + end @startmode = config.startmode.name @ifplugd_priority = config.startmode.priority.to_s if config.startmode.name == "ifplugd" @mtu = config.mtu.to_s if config.mtu diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/connection_config/base.rb new/yast2-network-4.2.28/src/lib/y2network/connection_config/base.rb --- old/yast2-network-4.2.23/src/lib/y2network/connection_config/base.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/connection_config/base.rb 2019-11-19 13:31:29.000000000 +0100 @@ -70,6 +70,9 @@ attr_accessor :firewall_zone # @return [String] interface's hostname attr_accessor :hostname + # @return [Boolean, nil] set to true if dhcp from this interface sets machine hostname, + # false if not and nil if not specified + attr_accessor :dhclient_set_hostname # @return [String] Connection identifier attr_reader :id diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/sysconfig/connection_config_readers/base.rb new/yast2-network-4.2.28/src/lib/y2network/sysconfig/connection_config_readers/base.rb --- old/yast2-network-4.2.23/src/lib/y2network/sysconfig/connection_config_readers/base.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/sysconfig/connection_config_readers/base.rb 2019-11-19 13:31:29.000000000 +0100 @@ -58,6 +58,9 @@ conn.startmode.priority = file.ifplugd_priority if conn.startmode.name == "ifplugd" conn.ethtool_options = file.ethtool_options conn.firewall_zone = file.zone + if file.dhclient_set_hostname + conn.dhclient_set_hostname = file.dhclient_set_hostname == "yes" + end conn.hostname = hostname(conn) update_connection_config(conn) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/sysconfig/connection_config_writers/base.rb new/yast2-network-4.2.28/src/lib/y2network/sysconfig/connection_config_writers/base.rb --- old/yast2-network-4.2.23/src/lib/y2network/sysconfig/connection_config_writers/base.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/sysconfig/connection_config_writers/base.rb 2019-11-19 13:31:29.000000000 +0100 @@ -44,6 +44,7 @@ file.name = conn.description file.lladdr = conn.lladdress file.startmode = conn.startmode.to_s + file.dhclient_set_hostname = dhclient_set_hostname(conn) file.ifplugd_priority = conn.startmode.priority if conn.startmode.name == "ifplugd" if conn.ethtool_options && !conn.ethtool_options.empty? file.ethtool_options = conn.ethtool_options @@ -63,6 +64,16 @@ # @param _conn [Y2Network::ConnectionConfig::Base] def update_file(_conn); end + def dhclient_set_hostname(conn) + case conn.dhclient_set_hostname + when true then "yes" + when false then "no" + when nil then nil + else + raise "Unknown value #{conn.dhclient_set_hostname.inspect}" + end + end + # Adds IP addresses # # @param conn [Y2Network::ConnectionConfig::Base] Connection to take settings from diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/sysconfig/dns_writer.rb new/yast2-network-4.2.28/src/lib/y2network/sysconfig/dns_writer.rb --- old/yast2-network-4.2.23/src/lib/y2network/sysconfig/dns_writer.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/sysconfig/dns_writer.rb 2019-11-19 13:31:29.000000000 +0100 @@ -30,13 +30,15 @@ # # @param dns [Y2Network::DNS] DNS configuration # @param old_dns [Y2Network::DNS] Old DNS configuration - def write(dns, old_dns) + # @param netconfig_update [Boolean] Whether 'netconfig update' should be + # called after writing the DNS configuration or not + def write(dns, old_dns, netconfig_update: true) return if old_dns && dns == old_dns update_sysconfig_dhcp(dns, old_dns) update_hostname(dns) update_mta_config - update_sysconfig_config(dns) + update_sysconfig_config(dns, netconfig_update: netconfig_update) end private @@ -92,7 +94,9 @@ # Updates /etc/sysconfig/network/config # # @param dns [Y2Network::DNS] - def update_sysconfig_config(dns) + # @param netconfig_update [Boolean] Whether 'netconfig update' should be + # called after writing the DNS configuration or not + def update_sysconfig_config(dns, netconfig_update: true) Yast::SCR.Write( Yast::Path.new(".sysconfig.network.config.NETCONFIG_DNS_POLICY"), dns.resolv_conf_policy @@ -107,7 +111,7 @@ ) Yast::SCR.Write(Yast::Path.new(".sysconfig.network.config"), nil) - Yast::Execute.on_target!("/sbin/netconfig", "update") + Yast::Execute.on_target!("/sbin/netconfig", "update") if netconfig_update end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/widgets/bond_slave.rb new/yast2-network-4.2.28/src/lib/y2network/widgets/bond_slave.rb --- old/yast2-network-4.2.23/src/lib/y2network/widgets/bond_slave.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/widgets/bond_slave.rb 2019-11-19 13:31:29.000000000 +0100 @@ -220,9 +220,8 @@ # mapping to an array of device names # @return [Boolean] true if continue with duplicates, otherwise false def continue_with_duplicates?(physical_ports) - message = physical_ports.map do |port, slave| - label = "PhysicalPortID (#{port}): " - wrap_text(slave.join(", "), 76, prepend_text: label) + message = physical_ports.map do |port, slaves| + wrap_text("PhysicalPortID (#{port}): #{slaves.join(", ")}") end.join("\n") Yast::Popup.YesNoHeadline( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/widgets/wireless_auth.rb new/yast2-network-4.2.28/src/lib/y2network/widgets/wireless_auth.rb --- old/yast2-network-4.2.23/src/lib/y2network/widgets/wireless_auth.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/widgets/wireless_auth.rb 2019-11-19 13:31:29.000000000 +0100 @@ -71,8 +71,8 @@ case auth_mode_widget.value when "no-encryption" then replace_widget.replace(empty_auth_widget) when "sharedkey", "open" then replace_widget.replace(wep_keys_widget) - when "wpa-psk" then replace_widget.replace(encryption_widget) - when "wpa-eap" then replace_widget.replace(eap_widget) + when "psk" then replace_widget.replace(encryption_widget) + when "eap" then replace_widget.replace(eap_widget) else raise "invalid value #{auth_mode_widget.value.inspect}" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/lib/y2network/widgets/wireless_auth_mode.rb new/yast2-network-4.2.28/src/lib/y2network/widgets/wireless_auth_mode.rb --- old/yast2-network-4.2.23/src/lib/y2network/widgets/wireless_auth_mode.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/lib/y2network/widgets/wireless_auth_mode.rb 2019-11-19 13:31:29.000000000 +0100 @@ -45,8 +45,8 @@ ["no-encryption", _("No Encryption")], ["open", _("WEP - Open")], ["sharedkey", _("WEP - Shared Key")], - ["wpa-psk", _("WPA-PSK (\"home\")")], - ["wpa-eap", _("WPA-EAP (\"Enterprise\")")] + ["psk", _("WPA-PSK (\"home\")")], + ["eap", _("WPA-EAP (\"Enterprise\")")] ] end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/modules/DNS.rb new/yast2-network-4.2.28/src/modules/DNS.rb --- old/yast2-network-4.2.23/src/modules/DNS.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/modules/DNS.rb 2019-11-19 13:31:29.000000000 +0100 @@ -188,10 +188,14 @@ # Write new DNS and hostname settings # Includes Host,NetworkConfig::Write # @todo Update GUI + # @param netconfig_update [Boolean] Whether 'netconfig update' should be + # called after writing the DNS configuration or not # @return true if success - def Write(_gui: true) + def Write(netconfig_update: true) writer = Y2Network::Sysconfig::DNSWriter.new - writer.write(Yast::Lan.yast_config.dns, Yast::Lan.system_config.dns) + writer.write(Yast::Lan.yast_config.dns, + Yast::Lan.system_config.dns, + netconfig_update: netconfig_update) true end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/src/modules/Lan.rb new/yast2-network-4.2.28/src/modules/Lan.rb --- old/yast2-network-4.2.23/src/modules/Lan.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/src/modules/Lan.rb 2019-11-19 13:31:29.000000000 +0100 @@ -611,59 +611,6 @@ Builtins.y2debug("input %1", input) input["interfaces"] ||= [] - # TODO: remove when s390 no longer need it - interfaces = Builtins.listmap(input["interfaces"]) do |interface| - # input: list of items $[ "device": "d", "foo": "f", "bar": "b"] - # output: map of items "d": $["FOO": "f", "BAR": "b"] - new_interface = {} - # uppercase map keys - newk = nil - interface = Builtins.mapmap(interface) do |k, v| - newk = if k == "aliases" - "_aliases" - else - Builtins.toupper(k) - end - { newk => v } - end - Builtins.foreach(interface) do |k, v| - Ops.set(new_interface, k, v) if v != "" && k != "DEVICE" - end - new_device = Ops.get_string(interface, "DEVICE", "") - { new_device => new_interface } - end - - # split to a two level map like NetworkInterfaces - devices = {} - - Builtins.foreach(interfaces) do |devname, if_data| - # devname can be in old-style fashion (eth-bus-<pci_id>). So, convert it - devname = LanItems.getDeviceName(devname) - type = NetworkInterfaces.GetTypeFromIfcfgOrName(devname, if_data) - d = Ops.get(devices, type, {}) - Ops.set(d, devname, if_data) - Ops.set(devices, type, d) - end - - hwcfg = {} - if Ops.greater_than(Builtins.size(Ops.get_list(input, "modules", [])), 0) - hwcfg = Builtins.listmap(Ops.get_list(input, "modules", [])) do |mod| - options = Ops.get_string(mod, "options", "") - module_name = Ops.get_string(mod, "module", "") - start_mode = Ops.get_string(mod, "startmode", "auto") - device_name = Ops.get_string(mod, "device", "") - module_data = { - "MODULE" => module_name, - "MODULE_OPTIONS" => options, - "STARTMODE" => start_mode - } - { device_name => module_data } - end - end - - Ops.set(input, "devices", devices) - Ops.set(input, "hwcfg", hwcfg) - # DHCP:: config: some of it is in the DNS part of the profile dhcp = {} dhcpopts = Ops.get_map(input, "dhcp_options", {}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/test/data/scr_read/etc/sysconfig/network/ifcfg-eth0 new/yast2-network-4.2.28/test/data/scr_read/etc/sysconfig/network/ifcfg-eth0 --- old/yast2-network-4.2.23/test/data/scr_read/etc/sysconfig/network/ifcfg-eth0 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/test/data/scr_read/etc/sysconfig/network/ifcfg-eth0 2019-11-19 13:31:29.000000000 +0100 @@ -7,3 +7,4 @@ NETWORK='' REMOTE_IPADDR='' STARTMODE='auto' +DHCLIENT_SET_HOSTNAME='yes' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/test/dns_test.rb new/yast2-network-4.2.28/test/dns_test.rb --- old/yast2-network-4.2.23/test/dns_test.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/test/dns_test.rb 2019-11-19 13:31:29.000000000 +0100 @@ -186,7 +186,8 @@ end it "writes DNS settings" do - expect(dns_writer).to receive(:write).with(yast_config.dns, system_config.dns) + expect(dns_writer).to receive(:write) + .with(yast_config.dns, system_config.dns, netconfig_update: true) subject.Write end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/test/inst_setup_dhcp_test.rb new/yast2-network-4.2.28/test/inst_setup_dhcp_test.rb --- old/yast2-network-4.2.23/test/inst_setup_dhcp_test.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/test/inst_setup_dhcp_test.rb 2019-11-19 13:31:29.000000000 +0100 @@ -29,6 +29,7 @@ let(:lan_config) do double("lan_config").as_null_object end + let(:wicked_in_use) { true } before do allow(Yast::Lan).to receive(:Read).and_return(lan_config) @@ -37,49 +38,71 @@ describe "#main" do let(:nac) { Yast::NetworkAutoconfiguration.instance } + before do + allow(Yast::NetworkService).to receive(:Read) + allow(Yast::NetworkService).to receive(:wicked?).and_return(wicked_in_use) + end - it "returns :next when autoconfiguration is not performed" do - allow(nac) - .to receive(:any_iface_active?) - .and_return(true) + context "when wicked is not in use" do + let(:wicked_in_use) { false } - expect(subject.main).to eql :next - end + it "does not try to autoconfigure the network" do + expect(nac).to_not receive(:any_iface_active?) - 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) + subject.main + end - expect(subject.main).to eql :next + it "returns :next" do + expect(subject.main).to eql :next + end end - it "runs network dhcp autoconfiguration if no active interfaces" do - allow(nac) - .to receive(:any_iface_active?) - .and_return(false) - - expect(nac) - .to receive(:configure_dhcp) + context "when wicked is in use" do + it "returns :next when autoconfiguration is not performed" do + allow(nac) + .to receive(:any_iface_active?) + .and_return(true) - subject.main - end + expect(subject.main).to eql :next + end - context "in the initial Stage" do - it "writes DHCLIENT_SET_HOSTNAME in /etc/sysconfig/network/dhcp" do + 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(Yast::Stage).to receive(:initial).and_return(true) - expect(subject).to receive(:set_dhcp_hostname!) + expect(subject.main).to eql :next + end + + it "runs network dhcp autoconfiguration if no active interfaces" do + allow(nac) + .to receive(:any_iface_active?) + .and_return(false) + + expect(nac) + .to receive(:configure_dhcp) subject.main end end + + context "in the initial Stage" do + context "and wicked in use" 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!) + + subject.main + end + end + end end describe "#set_dhcp_hostname!" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/test/lan_test.rb new/yast2-network-4.2.28/test/lan_test.rb --- old/yast2-network-4.2.23/test/lan_test.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/test/lan_test.rb 2019-11-19 13:31:29.000000000 +0100 @@ -380,43 +380,11 @@ it "makes a minimal structure from an empty input" do expected = { "config" => { "dhcp"=>{} }, - "devices" => {}, - "hwcfg" => {}, "interfaces" => [] } expect(Yast::Lan.FromAY({})).to eq(expected) end - it "converts 'interfaces' into nested 'devices'" do - input = { - "interfaces" => [ - { - "bootproto" => "static", - "device" => "eth1", - "ipaddr" => "10.1.1.1", - "name" => "Ethernet Card 0", - "prefixlen" => "24", - "startmode" => "auto", - "usercontrol" => "no" - } - ] - } - expected = { - "eth" => { - "eth1" => { - "BOOTPROTO" => "static", - "IPADDR" => "10.1.1.1", - "NAME" => "Ethernet Card 0", - "PREFIXLEN" => "24", - "STARTMODE" => "auto", - "USERCONTROL" => "no" - } - } - } - - expect(Yast::Lan.FromAY(input)["devices"]).to eq(expected) - end - it "converts DHCP options" do input = { "dhcp_options" => { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/test/y2network/autoinst/interfaces_reader_test.rb new/yast2-network-4.2.28/test/y2network/autoinst/interfaces_reader_test.rb --- old/yast2-network-4.2.23/test/y2network/autoinst/interfaces_reader_test.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/test/y2network/autoinst/interfaces_reader_test.rb 2019-11-19 13:31:29.000000000 +0100 @@ -32,18 +32,22 @@ let(:interfaces_profile) do [ - { "startmode" => "auto", - "bootproto" => "static", - "device" => "eth1", - "name" => "", - "ipaddr" => "192.168.10.10", - "netmask" => "255.255.255.0", - "prefixlen" => "24" }, { - "bootproto" => "dhcp", - "name" => "eth0", - "startmode" => "auto", - "aliases" => { + "startmode" => "auto", + "bootproto" => "static", + "device" => "eth1", + "name" => "", + "ipaddr" => "192.168.10.10", + "netmask" => "255.255.255.0", + "dhclient_set_hostname" => "no", + "prefixlen" => "24" + }, + { + "bootproto" => "dhcp", + "name" => "eth0", + "startmode" => "auto", + "dhclient_set_hostname" => "yes", + "aliases" => { "alias0" => { "IPADDR" => "10.100.0.1", "PREFIXLEN" => "24", @@ -70,9 +74,11 @@ expect(eth0_config.startmode).to eq Y2Network::Startmode.create("auto") expect(eth0_config.bootproto).to eq Y2Network::BootProtocol.from_name("dhcp") expect(eth0_config.ip_aliases.size).to eq 2 + expect(eth0_config.dhclient_set_hostname).to eq true eth1_config = subject.config.by_name("eth1") expect(eth1_config.name).to eq("eth1") expect(eth1_config.ip.address.to_s).to eq("192.168.10.10/24") + expect(eth1_config.dhclient_set_hostname).to eq false end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/test/y2network/sysconfig/connection_config_readers/ethernet_test.rb new/yast2-network-4.2.28/test/y2network/sysconfig/connection_config_readers/ethernet_test.rb --- old/yast2-network-4.2.23/test/y2network/sysconfig/connection_config_readers/ethernet_test.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/test/y2network/sysconfig/connection_config_readers/ethernet_test.rb 2019-11-19 13:31:29.000000000 +0100 @@ -95,5 +95,9 @@ expect(eth.hostname).to be_nil end end + + it "reads dhclient set hostname value as boolean" do + expect(handler.connection_config.dhclient_set_hostname).to eq true + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/test/y2network/sysconfig/connection_config_writers/ethernet_test.rb new/yast2-network-4.2.28/test/y2network/sysconfig/connection_config_writers/ethernet_test.rb --- old/yast2-network-4.2.23/test/y2network/sysconfig/connection_config_writers/ethernet_test.rb 2019-10-15 10:56:48.000000000 +0200 +++ new/yast2-network-4.2.28/test/y2network/sysconfig/connection_config_writers/ethernet_test.rb 2019-11-19 13:31:29.000000000 +0100 @@ -66,6 +66,7 @@ c.ip_aliases = [ip_alias] c.startmode = Y2Network::Startmode.create("auto") c.hostname = "foo" + c.dhclient_set_hostname = true end end @@ -75,9 +76,10 @@ it "updates common properties" do handler.write(conn) expect(file).to have_attributes( - name: conn.description, - bootproto: "static", - startmode: "auto" + name: conn.description, + bootproto: "static", + startmode: "auto", + dhclient_set_hostname: "yes" ) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.2.23/test/y2network/widgets/wireless_auth_mode_test.rb new/yast2-network-4.2.28/test/y2network/widgets/wireless_auth_mode_test.rb --- old/yast2-network-4.2.23/test/y2network/widgets/wireless_auth_mode_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-4.2.28/test/y2network/widgets/wireless_auth_mode_test.rb 2019-11-19 13:31:29.000000000 +0100 @@ -0,0 +1,31 @@ +# Copyright (c) [2019] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "../../test_helper" +require "cwm/rspec" + +require "y2network/widgets/wireless_auth_mode" +require "y2network/interface_config_builder" + +describe Y2Network::Widgets::WirelessAuthMode do + let(:builder) { Y2Network::InterfaceConfigBuilder.for("wlan") } + subject { described_class.new(builder) } + + include_examples "CWM::ComboBox" +end
