Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2019-01-10 15:16:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-network" Thu Jan 10 15:16:17 2019 rev:398 rq:664300 version:4.1.29 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2019-01-05 14:40:38.956567289 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-network.new.28833/yast2-network.changes 2019-01-10 15:16:19.694748051 +0100 @@ -1,0 +2,13 @@ +Thu Jan 10 08:29:43 UTC 2019 - mfi...@suse.com + +- bnc#1111483 + - write physical device into vlan's configuration +- 4.1.29 + +------------------------------------------------------------------- +Fri Jan 4 15:59:29 CET 2019 - sch...@suse.de + +- Added needed method GetDHCPHostnameIP again (bsc#1119690). +- 4.1.28 + +------------------------------------------------------------------- Old: ---- yast2-network-4.1.27.tar.bz2 New: ---- yast2-network-4.1.29.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.uDyBHy/_old 2019-01-10 15:16:20.130747633 +0100 +++ /var/tmp/diff_new_pack.uDyBHy/_new 2019-01-10 15:16:20.134747629 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.1.27 +Version: 4.1.29 Release: 0 BuildArch: noarch @@ -31,9 +31,9 @@ #for install task BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) -# Yast2::Systemd::Socket -BuildRequires: yast2 >= 4.1.3 -Requires: yast2 >= 4.1.3 +# Yast::Execute.stdout.on_target! +BuildRequires: yast2 >= 4.1.42 +Requires: yast2 >= 4.1.42 # Product control need xml agent BuildRequires: yast2-xml ++++++ yast2-network-4.1.27.tar.bz2 -> yast2-network-4.1.29.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.27/package/yast2-network.changes new/yast2-network-4.1.29/package/yast2-network.changes --- old/yast2-network-4.1.27/package/yast2-network.changes 2019-01-04 11:33:34.000000000 +0100 +++ new/yast2-network-4.1.29/package/yast2-network.changes 2019-01-10 10:06:06.000000000 +0100 @@ -1,4 +1,17 @@ ------------------------------------------------------------------- +Thu Jan 10 08:29:43 UTC 2019 - mfi...@suse.com + +- bnc#1111483 + - write physical device into vlan's configuration +- 4.1.29 + +------------------------------------------------------------------- +Fri Jan 4 15:59:29 CET 2019 - sch...@suse.de + +- Added needed method GetDHCPHostnameIP again (bsc#1119690). +- 4.1.28 + +------------------------------------------------------------------- Fri Jan 4 09:46:06 UTC 2019 - mfi...@suse.com - bnc#1116568 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.27/package/yast2-network.spec new/yast2-network-4.1.29/package/yast2-network.spec --- old/yast2-network-4.1.27/package/yast2-network.spec 2019-01-04 11:33:34.000000000 +0100 +++ new/yast2-network-4.1.29/package/yast2-network.spec 2019-01-10 10:06:06.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 4.1.27 +Version: 4.1.29 Release: 0 BuildArch: noarch @@ -31,9 +31,9 @@ #for install task BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake) -# Yast2::Systemd::Socket -BuildRequires: yast2 >= 4.1.3 -Requires: yast2 >= 4.1.3 +# Yast::Execute.stdout.on_target! +BuildRequires: yast2 >= 4.1.42 +Requires: yast2 >= 4.1.42 # Product control need xml agent BuildRequires: yast2-xml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.27/src/include/network/lan/complex.rb new/yast2-network-4.1.29/src/include/network/lan/complex.rb --- old/yast2-network-4.1.27/src/include/network/lan/complex.rb 2019-01-04 11:33:34.000000000 +0100 +++ new/yast2-network-4.1.29/src/include/network/lan/complex.rb 2019-01-10 10:06:06.000000000 +0100 @@ -186,7 +186,6 @@ [LanItems.current, "ifcfg"], Ops.get_string(LanItems.getCurrentItem, ["hwinfo", "dev_name"], "") ) - Ops.set(LanItems.Items, [LanItems.current, "commited"], false) LanItems.operation = :edit fw = "" if LanItems.needFirmwareCurrentItem diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.27/src/modules/DNS.rb new/yast2-network-4.1.29/src/modules/DNS.rb --- old/yast2-network-4.1.27/src/modules/DNS.rb 2019-01-04 11:33:34.000000000 +0100 +++ new/yast2-network-4.1.29/src/modules/DNS.rb 2019-01-10 10:06:06.000000000 +0100 @@ -474,7 +474,7 @@ Builtins.size(NetworkInterfaces.Locate("BOOTPROTO", "dhcp")), 0 ) || @dhcp_hostname - dhcp_data = GetDHCPHostnameIP() + dhcp_data = dhcp_data() Builtins.y2milestone("Got DHCP-configured data: %1", dhcp_data) end # FIXME: May not work properly in following situations: @@ -519,6 +519,17 @@ private + # Return current IP and hostname values + # + # @return [Hash<String>] a map containing ip, hostname_short, and hostname_fq keys + def dhcp_data + { + "ip" => Yast::Execute.stdout.on_target!("/bin/hostname -i").strip, + "hostname_short" => Yast::Execute.stdout.on_target!("/bin/hostname").strip, + "hostname_fq" => Yast::Execute.stdout.on_target!("/bin/hostname -f").strip + } + end + def read_hostname_from_install_inf install_inf_hostname = SCR.Read(path(".etc.install_inf.Hostname")) || "" log.info("Got #{install_inf_hostname} from install.inf") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.27/src/modules/LanItems.rb new/yast2-network-4.1.29/src/modules/LanItems.rb --- old/yast2-network-4.1.27/src/modules/LanItems.rb 2019-01-04 11:33:34.000000000 +0100 +++ new/yast2-network-4.1.29/src/modules/LanItems.rb 2019-01-10 10:06:06.000000000 +0100 @@ -284,6 +284,11 @@ # # @param itemId [Integer] a key for {#Items} def GetDeviceType(itemId) + # in such case ifcfg is not existing and /sys might not contain + # any device info (especially for virtual devices like vlan) + # @type variable is already initialized by @see HardwareDialog + # resp its storage handler @see storeHW + return @type if @operation == :add NetworkInterfaces.GetType(GetDeviceName(itemId)) end @@ -749,7 +754,6 @@ def AddNew @current = @Items.to_h.size - @Items[@current] = { "commited" => false } @operation = :add nil @@ -1148,19 +1152,19 @@ NetworkInterfaces.CleanHotplugSymlink interfaces = getNetworkInterfaces + items = LanItems.Items # match configurations to Items list with hwinfo interfaces.each do |confname| - @Items.each do |key, value| + items.each do |key, value| match = value.fetch("hwinfo", {}).fetch("dev_name", "") == confname - @Items[key]["ifcfg"] = confname if match + items[key]["ifcfg"] = confname if match end end interfaces.each do |confname| - next if @Items.keys.any? { |key| @Items.fetch(key, {}).fetch("ifcfg", "") == confname } + next if items.values.any? { |item| item && item["ifcfg"] == confname } - AddNew() - @Items[@current] = { "ifcfg" => confname } + items[items.size] = { "ifcfg" => confname } end log.info "Read Configuration LanItems::Items #{@Items}" @@ -1192,10 +1196,10 @@ def Import(settings) reset_cache + items = LanItems.Items NetworkInterfaces.Import("netcard", settings["devices"] || {}) NetworkInterfaces.List("netcard").each do |device| - AddNew() - LanItems.Items[current] = { "ifcfg" => device } + items[items.size] = { "ifcfg" => device } end @autoinstall_settings["start_immediately"] = settings.fetch("start_immediately", false) @@ -2171,16 +2175,15 @@ # Remove a half-configured item. # @return [true] so that this can be used for the :abort callback def Rollback - if getCurrentItem["commited"] == false - log.info "rollback item #{@current}" - if getCurrentItem.fetch("hwinfo", {}).empty? - LanItems.Items.delete(@current) - elsif IsCurrentConfigured() - if !getNetworkInterfaces.include?(getCurrentItem["ifcfg"]) - LanItems.Items[@current].delete("ifcfg") - end + log.info "rollback item #{@current}" + if getCurrentItem.fetch("hwinfo", {}).empty? + LanItems.Items.delete(@current) + elsif IsCurrentConfigured() + if !getNetworkInterfaces.include?(getCurrentItem["ifcfg"]) + LanItems.Items[@current].delete("ifcfg") end end + true end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-4.1.27/test/dns_test.rb new/yast2-network-4.1.29/test/dns_test.rb --- old/yast2-network-4.1.27/test/dns_test.rb 2019-01-04 11:33:34.000000000 +0100 +++ new/yast2-network-4.1.29/test/dns_test.rb 2019-01-10 10:06:06.000000000 +0100 @@ -106,5 +106,53 @@ end end end + + describe ".IsHostLocal" do + let(:ip) { "10.111.66.75" } + let(:hostname_short) { "test" } + let(:hostname_fq) { "test.test.de" } + let(:output) { { "ip" => ip, "hostname_short" => hostname_short, "hostname_fq" => hostname_fq } } + let(:ipv4) { false } + let(:ipv6) { false } + let(:stdout) { double } + + before do + DNS.dhcp_hostname = true + + allow(DNS).to receive(:Read) + allow(IP).to receive(:Check4).and_return(ipv4) + allow(IP).to receive(:Check6).and_return(ipv6) + allow(Yast::Execute).to receive(:stdout).and_return(stdout) + allow(stdout).to receive(:on_target!).with("/bin/hostname -i").and_return(ip) + allow(stdout).to receive(:on_target!).with("/bin/hostname").and_return(hostname_short) + allow(stdout).to receive(:on_target!).with("/bin/hostname -f").and_return(hostname_fq) + end + + ["localhost", "localhost.localdomain", "::1", "127.0.0.1"].each do |host| + it "returns true when host is \"#{host}\"" do + expect(DNS.IsHostLocal(host)).to eq(true) + end + end + + it "returns true when the short hostname is given" do + expect(DNS.IsHostLocal(hostname_short)).to eq(true) + end + + it "returns true when the fq hostname is given" do + expect(DNS.IsHostLocal(hostname_fq)).to eq(true) + end + + context "for IPv4" do + let(:ipv4) { true } + + it "returns true when the ip of local machine is given" do + expect(DNS.IsHostLocal(ip)).to eq(true) + end + + it "returns false when the ip of local machine is not given" do + expect(DNS.IsHostLocal("1.2.3.4")).to eq(false) + end + end + end end end