Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2014-10-02 14:13:34 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-network" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2014-09-26 10:51:25.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2014-10-02 14:13:38.000000000 +0200 @@ -1,0 +2,22 @@ +Tue Sep 30 10:15:38 UTC 2014 - ancor@suse.com + +- The "change hostname via DHCP" setting is now configurable via + control file (bnc#870896). +- 3.1.104 + +------------------------------------------------------------------- +Mon Sep 29 22:14:49 UTC 2014 - mfilka@suse.com + +- bnc#898620 + - do not write LLADDR="00:00:00:00:00:00" into ifcfg in z/VM +- 3.1.103 + +------------------------------------------------------------------- +Thu Sep 25 15:51:37 UTC 2014 - mfilka@suse.com + +- bnc#897394, bnc#866250 + - device specific routes configuration (ifroute-<devname>) is + supported +- 3.1.102 + +------------------------------------------------------------------- Old: ---- yast2-network-3.1.101.tar.bz2 New: ---- yast2-network-3.1.104.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.7UtTnh/_old 2014-10-02 14:13:41.000000000 +0200 +++ /var/tmp/diff_new_pack.7UtTnh/_new 2014-10-02 14:13:41.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.101 +Version: 3.1.104 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-network-3.1.101.tar.bz2 -> yast2-network-3.1.104.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/package/yast2-network.changes new/yast2-network-3.1.104/package/yast2-network.changes --- old/yast2-network-3.1.101/package/yast2-network.changes 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/package/yast2-network.changes 2014-10-01 17:02:11.000000000 +0200 @@ -1,4 +1,26 @@ ------------------------------------------------------------------- +Tue Sep 30 10:15:38 UTC 2014 - ancor@suse.com + +- The "change hostname via DHCP" setting is now configurable via + control file (bnc#870896). +- 3.1.104 + +------------------------------------------------------------------- +Mon Sep 29 22:14:49 UTC 2014 - mfilka@suse.com + +- bnc#898620 + - do not write LLADDR="00:00:00:00:00:00" into ifcfg in z/VM +- 3.1.103 + +------------------------------------------------------------------- +Thu Sep 25 15:51:37 UTC 2014 - mfilka@suse.com + +- bnc#897394, bnc#866250 + - device specific routes configuration (ifroute-<devname>) is + supported +- 3.1.102 + +------------------------------------------------------------------- Tue Sep 23 15:03:15 UTC 2014 - mfilka@suse.com - bnc#892958 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/package/yast2-network.spec new/yast2-network-3.1.104/package/yast2-network.spec --- old/yast2-network-3.1.101/package/yast2-network.spec 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/package/yast2-network.spec 2014-10-01 17:02:11.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.101 +Version: 3.1.104 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/src/include/network/lan/s390.rb new/yast2-network-3.1.104/src/include/network/lan/s390.rb --- old/yast2-network-3.1.101/src/include/network/lan/s390.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/src/include/network/lan/s390.rb 2014-10-01 17:02:12.000000000 +0200 @@ -8,23 +8,18 @@ # Functions for accessing and handling s390 specific needs. module Yast module NetworkLanS390Include - def initialize_network_lan_s390(include_target) - Yast.import "UI" + SYS_DIR = "/sys/class/net" + def initialize_network_lan_s390(include_target) Yast.import "FileUtils" - - Yast.include include_target, "network/routines.rb" - - @sys_dir = "/sys/class/net" end # Checks if driver was successfully loaded for particular device. def s390_DriverLoaded(devname) return false if !Arch.s390 + return false if devname.empty? - return false if IsEmpty(devname) - - FileUtils.IsDirectory(Builtins.sformat("%1/%2", @sys_dir, devname)) == true + FileUtils.IsDirectory("#{SYS_DIR}/#{devname}") == true end # Reads particular qeth attribute and returns its value as a string. @@ -37,7 +32,7 @@ result = Convert.to_string( SCR.Read( path(".target.string"), - Builtins.sformat("%1/%2/device/%3", @sys_dir, devname, attrib) + Builtins.sformat("%1/%2/device/%3", SYS_DIR, devname, attrib) ) ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/src/lib/network/network_autoconfiguration.rb new/yast2-network-3.1.104/src/lib/network/network_autoconfiguration.rb --- old/yast2-network-3.1.101/src/lib/network/network_autoconfiguration.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/src/lib/network/network_autoconfiguration.rb 2014-10-01 17:02:12.000000000 +0200 @@ -83,8 +83,10 @@ DNS.Read # handles NetworkConfig too DNS.ProposeHostname # generate random hostname, if none known so far - # propose settings - DNS.dhcp_hostname = !Arch.is_laptop + # FIXME after SLE12: DNS.default_dhcp_hostname should be private (setting + # default values is not something for an API), but that would need some + # refactoring of this part. + DNS.dhcp_hostname = DNS.default_dhcp_hostname # get default value, from control.xml DNS.write_hostname = DNS.DefaultWriteHostname diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/src/modules/DNS.rb new/yast2-network-3.1.104/src/modules/DNS.rb --- old/yast2-network-3.1.101/src/modules/DNS.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/src/modules/DNS.rb 2014-10-01 17:02:12.000000000 +0200 @@ -43,6 +43,7 @@ Yast.import "UI" textdomain "network" + Yast.import "Arch" Yast.import "NetHwDetection" Yast.import "Hostname" Yast.import "IP" @@ -228,6 +229,24 @@ whth end + # Default value for #dhcp_hostname based on ProductFeatures and Arch + # + # @return [Boolean] value set in features or, if none is set, false just + # for laptops + def default_dhcp_hostname + # ProductFeatures.GetBooleanFeature returns false either if the value is + # false or if it's missing, so let's discard the later case calling + # ProductFeatures.GetFeature first + feature_index = ["globals", "dhclient_set_hostname"] + feature = ProductFeatures.GetFeature(*feature_index) + # No value for the feature + if feature.nil? || (feature.respond_to?(:empty?) && feature.empty?) + !Arch.is_laptop + else + ProductFeatures.GetBooleanFeature(*feature_index) + end + end + def ReadHostname fqhostname = "" # In installation (standard, or AutoYaST one), prefer /etc/install.inf @@ -445,7 +464,7 @@ # @return true if success def Import(settings) settings = deep_copy(settings) - @dhcp_hostname = Ops.get_boolean(settings, "dhcp_hostname", false) + @dhcp_hostname = settings.fetch("dhcp_hostname") { default_dhcp_hostname } #if not defined, set to 'auto' @resolv_conf_policy = Ops.get_string( settings, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/src/modules/LanItems.rb new/yast2-network-3.1.104/src/modules/LanItems.rb --- old/yast2-network-3.1.101/src/modules/LanItems.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/src/modules/LanItems.rb 2014-10-01 17:02:12.000000000 +0200 @@ -82,9 +82,6 @@ @description = "" - #unique - only for backward compatibility - #global string unique = ""; - @type = "" # ifcfg name for the @current device @device = "" @@ -204,7 +201,6 @@ # NetworkModules:: name @nm_name = "" - @nm_name_old = nil #this is the map of kernel modules vs. requested firmware #non-empty keys are firmware packages shipped by SUSE @@ -246,7 +242,6 @@ "REMOTE_IPADDR" => "", "NETMASK" => "", "MTU" => "", - "LLADDR" => "00:00:00:00:00:00", "ETHTOOL_OPTIONS" => "", "NAME" => "", "STARTMODE" => "manual", @@ -301,7 +296,8 @@ "QETH_LAYER2" => "no", "QETH_CHANIDS" => "", "IPA_TAKEOVER" => "no", - "IUCV_USER" => "" + "IUCV_USER" => "", + "LLADDR" => "00:00:00:00:00:00" } # ifplugd sometimes does not work for wifi @@ -1728,10 +1724,6 @@ @wl_power = d["WIRELESS_POWER"] == "yes" @wl_ap_scanmode = d["WIRELESS_AP_SCANMODE"] - # s/390 options - # We always have to set the MAC Address for qeth Layer2 support - @qeth_macaddress = d["LLADDR"] - @ipoib_mode = d["IPOIB_MODE"] @aliases = Ops.get_map(devmap, "_aliases", {}) @@ -1752,6 +1744,14 @@ @qeth_layer2 = d["QETH_LAYER2"] == "yes" @qeth_chanids = d["QETH_CHANIDS"] + # s/390 options + # We always have to set the MAC Address for qeth Layer2 support. + # It is used mainly as a hint for user that MAC is expected in case + # of Layer2 devices. Other devices do not need it. Simply + # because such devices do not emulate Layer2 + @qeth_macaddress = d["LLADDR"] if @qeth_layer2 + + # qeth attribute. FIXME: currently not read from system. @ipa_takeover = Ops.get_string(defaults, "IPA_TAKEOVER", "") == "yes" @@ -1860,11 +1860,6 @@ end Builtins.y2debug("type=%1", @type) - # We always have to set the MAC Address for qeth Layer2 support - if @qeth_layer2 - @qeth_macaddress = Ops.get_string(devmap, "LLADDR", "00:00:00:00:00:00") - end - true end @@ -1918,13 +1913,14 @@ Ops.set(newdev, "REMOTE_IPADDR", @remoteip) # set LLADDR to sysconfig only for device on layer2 and only these which needs it - if @qeth_layer2 + # do not write incorrect LLADDR. + if @qeth_layer2 && s390_correct_lladdr(@qeth_macaddress) busid = Ops.get_string(@Items, [@current, "hwinfo", "busid"], "") # sysfs id has changed from css0... - sysfs_id = Ops.add("/devices/qeth/", busid) - Builtins.y2milestone("busid %1", busid) + sysfs_id = "/devices/qeth/#{busid}" + log.info("busid #{busid}") if s390_device_needs_persistent_mac(sysfs_id, @Hardware) - Ops.set(newdev, "LLADDR", @qeth_macaddress) + newdev["LLADDR"] = @qeth_macaddress end end @@ -2527,6 +2523,20 @@ publish :variable => name, :type => type end + # Checks if given lladdr can be written into ifcfg + # + # @param lladdr [String] logical link address, usually MAC address in case + # of qeth device + # @return [true, false] check result + def s390_correct_lladdr(lladdr) + return false if !Arch.s390 + return false if lladdr.nil? + return false if lladdr.empty? + return false if lladdr.strip == "00:00:00:00:00:00" + + return true + end + public # @attribute Items @@ -2607,7 +2617,6 @@ publish_variable :proposal_valid , "boolean" publish_variable :nm_proposal_valid , "boolean" publish_variable :nm_name , "string" - publish_variable :nm_name_old , "string" # @attribute SysconfigDefaults publish_variable :SysconfigDefaults , "map <string, string>" publish :function => :GetLanItem, :type => "map (integer)" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/src/modules/Routing.rb new/yast2-network-3.1.104/src/modules/Routing.rb --- old/yast2-network-3.1.101/src/modules/Routing.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/src/modules/Routing.rb 2014-10-01 17:02:12.000000000 +0200 @@ -33,6 +33,10 @@ module Yast class RoutingClass < Module + # @return [Array<String>] names of devices with sysconfig configuration + attr_reader :devices + + include Logger # @Orig_Routes [Array] array of hashes. Caches known routes # @@ -41,12 +45,19 @@ # # @modified [Boolean] modified by AY (bnc#649494) + # "routes" and ifroute-DEV file directory + ROUTES_DIR = "/etc/sysconfig/network" # "routes" file location ROUTES_FILE = "/etc/sysconfig/network/routes" SYSCTL_IPV4_PATH = ".etc.sysctl_conf.\"net.ipv4.ip_forward\"" SYSCTL_IPV6_PATH = ".etc.sysctl_conf.\"net.ipv6.conf.all.forwarding\"" + # see man routes - difference on implicit device param (aka "-") in + # case of /etc/sysconfig/network/routes and /etc/sysconfig/network/ + # /ifroute-<device> + ANY_DEVICE = "-" + def main Yast.import "UI" textdomain "network" @@ -54,6 +65,7 @@ Yast.import "NetHwDetection" Yast.import "NetworkInterfaces" Yast.import "Map" + Yast.import "Mode" Yast.import "SuSEFirewall" Yast.include self, "network/runtime.rb" @@ -103,7 +115,7 @@ "destination" => "default", "gateway" => gw, "netmask" => "-", - "device" => "-" + "device" => ANY_DEVICE } ] true @@ -135,6 +147,9 @@ @Forward_v6 = SCR.Read(path(SYSCTL_IPV6_PATH)) == "1" end + log.info("Forward_v4=#{@Forward_v4}") + log.info("Forward_v6=#{@Forward_v6}") + nil end @@ -174,34 +189,42 @@ # If no routes, sets a default gateway from Detection # @return true if success def Read - # read route.conf - if Ops.greater_than(SCR.Read(path(".target.size"), ROUTES_FILE), 0) - @Routes = Convert.convert( - SCR.Read(path(".routes")), - :from => "any", - :to => "list <map>" - ) - else - @Routes = [] + # read available devices + NetworkInterfaces.Read + @devices = NetworkInterfaces.List("") + + # read routes + @Routes = SCR.Read(path(".routes")) || [] + + @devices.each do |device| + # Mode.test required for old testsuite. Dynamic agent registration break + # stubing there + register_ifroute_agent_for_device(device) unless Mode.test + + dev_routes = SCR.Read(path(".ifroute-#{device}")) || [] + + next if dev_routes.nil? || dev_routes.empty? + + dev_routes.map! do |route| + route["device"] = device if route["device"] == ANY_DEVICE + route + end + + @Routes.concat dev_routes end - ReadIPForwarding() + @Routes.uniq! + log.info("Routes=#{@Routes}") - Builtins.y2debug("Routes=#{@Routes}") - Builtins.y2debug("Forward_v4=#{@Forward_v4}") - Builtins.y2debug("Forward_v6=#{@Forward_v6}") + ReadIPForwarding() # save routes to check for changes later @Orig_Routes = deep_copy(@Routes) - @Orig_Forward_v4 = deep_copy(@Forward_v4) - @Orig_Forward_v6 = deep_copy(@Forward_v6) + @Orig_Forward_v4 = @Forward_v4 + @Orig_Forward_v6 = @Forward_v6 - # read available devices - NetworkInterfaces.Read - @devices = NetworkInterfaces.List("") - - if @Routes == [] - ReadFromGateway(Ops.get_string(NetHwDetection.result, "GATEWAY", "")) + if @Routes.empty? + ReadFromGateway(NetHwDetection.result["GATEWAY"] || "") end true @@ -224,7 +247,6 @@ ] caption = _("Saving Routing Configuration") - sl = 0 #100; //for testing Progress.New(caption, " ", Builtins.size(steps), steps, [], "") @@ -232,7 +254,6 @@ ProgressNextStage(_("Writing IP forwarding settings...")) WriteIPForwarding() - Builtins.sleep(sl) # at first stop the running routes # FIXME SCR::Execute(.target.bash, "/etc/init.d/route stop"); @@ -242,31 +263,70 @@ #Progress stage 2/2 ProgressNextStage(_("Writing routing settings...")) - # create if not exists, otherwise backup - if Ops.less_than(SCR.Read(path(".target.size"), ROUTES_FILE), 0) - SCR.Write(path(".target.string"), ROUTES_FILE, "") + ret = write_routes(@Routes) + + Progress.NextStage + + ret + end + + # From *routes*, select those belonging to *device* and write + # an appropriate config file. + # @param device device name, or "-" for global routes + # @param routes [Array<Hash>] defines route; even unrelated to *device* + # @return [true, false] if it succeedes + def write_route_file(device, routes) + routes = routes.select { |r| r["device"] == device } + + if routes.empty? + # work around bnc#19476 + if device == ANY_DEVICE + filename = ROUTES_FILE + return SCR.Write(path(".target.string"), filename, "") + else + filename = "#{ROUTES_DIR}/ifroute-#{device}" + return SCR.Execute(path(".target.remove"), filename) + end else + if device == ANY_DEVICE + scr_path = path(".routes") + else + scr_path = register_ifroute_agent_for_device(device) + end + return SCR.Write(scr_path, routes) + end + end + + # Updates routing configuration files + # + # It means /etc/sysconfig/network/routes and + # /etc/sysconfig/network/ifroute-* + # + # @param routes [Array] of hashes which defines route + # @return [true, false] if it succeedes + def write_routes(routes) + # create if not exists, otherwise backup + if SCR.Read(path(".target.size"), ROUTES_FILE) > 0 SCR.Execute( path(".target.bash"), "/bin/cp #{ROUTES_FILE} #{ROUTES_FILE}.YaST2save" ) + else + SCR.Write(path(".target.string"), ROUTES_FILE, "") end - ret = false - if @Routes == [] - # workaround bug [#4476] - ret = SCR.Write(path(".target.string"), ROUTES_FILE, "") - else - # update the routes config - ret = SCR.Write(path(".routes"), @Routes) + ret = true + + # update the routes config + Routing.devices.each do |device| + written = write_route_file(device, routes) + ret &&= written end - Builtins.sleep(sl) - Progress.NextStage - # and finally set up the new routes - # FIXME SCR::Execute(.target.bash, "/etc/init.d/route start"); + written = write_route_file(ANY_DEVICE, routes) + ret &&= written - ret == true + return ret end @@ -379,6 +439,68 @@ publish :function => :GetGateway, :type => "string ()" publish :function => :SetDevices, :type => "boolean (list)" publish :function => :Summary, :type => "string ()" + + private + def ifroute_term(device) + raise ArgumentError if device.nil? || device.empty? + + non_empty_str_term = term(:String, "^ \t\n") + whitespace_term = term(:Whitespace) + optional_whitespace_term = term(:Optional, whitespace_term) + routes_content_term = term( + :List, + term( + :Tuple, + term( + :destination, + non_empty_str_term + ), + whitespace_term, + term(:gateway, non_empty_str_term), + whitespace_term, + term(:netmask, non_empty_str_term), + optional_whitespace_term, + term( + :Optional, + term(:device, non_empty_str_term) + ), + optional_whitespace_term, + term( + :Optional, + term( + :extrapara, + term(:String, "^\n") + ) + ) + ), + "\n" + ) + + term( + :ag_anyagent, + term( + :Description, + term(:File, "#{ROUTES_DIR}/ifroute-#{device}"), + "#\n", + false, + routes_content_term + ) + ) + end + + # Registers SCR agent which is used for accessing particular ifroute-device + # file + # + # @param device [String] device name (e.g. eth0, enp0s3, ...) + # @return [Path] SCR path of the agent + # @raise [RuntimeError] if it fails + def register_ifroute_agent_for_device(device) + scr_path = path(".ifroute-#{device}") + SCR.RegisterAgent(scr_path, ifroute_term(device)) or + raise "Cannot SCR.RegisterAgent(#{scr_path}, ...)" + scr_path + end + end Routing = RoutingClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/Makefile.am new/yast2-network-3.1.104/test/Makefile.am --- old/yast2-network-3.1.101/test/Makefile.am 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/test/Makefile.am 2014-10-01 17:02:12.000000000 +0200 @@ -17,6 +17,8 @@ complex_test.rb \ read_hardware_test.rb \ udev_test.rb \ + ifroute_test.rb \ + s390_helpers_test.rb \ remote_test.rb TEST_EXTENSIONS = .rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/data/dhcp_hostname_false.xml new/yast2-network-3.1.104/test/data/dhcp_hostname_false.xml --- old/yast2-network-3.1.101/test/data/dhcp_hostname_false.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.104/test/data/dhcp_hostname_false.xml 2014-10-01 17:02:12.000000000 +0200 @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<productDefines xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> + +<!-- +Work around for the text domain +textdomain="control" +--> + + <textdomain>control</textdomain> + + <globals> + <additional_kernel_parameters/> + <enable_autologin config:type="boolean">false</enable_autologin> + <write_hostname_to_hosts config:type="boolean">true</write_hostname_to_hosts> + <dhclient_set_hostname config:type="boolean">false</dhclient_set_hostname> + </globals> + + <software> + <delete_old_packages config:type="boolean">true</delete_old_packages> + </software> + + <partitioning> + <try_separate_home config:type="boolean">true</try_separate_home> + </partitioning> + + <network> + <force_static_ip config:type="boolean">false</force_static_ip> + <network_manager>always</network_manager> + <startmode>auto</startmode> + </network> + + <texts> + <dummy_desktop><label/></dummy_desktop> + </texts> + +</productDefines> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/data/dhcp_hostname_nil.xml new/yast2-network-3.1.104/test/data/dhcp_hostname_nil.xml --- old/yast2-network-3.1.101/test/data/dhcp_hostname_nil.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.104/test/data/dhcp_hostname_nil.xml 2014-10-01 17:02:12.000000000 +0200 @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<productDefines xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> + +<!-- +Work around for the text domain +textdomain="control" +--> + + <textdomain>control</textdomain> + + <globals> + <additional_kernel_parameters/> + <enable_autologin config:type="boolean">false</enable_autologin> + <write_hostname_to_hosts config:type="boolean">true</write_hostname_to_hosts> + </globals> + + <software> + <delete_old_packages config:type="boolean">true</delete_old_packages> + </software> + + <partitioning> + <try_separate_home config:type="boolean">true</try_separate_home> + </partitioning> + + <network> + <force_static_ip config:type="boolean">false</force_static_ip> + <network_manager>always</network_manager> + <startmode>auto</startmode> + </network> + + <texts> + <dummy_desktop><label/></dummy_desktop> + </texts> + +</productDefines> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/data/dhcp_hostname_true.xml new/yast2-network-3.1.104/test/data/dhcp_hostname_true.xml --- old/yast2-network-3.1.101/test/data/dhcp_hostname_true.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.104/test/data/dhcp_hostname_true.xml 2014-10-01 17:02:12.000000000 +0200 @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<productDefines xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> + +<!-- +Work around for the text domain +textdomain="control" +--> + + <textdomain>control</textdomain> + + <globals> + <additional_kernel_parameters/> + <enable_autologin config:type="boolean">false</enable_autologin> + <write_hostname_to_hosts config:type="boolean">true</write_hostname_to_hosts> + <dhclient_set_hostname config:type="boolean">true</dhclient_set_hostname> + </globals> + + <software> + <delete_old_packages config:type="boolean">true</delete_old_packages> + </software> + + <partitioning> + <try_separate_home config:type="boolean">true</try_separate_home> + </partitioning> + + <network> + <force_static_ip config:type="boolean">false</force_static_ip> + <network_manager>always</network_manager> + <startmode>auto</startmode> + </network> + + <texts> + <dummy_desktop><label/></dummy_desktop> + </texts> + +</productDefines> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/dns_test.rb new/yast2-network-3.1.104/test/dns_test.rb --- old/yast2-network-3.1.101/test/dns_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.104/test/dns_test.rb 2014-10-01 17:02:12.000000000 +0200 @@ -0,0 +1,111 @@ +#!/usr/bin/env rspec + +ENV["Y2DIR"] = File.expand_path("../../src", __FILE__) + +require "yast" +require_relative "SCRStub" + +module Yast + RSpec.configure do |c| + c.include SCRStub + end + + import "Arch" + import "DNS" + import "ProductControl" + + describe DNS do + describe ".default_dhcp_hostname" do + before do + allow(Arch).to receive(:is_laptop).and_return laptop + ProductControl.ReadControlFile(File.join(SCRStub::DATA_PATH, control_file)) + end + + context "with dhcp_hostname=true in control file" do + let(:control_file) { "dhcp_hostname_true.xml" } + + context "in a laptop" do + let(:laptop) { true } + + it "returns the value from product features" do + expect(DNS.default_dhcp_hostname).to eql(true) + end + end + + context "in a workstation" do + let(:laptop) { false } + + it "returns the value from product features" do + expect(DNS.default_dhcp_hostname).to eql(true) + end + end + end + + context "with dhcp_hostname=false in control file" do + let(:control_file) { "dhcp_hostname_false.xml" } + + context "in a laptop" do + let(:laptop) { true } + + it "returns the value from product features" do + expect(DNS.default_dhcp_hostname).to eql(false) + end + end + + context "in a workstation" do + let(:laptop) { false } + + it "returns the value from product features" do + expect(DNS.default_dhcp_hostname).to eql(false) + end + end + end + + context "without dhcp_hostname in control file" do + let(:control_file) { "dhcp_hostname_nil.xml" } + + context "in a laptop" do + let(:laptop) { true } + + it "returns false" do + expect(DNS.default_dhcp_hostname).to eql(false) + end + end + + context "in a workstation" do + let(:laptop) { false } + + it "returns true" do + expect(DNS.default_dhcp_hostname).to eql(true) + end + end + end + end + + describe ".Import" do + context "with present dhcp_hostname and write_hostname" do + let(:settings) { {"hostname" => "host", "dhcp_hostname" => true, "write_hostname" => true} } + + it "honors the provided values" do + expect(DNS).to_not receive(:DefaultWriteHostname) + expect(DNS).to_not receive(:default_dhcp_hostname) + DNS.Import(settings) + expect(DNS.write_hostname).to eql(true) + expect(DNS.dhcp_hostname).to eql(true) + end + end + + context "with missing dhcp_hostname and write_hostname" do + let(:settings) { {"hostname" => "host"} } + + it "relies on proper methods to get default values" do + expect(DNS).to receive(:DefaultWriteHostname).and_return false + expect(DNS).to receive(:default_dhcp_hostname).and_return false + DNS.Import(settings) + expect(DNS.write_hostname).to eql(false) + expect(DNS.dhcp_hostname).to eql(false) + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/ifroute_test.rb new/yast2-network-3.1.104/test/ifroute_test.rb --- old/yast2-network-3.1.101/test/ifroute_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.104/test/ifroute_test.rb 2014-10-01 17:02:12.000000000 +0200 @@ -0,0 +1,130 @@ +#! /usr/bin/env rspec + +require_relative "test_helper" + +require "yast" + +include Yast + +Yast.import "NetworkInterfaces" +Yast.import "Routing" + +describe "Routing#Read" do + ROUTES_FILE = [ + { + "destination" => "default", + "device" => "eth0", + "gateway" => "1.1.1.1", + "netmask" => "-" + } + ] + IFROUTE_FILE = [ + { + "destination" => "default", + "device" => "-", + "gateway" => "1.1.1.1", + "netmask" => "-" + } + ] + + before(:each) do + allow(NetworkInterfaces) + .to receive(:Read) + .and_return(true) + allow(NetworkInterfaces) + .to receive(:List) + .and_return(["eth0"]) + allow(SCR) + .to receive(:Read) + .and_return(nil) + end + + it "loades ifroute-* files" do + allow(SCR) + .to receive(:Read) + .with(path(".routes")) + .and_return([]) + + expect(SCR) + .to receive(:Read) + .with(path(".ifroute-eth0")) + .and_return(IFROUTE_FILE) + expect(Routing.Read).to be true + expect(Routing.Routes).not_to be_empty + end + + it "replace implicit device name using explicit one" do + expect(SCR) + .to receive(:Read) + .with(path(".ifroute-eth0")) + .and_return(IFROUTE_FILE) + expect(Routing.Read).to be true + # check if implicit device name "-" is rewritten according device name + # which ifroute belongs to + expect(Routing.Routes.first["device"]) + .to eql "eth0" + end + + it "removes duplicit routes" do + expect(SCR) + .to receive(:Read) + .with(path(".routes")) + .and_return(ROUTES_FILE) + expect(SCR) + .to receive(:Read) + .with(path(".ifroute-eth0")) + .and_return(IFROUTE_FILE) + expect(Routing.Read).to be true + expect(Routing.Routes.size).to eql 1 + end + +end + +describe "Routing#write_routes" do + ROUTES_WITH_DEV = [ + { + "destination" => "default", + "device" => "eth0", + "gateway" => "1.1.1.1", + "netmask" => "-" + }, + { + "destination" => "default", + "device" => "eth1", + "gateway" => "2.2.2.2", + "netmask" => "-" + } + ] + + it "writes device assigned routes into correct ifroute file" do + allow(SCR) + .to receive(:Read) + .with(path(".target.size"), RoutingClass::ROUTES_FILE) + .and_return(1) + allow(Routing) + .to receive(:devices) + .and_return(["eth0", "eth1", "eth2"]) + expect(SCR) + .to receive(:Execute) + .with(path(".target.bash"), /^\/bin\/cp/) + .and_return(0) + + expect(SCR) + .to receive(:Write) + .with(path(".ifroute-eth0"), anything()) + .and_return(true) + expect(SCR) + .to receive(:Write) + .with(path(".ifroute-eth1"), anything()) + .and_return(true) + expect(SCR) + .to receive(:Execute) + .with(path(".target.remove"), "/etc/sysconfig/network/ifroute-eth2") + .and_return(true) + expect(SCR) + .to receive(:Write) + .with(path(".target.string"), "/etc/sysconfig/network/routes", "") + .and_return(true) + expect(Routing.write_routes(ROUTES_WITH_DEV)).to be true + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/lan_items_helpers_test.rb new/yast2-network-3.1.104/test/lan_items_helpers_test.rb --- old/yast2-network-3.1.101/test/lan_items_helpers_test.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/test/lan_items_helpers_test.rb 2014-10-01 17:02:12.000000000 +0200 @@ -103,3 +103,29 @@ expect(Yast::LanItems.getNetworkInterfaces).to match_array(EXPECTED_INTERFACES) end end + +describe "LanItemsClass#s390_correct_lladdr" do + Yast.import "Arch" + + before(:each) do + allow(Yast::Arch) + .to receive(:s390) + .and_return(true) + end + + it "fails if given lladdr is nil" do + expect(Yast::LanItems.send(:s390_correct_lladdr, nil)).to be false + end + + it "fails if given lladdr is empty" do + expect(Yast::LanItems.send(:s390_correct_lladdr, "")).to be false + end + + it "fails if given lladdr contains zeroes only" do + expect(Yast::LanItems.send(:s390_correct_lladdr, "00:00:00:00:00:00")).to be false + end + + it "succeeds if given lladdr contains valid MAC" do + expect(Yast::LanItems.send(:s390_correct_lladdr, "0a:00:27:00:00:00")).to be true + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/routing_test.rb new/yast2-network-3.1.104/test/routing_test.rb --- old/yast2-network-3.1.101/test/routing_test.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/test/routing_test.rb 2014-10-01 17:02:12.000000000 +0200 @@ -277,9 +277,6 @@ .with(path(".routes")) { MOCKED_ROUTES } expect(SCR) .to receive(:Read) - .with(path(".target.size"), "#{RoutingClass::ROUTES_FILE}") { 1 } - expect(SCR) - .to receive(:Read) .with(SYSCTL_IPV4_PATH) { ipv4 } expect(SCR) .to receive(:Read) @@ -300,6 +297,7 @@ expect(Routing.Read).to be true end + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/test/s390_helpers_test.rb new/yast2-network-3.1.104/test/s390_helpers_test.rb --- old/yast2-network-3.1.101/test/s390_helpers_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.104/test/s390_helpers_test.rb 2014-10-01 17:02:12.000000000 +0200 @@ -0,0 +1,52 @@ +#!/usr/bin/env rspec + +require_relative "test_helper" + +require "yast" + +# creating a wrapper for Yast's 'header' file +$LOAD_PATH.unshift File.expand_path('../../src', __FILE__) +require "include/network/lan/s390" + +class NetworkLanS390Include < Yast::Client + include Singleton + + def initialize + Yast.include self, "network/lan/s390.rb" + end +end + +Yast.import "Arch" +Yast.import "FileUtils" + +describe "NetworkLanS390Include::s390_DriverLoaded" do + DEVNAME = "devname" + + before(:each) do + allow(Yast::Arch) + .to receive(:s390) + .and_return(true) + end + + # it checks if a driver which emulates common linux device + # on top of s390 one is loaded already + it "succeeds when driver is already loaded" do + expect(Yast::FileUtils) + .to receive(:IsDirectory) + .with("#{Yast::NetworkLanS390Include::SYS_DIR}/#{DEVNAME}") + .and_return(true) + + expect(NetworkLanS390Include.instance.s390_DriverLoaded(DEVNAME)) + .to be true + end + + it "fails when driver is not loaded" do + expect(Yast::FileUtils) + .to receive(:IsDirectory) + .with("#{Yast::NetworkLanS390Include::SYS_DIR}/#{DEVNAME}") + .and_return(false) + + expect(NetworkLanS390Include.instance.s390_DriverLoaded(DEVNAME)) + .to be false + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/testsuite/tests/Lan.out new/yast2-network-3.1.104/testsuite/tests/Lan.out --- old/yast2-network-3.1.101/testsuite/tests/Lan.out 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/testsuite/tests/Lan.out 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -Dump Disabled diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/testsuite/tests/Lan.rb new/yast2-network-3.1.104/testsuite/tests/Lan.rb --- old/yast2-network-3.1.101/testsuite/tests/Lan.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/testsuite/tests/Lan.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,120 +0,0 @@ -# encoding: utf-8 - -#*************************************************************************** -# -# Copyright (c) 2012 Novell, Inc. -# 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 Novell, Inc. -# -# To contact Novell about this file by physical or electronic mail, -# you may find current contact information at www.novell.com -# -#************************************************************************** -module Yast - class LanClient < Client - def main - Yast.include self, "testsuite.rb" - - DUMP("Disabled") - return - - @READ = { - "target" => { "size" => 1, "tmpdir" => "/tmp", "string" => "Blah\n" }, - "init" => { "scripts" => { "exists" => true } }, - "etc" => { - "resolv_conf" => { - "nameserver" => ["1.2.3.4", "5.6.7.8"], - "search" => ["suse.cz", "suse.de"], - "domain" => "blah" - } - }, - "probe" => { "system" => [] }, - "product" => { - "features" => { - "USE_DESKTOP_SCHEDULER" => "0", - "ENABLE_AUTOLOGIN" => "0", - "EVMS_CONFIG" => "0", - "IO_SCHEDULER" => "cfg", - "UI_MODE" => "expert" - } - }, - "sysconfig" => { - "language" => { - "RC_LANG" => "", - "DEFAULT_LANGUAGE" => "", - "ROOT_USES_LANG" => "no" - }, - "console" => { "CONSOLE_ENCODING" => "UTF-8" } - } - } - - @EXEC = { "target" => { "bash_output" => {} } } - - TESTSUITE_INIT([@READ, {}, @EXEC], nil) - - Yast.import "Lan" - Yast.import "Progress" - Progress.off - - DUMP("Read") - #TEST(``(Lan::Read()), [READ], nil); - - DUMP("Write") - #TEST(``(Lan::Write()), [], nil); - - @lan_settings = { - "dns" => { - "dhcp_hostname" => false, - "domain" => "suse.com", - "hostname" => "nashif", - "nameservers" => ["10.0.0.1"], - "searchlist" => ["suse.com"] - }, - "interfaces" => [ - { - "STARTMODE" => "onboot", - "BOOTPROTO" => "static", - "BROADCAST" => "10.10.1.255", - "IPADDR" => "10.10.1.1", - "NETMASK" => "255.255.255.0", - "NETWORK" => "10.10.1.0", - "UNIQUE" => "", - "device" => "eth0", - "module" => "", - "options" => "" - } - ], - "routing" => { - "routes" => [ - { - "destination" => "default", - "device" => "", - "gateway" => "10.10.0.8", - "netmask" => "0.0.0.0" - } - ], - "ip_forwarding" => false - } - } - - DUMP("Import") - #TEST(``(Lan::Import(lan_settings)), [], nil); - - DUMP("Export") - #TEST(``(Lan::Export()), [], nil); - end - end -end - -Yast::LanClient.new.main diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/testsuite/tests/NetworkStorage.rb new/yast2-network-3.1.104/testsuite/tests/NetworkStorage.rb --- old/yast2-network-3.1.101/testsuite/tests/NetworkStorage.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/testsuite/tests/NetworkStorage.rb 2014-10-01 17:02:12.000000000 +0200 @@ -56,16 +56,6 @@ @EXECUTE ], nil) - # FIXME polish it to really test it - # - # TEST(``( - # Assert::Equal(`nfs, NetworkStorage::isDiskOnNetwork("server:/export")) - # ), [READ, WRITE, EXECUTE], nil); - # - # TEST(``( - # Assert::Equal(`nfs, NetworkStorage::isDiskOnNetwork("server-v4:/")) - # ), [READ, WRITE, EXECUTE], nil); - nil end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/testsuite/tests/Network_YaPI.out new/yast2-network-3.1.104/testsuite/tests/Network_YaPI.out --- old/yast2-network-3.1.101/testsuite/tests/Network_YaPI.out 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/testsuite/tests/Network_YaPI.out 2014-10-01 17:02:12.000000000 +0200 @@ -8,13 +8,6 @@ Read .sysconfig.network.config.NETCONFIG_DNS_STATIC_SEARCHLIST "suse.cz suse.de" Read .target.stat "/etc/hostname" $["exists":true] Read .target.string "/etc/hostname" "laptop.suse.cz" -Read .target.size "/etc/sysconfig/network/routes" 27 -Read .routes [$["destination":"default", "gateway":"10.20.30.40"]] -Execute .target.bash "rpm -q --whatprovides SuSEfirewall2" 0 -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show SuSEfirewall2.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] -Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled SuSEfirewall2.service " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] -Read .etc.sysctl_conf."net.ipv4.ip_forward" nil -Read .etc.sysctl_conf."net.ipv6.conf.all.forwarding" nil Dir .network.section: ["eth0", "eth1", "eth2", "eth3", "eth4", "eth5", "eth5.23"] Dir .network.value."eth0": ["BOOTPROTO", "STARTMODE"] Read .network.value."eth0".BOOTPROTO "dhcp4" @@ -60,6 +53,19 @@ Read .network.value."eth5.23".IPADDR "1.2.3.8/24" Read .network.value."eth5.23".STARTMODE "auto" Read .network.value."eth5.23".VLAN_ID "23" +Read .routes [$["destination":"default", "gateway":"10.20.30.40"]] +Read .ifroute-eth0 [] +Read .ifroute-eth1 [] +Read .ifroute-eth2 [] +Read .ifroute-eth3 [] +Read .ifroute-eth4 [] +Read .ifroute-eth5 [] +Read .ifroute-eth5.23 [] +Execute .target.bash "rpm -q --whatprovides SuSEfirewall2" 0 +Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show SuSEfirewall2.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] +Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled SuSEfirewall2.service " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] +Read .etc.sysctl_conf."net.ipv4.ip_forward" nil +Read .etc.sysctl_conf."net.ipv6.conf.all.forwarding" nil Dir .network.section: ["eth0", "eth1", "eth2", "eth3", "eth4", "eth5", "eth5.23"] Dir .network.value."eth0": ["BOOTPROTO", "STARTMODE"] Read .network.value."eth0".BOOTPROTO "dhcp4" @@ -275,8 +281,14 @@ Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password restart network.service " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show network.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled network.service " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] -Read .target.size "/etc/sysconfig/network/routes" 27 Read .routes [$["destination":"default", "gateway":"10.20.30.40"]] +Read .ifroute-eth0 [] +Read .ifroute-eth1 [] +Read .ifroute-eth2 [] +Read .ifroute-eth3 [] +Read .ifroute-eth4 [] +Read .ifroute-eth5 [] +Read .ifroute-eth5.23 [] Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password show SuSEfirewall2.service --property=Id --property=MainPID --property=Description --property=LoadState --property=ActiveState --property=SubState --property=UnitFileState --property=FragmentPath " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] Execute .target.bash_output " LANG=C TERM=dumb COLUMNS=1024 systemctl --no-legend --no-pager --no-ask-password is-enabled SuSEfirewall2.service " $["exit":0, "stderr":"", "stdout":"laptop.suse.cz"] Read .etc.sysctl_conf."net.ipv4.ip_forward" nil @@ -290,6 +302,13 @@ Execute .target.bash "echo 0 > /proc/sys/net/ipv6/conf/all/forwarding" 0 Read .target.size "/etc/sysconfig/network/routes" 27 Execute .target.bash "/bin/cp /etc/sysconfig/network/routes /etc/sysconfig/network/routes.YaST2save" 0 +Execute .target.remove "/etc/sysconfig/network/ifroute-eth0" 0 +Execute .target.remove "/etc/sysconfig/network/ifroute-eth1" 0 +Execute .target.remove "/etc/sysconfig/network/ifroute-eth2" 0 +Execute .target.remove "/etc/sysconfig/network/ifroute-eth3" 0 +Execute .target.remove "/etc/sysconfig/network/ifroute-eth4" 0 +Execute .target.remove "/etc/sysconfig/network/ifroute-eth5" 0 +Execute .target.remove "/etc/sysconfig/network/ifroute-eth5.23" 0 Write .routes [$["destination":"default", "device":"-", "gateway":"10.20.30.40", "netmask":"-"]] true Log assertion failure, expected '$["error":"A valid IP address consists of four integers\nin the range 0-255 separated by dots.", "exit":"-1"]', got '$["error":"A valid IPv4 address consists of four integers\nin the range 0-255 separated by dots.", "exit":"-1"]' Dir .network.section: ["eth0", "eth1", "eth2", "eth3", "eth4", "eth5", "eth5.23"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.101/testsuite/tests/Network_YaPI.rb new/yast2-network-3.1.104/testsuite/tests/Network_YaPI.rb --- old/yast2-network-3.1.101/testsuite/tests/Network_YaPI.rb 2014-09-24 15:22:13.000000000 +0200 +++ new/yast2-network-3.1.104/testsuite/tests/Network_YaPI.rb 2014-10-01 17:02:12.000000000 +0200 @@ -110,6 +110,15 @@ } } + # mock /etc/sysconfig/network/ifroute-* files. It was not supported + # at time of writing the testsuite and if not mocked causes false + # positives + ifroutes = {} + @READ["network"]["section"].keys.each do |devname| + ifroutes["ifroute-#{devname}"] = [] + end + @READ.merge!(ifroutes) + Testsuite.Init([@READ, {}, @EXEC], nil) Yast.import "YaPI::NETWORK" -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org