Hello community,

here is the log from the commit of package yast2-network for openSUSE:Leap:15.2 
checked in at 2020-02-27 06:41:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/yast2-network (Old)
 and      /work/SRC/openSUSE:Leap:15.2/.yast2-network.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-network"

Thu Feb 27 06:41:21 2020 rev:121 rq:779095 version:4.2.56

Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/yast2-network/yast2-network.changes    
2020-02-21 23:50:04.560652841 +0100
+++ /work/SRC/openSUSE:Leap:15.2/.yast2-network.new.26092/yast2-network.changes 
2020-02-27 06:41:22.513593596 +0100
@@ -1,0 +2,19 @@
+Fri Feb 21 09:53:25 UTC 2020 - Knut Anderssen <kanders...@suse.com>
+
+- Do not crash when checking if a given 'host' is local or not
+  (bsc#1163305)
+- 4.2.56
+
+-------------------------------------------------------------------
+Wed Feb 19 11:52:25 UTC 2020 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Add a class to represent NTP servers (jsc#SLE-7188).
+- 4.2.55
+
+-------------------------------------------------------------------
+Wed Feb 19 07:34:39 UTC 2020 - Knut Anderssen <kanders...@suse.com>
+
+- Do not crash with an exception when editing the hardware
+  configuration of a new unplugged connection (bsc#1162679)
+
+-------------------------------------------------------------------

Old:
----
  yast2-network-4.2.54.tar.bz2

New:
----
  yast2-network-4.2.56.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.URIFEh/_old  2020-02-27 06:41:22.829594253 +0100
+++ /var/tmp/diff_new_pack.URIFEh/_new  2020-02-27 06:41:22.833594262 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.2.54
+Version:        4.2.56
 Release:        0
 Summary:        YaST2 - Network Configuration
 License:        GPL-2.0-only

++++++ yast2-network-4.2.54.tar.bz2 -> yast2-network-4.2.56.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/doc/autoinst 
new/yast2-network-4.2.56/doc/autoinst
--- old/yast2-network-4.2.54/doc/autoinst       2020-02-18 13:02:19.000000000 
+0100
+++ new/yast2-network-4.2.56/doc/autoinst       1970-01-01 01:00:00.000000000 
+0100
@@ -1,132 +0,0 @@
-How Autoyast networking works in SLES9-SP2
-==========================================
-
-$Revision: 1.1.2.3 $ $Date: 2006/03/06 12:26:49 $ - work in progress!
-Martin Vidner <mvid...@suse.cz>
-
-Use case 1 - One ethernet card with DHCP
-----------------------------------------
-
-Probably the simplest case. Here is what one gets when configuring it
-using the GUI:
-
-    <networking>
-      <dns>
-        <dhcp_hostname config:type="boolean">false</dhcp_hostname>
-        <dhcp_resolv config:type="boolean">true</dhcp_resolv>
-        <domain>SuSE.Cz</domain>
-        <hostname>Medusa</hostname>
-      </dns>
-      <interfaces config:type="list">
-        <interface>
-          <bootproto>dhcp</bootproto>
-          <device>eth0</device>
-          <startmode>onboot</startmode>
-        </interface>
-      </interfaces>
-      <modules config:type="list">
-        <module_entry>
-          <device>static-0</device>
-          <module></module>
-          <options></options>
-        </module_entry>
-      </modules>
-      <routing>
-        <ip_forward config:type="boolean">true</ip_forward>
-      </routing>
-    </networking>
-
-Here the contents of <device> entries do not matter - the resulting
-configuration files are named using the MAC address and PCI bus
-location (ifcfg-eth-id-00:00:1c:b5:70:7e, hwcfg-bus-pci-0000:00:0b.0).
-
-(Note: I installed from a network installation source. So install.inf
-was used. CD installation may behave differently)
-
-Ideas from code reading
------------------------
-
-Autoinstall checks Hardware!=[] && interfaces != []. That will not
-create config for a card that is not currently plugged in.
-
-
-How it Works
-------------
-
-SP2: If <interfaces> is not empty (and Hardware is not empty, possible
-bug), do autoinstallation configuration, otherwise do the installation
-proposal, including routing and resolver.
-
-SP3 (since 2.9.84): If <interfaces> is not empty, use it for
-autoinstallation configuration, otherwise propose only the
-interfaces. Routing and resolver will be taken from the profile in
-both cases (see also bug #117484).
-
-2.9.89: For each of <interfaces>, <routing><routes>, <dns><hostname>,
-and <dns><nameservers>, if it is not empty, use it for
-autoinstallation configuration, otherwise use the values from install.inf
-(bug #153426).
-
-  Autoinstallation
-  ----------------
-
-For each <interface>:
-Find a device which matches it (complex rules, see below).
-If we found a matching device, get the corresponding <module_entry>
-(having equal <device>). If found, it overrides the detected settings,
-else use the detected driver.
-If we did not find a matching device, use driver settings from
-install.inf. If there are none, don't set up the interface.
-Set interface properties.
-
-  Proposal
-  --------
-
-  Finding a Matching Device
-  -------------------------
-
-Let D be <interface/device>.
-Look for the first match:
-- (0) matching MAC for D being *-id-MAC
-- (0) matching bus id for D being *-bus-BUS-ID (PCI and in SP3 VIO)
-- (0) matching module (of first driver) for corresponding
-      <module_entry/module> [a]
-
-Then, when configuring the first interface:
-- (1) matching MAC with install.inf
-- (1) matching module (1st driver) with install.inf
-- (1) first that has an active module
-- (1) first that has a module
-
-For subsequent interfaces, instead:
-- (2) take the first device that does not have a configuration yet
-      (checking only the default name, eg *-id-MAC, BTW how are the
-      resulting configs named???) and has the same type (eth...) as
-      <interface/device>.
-
-
-[a]: If there are two devices with the same module, the first will be
-picked, even if it has already been configured. That is why (2) exists
-to overrule it. Unfortunately in SLES9 SP2, (2) also overrules the
-other, unique, (0) selections (bug #119592#c9).
-It has been "fixed" in SP3 in a broken way, to apply (2) only if (0)
-did not match. This means that specifying two devices by bus ID will
-work but specifying two devices with the same module can break (bug
-#146965).
-
-Why not just take what is written in the profile?
--------------------------------------------------
-
-Currently YaST relies on some data that is obtained from hardware
-detection, like the Unique ID from hwinfo. In the future it should be
-possible to avoid that.
-
-Notes
------
-
-<foo/bar> denotes the XML element bar that is under foo. Think of
-XPath.
-
-/etc/install.inf contains the parameters passed to YaST by linuxrc,
-the text mode bootstrap program. linuxrc gets them from the kernel
-command line or by asking the user.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/doc/devices.html 
new/yast2-network-4.2.56/doc/devices.html
--- old/yast2-network-4.2.54/doc/devices.html   2020-02-18 13:02:19.000000000 
+0100
+++ new/yast2-network-4.2.56/doc/devices.html   1970-01-01 01:00:00.000000000 
+0100
@@ -1,287 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head>
-<title>Network Configuration: Devices Overview</title>
-</head><body bgcolor=#ffffff>
-
-<!-- Author: Michal Svec <ms...@suse.cz> -->
-<!-- $Id$ -->
-<a name="top"></a>
-<h1>Network Configuration: Devices Overview</h1>
-<hr>
-
-<table border="1" summary="overview">
-  <tbody>
-<!-- ========================================================= -->
-    <tr>
-      <th>Type</th>
-      <th>Subtype</th>
-      <th>Device</th>
-
-      <th>PTP</th>
-
-      <th>ISA</th>
-      <th>PCI</th>
-      <th>PCMCIA</th>
-      <th>CardBus</th>
-      <th>USB</th>
-      <th>Serial</th>
-
-      <th>Other</th>
-    </tr>
-<!-- ========================================================= -->
-    <tr>
-      <td rowspan=13>Network Card</td>
-      <td><a href="#arc">ARCnet</a></td>
-      <td>arc</td>
-      <td></td>
-      <td>ISA</td>
-      <td><a href="">#</a></td>
-    </tr>
-    <tr>
-      <td><a href="#dummy">Dummy</a></td>
-      <td>dummy</td>
-    </tr>
-    <tr>
-      <td><a href="#ci">CLAW</a></td>
-      <td>ci</td>
-    </tr>
-    <tr>
-      <td><a href="#ctc">CTC</a></td>
-      <td>ctc</td>
-      <td>PTP</td>
-    </tr>
-    <tr>
-      <td><a href="#escon">Escon</a></td>
-      <td>escon</td>
-      <td>PTP</td>
-    </tr>
-    <tr>
-      <td><a href="#eth">Ethernet</a></td>
-      <td>eth</td>
-      <td></td>
-      <td>ISA</td>
-      <td><a href="hwinfo/bSAa.+xOL8ZCSAQC">PCI</a></td>
-      <td><a href="hwinfo/K1pk.IbtCQ++Y3l4">PCMCIA</a></td>
-      <td><a href="hwinfo/vTuk.IQxIdIhhuH7">CardBus</a></td>
-      <td><a href="">#</a></td>
-    </tr>
-    <tr>
-      <td><a href="#fddi">FDDI</a></td>
-      <td>fddi</td>
-      <td></td>
-      <td>ISA</td>
-      <td><a href="">#</a></td>
-    </tr>
-    <tr>
-      <td><a href="#hsi">Hipersockets</a></td>
-      <td>hsi</td>
-    </tr>
-    <tr>
-      <td><a href="#iucv">IUCV</a></td>
-      <td>iucv</td>
-      <td>PTP</td>
-    </tr>
-    <tr>
-      <td><a href="#myri">Myrinet</a></td>
-      <td>myri</td>
-      <td></td>
-      <td></td>
-      <td><a href="hwinfo/bSAa.wZUhdK_A1p5">PCI</a></td>
-    </tr>
-    <tr>
-      <td><a href="#qeth">QETH</a></td>
-      <td>qeth</td>
-    </tr>
-    <tr>
-      <td><a href="#tr">Token-Ring</a></td>
-      <td>tr</td>
-      <td></td>
-      <td>ISA</td>
-      <td><a href="hwinfo/H9CO.Oa5XQ+zHPiE">PCI</a></td>
-      <td><a href="">#</a></td>
-      <td><a href="">#</a></td>
-      <td><a href="">#</a></td>
-    </tr>
-    <tr>
-      <td><a href="#wlan">Wireless</a></td>
-      <td>wlan</td>
-      <td></td>
-      <td></td>
-      <td><a href="hwinfo/jqQS.CA1y3f8FAiF">PCI</a></td>
-      <td><a href="">#</a></td>
-      <td><a href="hwinfo/08s.2pQPFZ9qjED">CardBus</a></td>
-      <td><a href="">#</a></td>
-    </tr>
-<!-- ========================================================= -->
-    <tr>
-      <td rowspan=3><a href="#dialup">Dialup</a></td>
-      <td>Modem</td>
-      <td>ppp</td>
-      <td>PTP</td>
-      <td>ISA</td>
-      <td><a href="">#</a></td>
-      <td><a href="hwinfo/i7s0.gdm40Ifamk7">PCMCIA</a></td>
-      <td><a href="">#</a></td>
-      <td><a href="hwinfo/ZLwt.gGqXKNqGK+7">USB</a></td>
-      <td><a href="hwinfo/i7s0.stlz_5b5o73">Serial</a></td>
-    </tr>
-<!-- ========================================================= -->
-    <tr>
-      <td>ISDN Card</td>
-      <td>ippp</td>
-      <td>PTP</td>
-      <td><a href="hwinfo/QQNm.4JPVYg4a1y4">ISA</a></td>
-      <td><a href="hwinfo/gZD2.gV8_U5wZ+LB">PCI</a></td>
-      <td><a href="">#</a></td>
-      <td><a href="">#</a></td>
-      <td><a href="hwinfo/B3Fu.FC71YnSrDeA">USB</a></td>
-      <td></td>
-      <td><a href="hwinfo/WL76.NfNR2ssSbN5">DSL - combo</a></td>
-    </tr>
-<!-- ========================================================= -->
-    <tr>
-      <td>DSL</td>
-      <td>ppp</td>
-      <td>PTP</td>
-      <td></td>
-      <td><a href="hwinfo/WL76.NfNR2ssSbN5">PCI</a></td>
-      <td></td>
-      <td></td>
-      <td><a href="hwinfo/B3Fu.Z4Y2LKD9B2B">USB</a></td>
-      <td></td>
-      <td><a href="hwinfo/Phe5.ndpeucax6V12">PPPOE</a></td>
-    </tr>
-<!-- ========================================================= -->
-    <tr>
-      <td rowspan=3><a href="#tunnel">Tunnel</a></td>
-      <td>6-in-4</td>
-      <td>sit</td>
-      <td>PTP</td>
-    </tr>
-    <tr>
-      <td>GRE</td>
-      <td>gre</td>
-      <td>PTP</td>
-    </tr>
-    <tr>
-      <td>IPIP</td>
-      <td>ipip</td>
-      <td>PTP</td>
-    </tr>
-<!-- ========================================================= -->
-    <tr>
-      <td rowspan=2><a href="#special">Special</a></td>
-      <td>Loopback</td>
-      <td>lo</td>
-    </tr>
-    <tr>
-      <td>VMWare</td>
-      <td>vmnet</td>
-    </tr>
-<!-- ========================================================= -->
-    <tr>
-      <td rowspan=4><a href="#cable">Cable</a></td>
-      <td rowspan=2>Serial Line</td>
-      <td>slip</td>
-    </tr>
-    <tr>
-      <td>ppp</td>
-    </tr>
-    <tr>
-      <td>Parallel Line</td>
-      <td>plip</td>
-    </tr>
-    <tr>
-      <td>USB Network</td>
-      <td>usb?</td>
-    </tr>
-<!-- ========================================================= -->
-    <tr>
-      <td rowspan=7><a href="#wireless">Wireless</a></td>
-      <td rowspan=3>Infra-Red</td>
-      <td>irda</td>
-    </tr>
-    <tr>
-      <td>irlan</td>
-    </tr>
-    <tr>
-      <td>ppp</td>
-    </tr>
-    <tr>
-      <td>Bluetooth</td>
-      <td>bt</td>
-      <td></td>
-      <td></td>
-      <td></td>
-      <td></td>
-      <td></td>
-      <td><a href="hwinfo/B3Fu.FC71YnSrDeA">USB</a></td>
-    </tr>
-<!-- ========================================================= -->
-  </tbody>
-</table>
-
-<!-- ********************************************************* -->
-
-<h3>Notes:</h3>
-<ol>
-<li><b>PTP</b> means a <b>Point-to-Point</b> network link
-<li>Regular <b>ISA</b> cards can't be detected by hwinfo, so there's no way
-    to download the hwinfo log. It's only possible for some ISA PnP cards.
-<li># means missing hwinfo log
-</ol>
-
-<!-- ********************************************************* -->
-
-<h3>Description:</h3>
-
-<ul>
-<li><a name="arc">ARCnet</a>
-/usr/src/linux/Documentation/networking/arcnet.txt
-/usr/src/linux/Documentation/networking/arcnet-hardware.txt
-
-<li><a name="ci">CLAW</a>
-<li><a name="ctc">CTC</a>
-Channel-To-Channel
-
-<li><a name="dummy">dummy</a>
-/usr/src/linux/drivers/net/dummy.c
-
-<li><a name="decnet">DecNet</a>
-/usr/src/linux/Documentation/networking/decnet.txt
-
-<li><a name="escon">Escon</a>
-Enteprise System CONnector (something like a mixture of SCSI and
-Ethernet - its a channel, but can carry network traffic)
-
-<li><a name="eth">Ethernet</a>
-<li><a name="fddi">FDDI</a>
-<li><a name="hsi">HSI</a>
-Hipersockets
-
-<li><a name="iucv">IUCV</a>
-Inter User Communication Vehicle (means: DMA based network pipe
-between Virtual Machine instances (like vmware) on an s390)
-
-<li><a name="myri">Myrinet</a>
-<a href="http://www.myri.com";>http://www.myri.com</a>
-
-<li><a name="plip">PLIP</a>
-Parallel Line IP
-/usr/src/linux/Documentation/networking/PLIP.txt
-
-<li><a name="qeth">QETH</a>
-
-<li><a name="sci">SCI</a>
-<a 
href="http://www.scizzl.com/WhatIsSCI.html";>http://www.scizzl.com/WhatIsSCI.html</a>
-<a 
href="http://www.dolphinics.com/sci/index.html";>http://www.dolphinics.com/sci/index.html</a>
-
-<li><a name="tr">Token-Ring</a>
-<li><a name="wlan">Wireless</a>
-</ul>
-
-<!-- ********************************************************* -->
-
-</body>
-</html>
-<!-- EOF -->
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/doc/hostname.md 
new/yast2-network-4.2.56/doc/hostname.md
--- old/yast2-network-4.2.54/doc/hostname.md    1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-network-4.2.56/doc/hostname.md    2020-02-24 10:19:16.000000000 
+0100
@@ -0,0 +1,57 @@
+## Hostname in Linux ##
+
+We have several hostnames in Linux. Each of them has different usage and 
different place where to set it up. Some of them can be configured by the 
YaST's lan module.
+
+## Local system hostname / static hostname (/etc/hostname) ##
+
+You can put a string into /etc/hostname. This string is than used as so called 
"local system hostname" which is set in the kernel during the boot. In systemd 
it is named "static hostname". This name is used for identification of your 
local system. This name is typically used e.g. in logs where individual log 
entries can be prepended by this name. More importantly this name is not 
directly related to networking, so putting e.g. FQDN (Fully Qualified Domain 
Name) here has no sense.
+
+Current static hostname can be displayed by `hostname` command or in systemd 
world by `hostnamectl --static`
+
+In YaST you can edit this hostname on `Hostname / DNS tab`, `Static Hostname` 
field. Unlike other ways mentioned above, YaST validates your input. FQDN is 
allowed here.
+
+![Hostname/DNS tab](pics/hostname_tab.png?raw=true "Hostname/DNS tab")
+
+## Dynamic system hostname(s) (via DHCP) ##
+
+If you want to set hostname via DHCP you have to configure 
`DHCLIENT_SET_HOSTNAME` option on the client. This option can be configured on 
global level for all interfaces in `/etc/sysconfig/network/dhcp` file - this 
setup is then used as global default for all interfaces without that option 
explicitly configured. You can also configure this option per interface in the 
interface's ifcfg file. It is very easy to put the system into wrong state here 
and you will get unpredictable hostname(s) for your system.
+
+If you want to configure `DHCLIENT_SET_HOSTNAME` option via YaST then go to 
`Hostname / DNS` tab and set desired configuration in "Set Hostname via DHCP" 
combobox. YaST will configure the global option even the local ones according 
to user's setup to guarantee safe configuration.
+
+However, we still talk about naming local system here. This name is also 
called "Transient hostname" in systemd world. You can display it e.g. by 
`hostnamectl --transient`.
+
+## Static network hostname(s) (/etc/hosts) ##
+
+We're getting off the local system here.
+
+In networking world we are used to access remote computers using human 
readable names instead of networking addresses (IPs). E.g. we want to use 
google.com instead of 216.239.36.117 when browsing internet. There are several 
ways how to achieve this. If you don't want to bother with DNS, you can use 
local database in /etc/hosts. This file is used as local database translating 
IP addresses to hostnames - one IP per line.
+
+You can edit this file directly in text editor - you have to take care of 
correct syntax then, or you can use YaST. This setup is per interface. When 
using YaST, you have to open statically configured interface and write desired 
hostname to hostname field beside of static IP configuration fields. YaST also 
automatically proposes reasonable aliases automatically if you put FQDN there. 
For example if you use "sle.suse.de" as hostname, the IP will also be assigned 
with "sle" alias.
+
+![Hostname for interface](pics/hostname_iface.png?raw=true "Hostname for 
interface")
+
+## Installation proposals ##
+
+YaST tries to configure the local system hostname during installation. 
Currently (since SLE 15 SP2) YaST configures target system hostname only if it 
is explicitly set when booting installation with linuxrc's hostname option. In 
all other cases no hostname is proposed and you have to set the hostname later 
when booted into installed system.
+
+## Known issues ##
+
+* When you try to delete hostname you can face following issue with runtime 
hostname.
+
+Empty hostname is treated as invalid by hostname utility and empty 
/etc/hostname is automatically changed to localhost during the boot.
+
+However, `hostname ''` even `hostname -b --file /etc/hostname` do not work 
(for empty /etc/hostname). So, runtime remains untouched (hostname command 
still returns previous hostname).
+
+In opposite `hostnamectl set-hostname ''` works in a sense that it deletes 
/etc/hostname, erases static hostname and sets transient hostname to localhost, 
so hostname cmd then correctly shows localhost as result. However, things like 
bash prompt remains untouched (which is also true when modifying hostname to a 
nonempty string).
+
+As there currently is no difference between deleting `/etc/hostname` and 
erasing it, we decided to keep empty `/etc/hostname` to be consistent with 
state you (can) get right after installation. However, until we switch to 
hostnamectl reboot is required to `hostname` utility accept empty hostname in 
some expected way.
+
+* You can see also /etc/HOSTNAME on your system.
+
+This used to be SUSE specific file with different usage than /etc/hostname. 
However, /etc/HOSTNAME is obsolete and currently is symlinked to /etc/hostname 
and can disappear in the future completely.
+
+## See also ##
+
+* [man 5 hostname](http://man7.org/linux/man-pages/man5/hostname.5.html) - 
/etc/hostname file description
+* [man 1 hostname](http://man7.org/linux/man-pages/man1/hostname.1.html) - 
hostname command description
+* [man hostnamectl](http://man7.org/linux/man-pages/man1/hostnamectl.1.html)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/doc/notes 
new/yast2-network-4.2.56/doc/notes
--- old/yast2-network-4.2.54/doc/notes  2020-02-18 13:02:19.000000000 +0100
+++ new/yast2-network-4.2.56/doc/notes  1970-01-01 01:00:00.000000000 +0100
@@ -1,202 +0,0 @@
-2004-04-13 mvidner
-
-general:
-take care to distinguish devices and interfaces, as zoz says
-having COW, evals are no longer necessary
-
-Modem
------
-
-imports Routing but the only use is Routing::Read
-
-Network
--------
-
-is empty
-
-Detection
----------
-
-What is it good for:
-detects network services settings, either from dhcp or by sniffing
-network traffic
-
-? contents of the result map
-? what if we do not have an eth interface, but a different one? (in
-these days eg wlan)
-
-Firewall
---------
-
-only operates on .sysconfig.personal-firewall.REJECT_ALL_INCOMING_CONNECTIONS
-SuSEfirewall2.rpm
-(what if the rpm is not installed?)
-see also the standalone firewall module, SuSEFirewall2.ycp
-
-why translate ppp to modem?
-
-Host
-----
-
-manages /etc/host.conf (using ag_ini)
-only one name per computer, assigned to all IPs?
-
-? format of the hosts map
-initialized: ensures that Read is executed only once
-bogus route.conf comment
-Update: nontrivial, describe
-
-NetworkConfig
--------------
-
-just holds /etc/sysconfig/network/{config,dhcp} in global variables.
-
-Write: bogus DNS string
-
-NetworkDevices
---------------
-
-Is this module for devices or interfaces? For ifcfg-* there's
-network.scr, for hwcfg-* there's cfg_hardware.scr from yast2.rpm
-Docs: point to the specification of their contents (but maybe not,
-this is quite generic, only the users of this module will do it)
-
-uses include/routines: device_type, device_num, alias_num
-Does it work at all with the new naming scheme???
-
-Name: explain "current device"
-HotplugRegex: "foo|foo-" is superfluous, right? no, these regexes may
-be surrounded by ^$ or ()
-stack, Push, Pop: (not a real stack (yet?)), holds Name, Current,
-operation
-ReadDevices does not exist -> Read
-Read:
-interface files (no backups~) are read and stuffed to Devices["eth",
-"0"]. for alias items, there are submaps Devices["eth", "0",
-"_aliases", "1"]
-Filter[NOT]: in: Device map (but then why need trailing number*?) and
-device type regex (or its abbereviation string, eg "netcard")
-Write: what is in Deleted is no longer in Devices
-GetFreeDevicesOld=GetFreeDevices. why?
-Select: can also get "", sets Name and Current ("fixme ni": bug#?)
-Add, Edit, Delete: just call Select and set operation
-Change2: if check and exists, then error and don't change it
-Delete2: removes from Devices, adds to Deleted
-Commit: called after Add, Edit, Delete, calls Change2, Delete2, clears
-Name, Current, operation
-GetValue: Select, Current
-SetValue: Edit, Curent, Commit
-LocateNOT: correct doc: key != val
-Fastest: just has a priority list of types
-HasAliases: why not a != "" ?
-
-NetworkModules
---------------
-
-structurally similar to NetworkDevices (maybe because we no longer
-have dynamic scoping?)
-generally Devices have been replaced by Modules
-
-Modules: a flat structure
-Filter[NOT]: fixme broken filtering
-AddM, SelectM: work on Alias(MODULE) and Options(MODULE_OPTIONS)
-ChangeM, DeleteM: commits
-ugh, what's the difference from the similar set copied from
-NetworkDevices?
-GetFreeName[s]: ok
-GetFreeModule: unused
-ListM: quite bogus too
-
-lots of duplicated code here :-(
-
-DNS
----
-
-manages resolv.conf and (fq) host name, or sets dhcp to get it
-
-domain: not including host?
-resolv_conf_process: the name of a process that has claimed r_c?
-reslov_conf: bogus routes comment
-Read/Write: includes Host,NetworkConfig::R/W
-.etc.resolv_conf is an alias for .resolver (used in Openteam)
-move ag_resolver here
-Write: DHCLIENT_SET_HOSTNAME: bug#?
-
-Routing
--------
-
-link to docs? man 5 routes
-
-does it work with interface-specific ones? (ifroute-lo...)
-why doesn't medusa have the file?
-
-Routes: data structure? anyagent
-  list< map<string, string> >: destination,gateway,netmask[,device[,extrapara]]
-Forward: .sysconfig.sysctl.IP_FORWARD
-Read: if no routes, sets a default gateway from detection
-Write: why omit rcroute stop/start?
-
-Provider
---------
-
-internet service provider data, grouped by country
-used by modem, isdn, dsl modules
-custom providers .sysconfig.network.providers (country = "_custom"), 
predefined ones
-.providers (package providers.rpm)
-
-Current: structure?
-Type: probably modem|isdn|dsl. probably affects structure of current. docs?
-Read: why String::UnQuote here and not in the other modules?
-Write: unlike other modules, it inserts missing default values
-(shouldn't it be TYPE+SUPPORTED = yes?)
-CloneProvider: used in many places
-FilterProviders: fixme^n, further types: rawip, syncppp (ENCAP)?
-
-Internet
---------
-
-handles internet connection test and you during the installation
-
-Start: use Service::; yuck, undocumented bash_input
-
-Remote
-------
-
-remote administration via VNC
-write only
-
-Proxy
------
-
-configures ftp and http proxies for whatever via sysconfig/suseconfig
-and for you via .curlrc
-
-http,ftp,no: .sysconfig.proxy.$1_PROXY (NO_PROXY?)
-
-Lan
----
-
-"fixme MOD": ???
-name: ???
-unique: is it still necessary with sysfs?
-type, device, alias: ??? describe!
-hotplug: enumeration? still valid? (everything is hotplug now)
-remoteip: when valid?
-wireless options: when valid? where docs?
-nm_name: reverse mapping? why needed?
-Hardware: ReadHardware is in include/hardware
-InstallInf: used for proposal
-Read: ReadStatus does nothing, always returns true
-Import/Export: why not Host?
-
-include/hardware
-----------------
-
-(includes in general)
-what globals does it depend on? eg. SelectHarware must have global
-name, type, hotplug
-
-TODO
-====
-
-read about .probe
Binary files old/yast2-network-4.2.54/doc/pics/hostname_iface.png and 
new/yast2-network-4.2.56/doc/pics/hostname_iface.png differ
Binary files old/yast2-network-4.2.54/doc/pics/hostname_tab.png and 
new/yast2-network-4.2.56/doc/pics/hostname_tab.png differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/package/yast2-network.changes 
new/yast2-network-4.2.56/package/yast2-network.changes
--- old/yast2-network-4.2.54/package/yast2-network.changes      2020-02-18 
13:02:19.000000000 +0100
+++ new/yast2-network-4.2.56/package/yast2-network.changes      2020-02-24 
10:19:16.000000000 +0100
@@ -1,4 +1,23 @@
 -------------------------------------------------------------------
+Fri Feb 21 09:53:25 UTC 2020 - Knut Anderssen <kanders...@suse.com>
+
+- Do not crash when checking if a given 'host' is local or not
+  (bsc#1163305)
+- 4.2.56
+
+-------------------------------------------------------------------
+Wed Feb 19 11:52:25 UTC 2020 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Add a class to represent NTP servers (jsc#SLE-7188).
+- 4.2.55
+
+-------------------------------------------------------------------
+Wed Feb 19 07:34:39 UTC 2020 - Knut Anderssen <kanders...@suse.com>
+
+- Do not crash with an exception when editing the hardware
+  configuration of a new unplugged connection (bsc#1162679)
+
+-------------------------------------------------------------------
 Fri Feb  7 17:31:31 UTC 2020 - Michal Filka <mfi...@suse.com>
 
 - bsc#1162271
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/package/yast2-network.spec 
new/yast2-network-4.2.56/package/yast2-network.spec
--- old/yast2-network-4.2.54/package/yast2-network.spec 2020-02-18 
13:02:19.000000000 +0100
+++ new/yast2-network-4.2.56/package/yast2-network.spec 2020-02-24 
10:19:16.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.2.54
+Version:        4.2.56
 Release:        0
 Summary:        YaST2 - Network Configuration
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.2.54/src/lib/y2network/connection_configs_collection.rb 
new/yast2-network-4.2.56/src/lib/y2network/connection_configs_collection.rb
--- old/yast2-network-4.2.54/src/lib/y2network/connection_configs_collection.rb 
2020-02-18 13:02:19.000000000 +0100
+++ new/yast2-network-4.2.56/src/lib/y2network/connection_configs_collection.rb 
2020-02-24 10:19:16.000000000 +0100
@@ -37,7 +37,7 @@
     alias_method :to_a, :connection_configs
 
     def_delegators :@connection_configs, :each, :find, :push, :<<, :reject!, 
:map, :flat_map,
-      :any?, :size, :first, :empty?
+      :any?, :size, :first, :empty?, :each_with_object
 
     # Constructor
     #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.2.54/src/lib/y2network/interface_config_builder.rb 
new/yast2-network-4.2.56/src/lib/y2network/interface_config_builder.rb
--- old/yast2-network-4.2.54/src/lib/y2network/interface_config_builder.rb      
2020-02-18 13:02:19.000000000 +0100
+++ new/yast2-network-4.2.56/src/lib/y2network/interface_config_builder.rb      
2020-02-24 10:19:16.000000000 +0100
@@ -125,12 +125,16 @@
         end
       end
 
+      yast_config.rename_interface(@old_name, name, renaming_mechanism) if 
renamed_interface?
+      yast_config.add_or_update_connection_config(@connection_config)
+      # Assign the newly added interface in case of a new connection for an
+      # unplugged one (bsc#1162679)
+      self.interface = find_interface unless interface
+
       if interface.respond_to?(:custom_driver)
         interface.custom_driver = driver_auto? ? nil : driver.name
         yast_config.add_or_update_driver(driver) unless driver_auto?
       end
-      yast_config.rename_interface(@old_name, name, renaming_mechanism) if 
renamed_interface?
-      yast_config.add_or_update_connection_config(@connection_config)
 
       nil
     end
@@ -245,7 +249,7 @@
     def driver
       return @driver if @driver
 
-      if @interface.custom_driver
+      if @interface&.custom_driver
         @driver = yast_config.drivers.find { |d| d.name == 
@interface.custom_driver }
       end
       @driver ||= :auto
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/src/lib/y2network/ntp_server.rb 
new/yast2-network-4.2.56/src/lib/y2network/ntp_server.rb
--- old/yast2-network-4.2.54/src/lib/y2network/ntp_server.rb    1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-network-4.2.56/src/lib/y2network/ntp_server.rb    2020-02-24 
10:19:16.000000000 +0100
@@ -0,0 +1,85 @@
+# Copyright (c) [2020] 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 "yast"
+require "yaml"
+
+Yast.import "Product"
+
+module Y2Network
+  # Represents an NTP server
+  #
+  # It includes basic information about NTP servers. It could be extended
+  # in the future as needed.
+  class NtpServer
+    # @return [String] Server's hostname
+    attr_reader :hostname
+    # @return [String,nil] Country code where the server is located
+    attr_reader :country
+    # @return [String,nil] Server's location
+    attr_reader :location
+
+    class << self
+      DEFAULT_SERVERS = 4
+      DEFAULT_SUBDOMAIN = "pool.ntp.org".freeze
+
+      private_constant :DEFAULT_SUBDOMAIN, :DEFAULT_SERVERS
+
+      # Determines the default servers
+      #
+      # The content of this list depends on the base product.
+      #
+      # @param products [Array<Hash>] List of base products
+      # @return [Array<NtpServer>] Default NTP servers
+      def default_servers(products = nil)
+        base_products = products || Yast::Product.FindBaseProducts
+
+        host =
+          if base_products.any? { |p| p["name"] =~ /openSUSE/i }
+            "opensuse"
+          else
+            "suse"
+          end
+
+        (0..DEFAULT_SERVERS - 1).map { |i| 
new("#{i}.#{host}.#{DEFAULT_SUBDOMAIN}") }
+      end
+    end
+
+    # Constructor
+    #
+    # @param hostname [String] Server's hostname
+    # @param country  [String] Country code (e.g., "DE")
+    # @param location [String] Server's location
+    def initialize(hostname, country: nil, location: nil)
+      @hostname = hostname
+      @country = country
+      @location = location
+    end
+
+    # Determines when two servers are the same
+    #
+    # @param other [NtpServer] Object to compare with
+    # @return [Boolean] true if both objects contain the same information; 
false otherwise
+    def ==(other)
+      hostname == other.hostname && country == other.country && location == 
other.location
+    end
+
+    alias_method :eql?, :==
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/src/modules/DNS.rb 
new/yast2-network-4.2.56/src/modules/DNS.rb
--- old/yast2-network-4.2.54/src/modules/DNS.rb 2020-02-18 13:02:19.000000000 
+0100
+++ new/yast2-network-4.2.56/src/modules/DNS.rb 2020-02-24 10:19:16.000000000 
+0100
@@ -80,10 +80,10 @@
       Yast.import "UI"
       textdomain "network"
 
+      Yast.import "Lan"
       Yast.import "Arch"
       Yast.import "Hostname"
       Yast.import "IP"
-      Yast.import "NetworkInterfaces"
       Yast.import "ProductFeatures"
       Yast.import "Progress"
       Yast.import "Service"
@@ -223,16 +223,14 @@
     # NOTE: used in yast2-nis-server, yast2-samba-server, yast2-dhcp-server
     def IsHostLocal(check_host)
       Read()
-      NetworkInterfaces.Read
-      dhcp_data = {}
+      current_dhcp_data = {}
+      connections = Yast::Lan.yast_config.connections
 
-      if Ops.greater_than(
-        Builtins.size(NetworkInterfaces.Locate("BOOTPROTO", "dhcp")),
-        0
-      ) || dhcp_hostname
-        dhcp_data = dhcp_data()
-        Builtins.y2milestone("Got DHCP-configured data: %1", dhcp_data)
+      if connections.any?(:dhcp?) || dhcp_hostname
+        current_dhcp_data = dhcp_data
+        log.info("Got DHCP-configured data: #{current_dhcp_data.inspect}")
       end
+
       # FIXME: May not work properly in following situations:
       #   - multiple addresses per interface
       #     - aliases in /etc/hosts
@@ -241,29 +239,24 @@
       # loopback interface or localhost hostname
       return true if ["127.0.0.1", "::1", "localhost", 
"localhost.localdomain"].include?(check_host)
 
+      ip_addresses = connections.each_with_object([]) do |conn, res|
+        conn.all_ips.each_with_object(res) do |ip, ips|
+          address = ip&.address&.address.to_s
+          ips << address if !address.empty? && !ips.include?(address)
+        end
+      end
+
       # IPv4 address
       if IP.Check4(check_host)
-        if Ops.greater_than(
-          Builtins.size(NetworkInterfaces.Locate("IPADDR", check_host)),
-          0
-        ) ||
-            Ops.get(dhcp_data, "ip", "") == check_host
-          return true
-        end
+        return true if ip_addresses.include?(check_host) || 
current_dhcp_data["ip"] == check_host
       # IPv6 address
       elsif IP.Check6(check_host)
-        Builtins.y2debug(
-          "TODO make it similar to IPv4 after other code adapted to IPv6"
-        )
-      # short hostname
-      elsif Builtins.findfirstof(check_host, ".").nil?
-        if Builtins.tolower(check_host) == Builtins.tolower(@hostname) ||
-            Ops.get(dhcp_data, "hostname_short", "") == check_host
-          return true
-        end
-      elsif Builtins.tolower(check_host) ==
-          Builtins.tolower(Ops.add(Ops.add(@hostname, "."), @domain)) ||
-          Ops.get(dhcp_data, "hostname_fq", "") == check_host
+        log.debug("TODO make it similar to IPv4 after other code adapted to 
IPv6")
+      # short hostname or FQDN
+      elsif check_host.downcase == hostname.to_s.downcase ||
+          current_dhcp_data["hostname_short"] == check_host ||
+          current_dhcp_data["hostname_fq"] == check_host
+
         return true
       end
       false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/test/data/ntp_servers.yml 
new/yast2-network-4.2.56/test/data/ntp_servers.yml
--- old/yast2-network-4.2.54/test/data/ntp_servers.yml  1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-network-4.2.56/test/data/ntp_servers.yml  2020-02-24 
10:19:16.000000000 +0100
@@ -0,0 +1,9 @@
+---
+
+- access_policy: open access
+  address: ntp.cgi.cz
+  country: CZ
+  exact_location: Prague, The Czech Republic
+  location: Czech Republic
+  stratum: '2'
+  synchronization: NTP V4 secondary (stratum 2), PC/FreeBSD
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.2.54/test/dns_test.rb 
new/yast2-network-4.2.56/test/dns_test.rb
--- old/yast2-network-4.2.54/test/dns_test.rb   2020-02-18 13:02:19.000000000 
+0100
+++ new/yast2-network-4.2.56/test/dns_test.rb   2020-02-24 10:19:16.000000000 
+0100
@@ -32,8 +32,12 @@
 Yast.import "Lan"
 
 describe Yast::DNS do
+  let(:logger) { double(info: true, debug: true) }
   let(:lan_config) do
-    Y2Network::Config.new(dns: dns_config, hostname: hostname_config, source: 
:sysconfig)
+    Y2Network::Config.new(
+      dns: dns_config, hostname: hostname_config, source: :sysconfig,
+      connections: connections, interfaces: interfaces
+    )
   end
   let(:dns_config) do
     Y2Network::DNS.new
@@ -42,9 +46,30 @@
     Y2Network::Hostname.new(static: "install", dhcp_hostname: true)
   end
 
+  let(:eth0) { Y2Network::PhysicalInterface.new("eth0") }
+  let(:interfaces) { Y2Network::InterfacesCollection.new([eth0]) }
+
+  let(:eth0_conn) do
+    Y2Network::ConnectionConfig::Ethernet.new.tap do |conn|
+      conn.interface = "eth0"
+      conn.name = "eth0"
+      conn.ip = ip
+    end
+  end
+
+  let(:ip) do
+    Y2Network::ConnectionConfig::IPConfig.new(
+      Y2Network::IPAddress.from_string("192.168.122.33/24"),
+      id: "", broadcast: Y2Network::IPAddress.from_string("192.168.122.255")
+    )
+  end
+
+  let(:connections) { Y2Network::ConnectionConfigsCollection.new([eth0_conn]) }
+
   subject { Yast::DNS }
 
   before do
+    allow(described_class).to receive(:log).and_return(logger)
     allow(Yast::Lan).to receive(:Read)
     allow(Yast::Lan).to receive(:yast_config).and_return(lan_config)
   end
@@ -117,14 +142,12 @@
   end
 
   describe ".IsHostLocal" do
-    let(:ip) { "10.111.66.75" }
+    let(:dhcp_ip) { "10.111.66.75" }
     let(:hostname_short) { "test" }
     let(:hostname_fq) { "test.test.de" }
     let(:output) do
       { "ip" => ip, "hostname_short" => hostname_short, "hostname_fq" => 
hostname_fq }
     end
-    let(:ipv4) { false }
-    let(:ipv6) { false }
     let(:stdout) { double }
 
     before do
@@ -133,10 +156,8 @@
         .with(/eth[0-9]/)
         .and_return(Y2Network::InterfaceType::ETHERNET)
       allow(subject).to receive(:Read)
-      allow(Yast::IP).to receive(:Check4).and_return(ipv4)
-      allow(Yast::IP).to receive(:Check6).and_return(ipv6)
       allow(Yast::Execute).to receive(:stdout).and_return(stdout)
-      allow(stdout).to receive(:on_target!).with("/usr/bin/hostname 
-i").and_return(ip)
+      allow(stdout).to receive(:on_target!).with("/usr/bin/hostname 
-i").and_return(dhcp_ip)
       allow(stdout).to 
receive(:on_target!).with("/usr/bin/hostname").and_return(hostname_short)
       allow(stdout).to receive(:on_target!).with("/usr/bin/hostname 
-f").and_return(hostname_fq)
 
@@ -158,16 +179,28 @@
     end
 
     context "for IPv4" do
-      let(:ipv4) { true }
-
       it "returns true when the ip of local machine is given" do
-        expect(subject.IsHostLocal(ip)).to eq(true)
+        expect(subject.IsHostLocal(dhcp_ip)).to eq(true)
+        expect(subject.IsHostLocal("192.168.122.33")).to eq(true)
       end
 
       it "returns false when the ip of local machine is not given" do
         expect(subject.IsHostLocal("1.2.3.4")).to eq(false)
       end
     end
+
+    context "for IPv6" do
+      let(:ip6) { "2001:db8:1234:ffff:ffff:ffff:ffff:fff1" }
+
+      it "logs that the implementation is still pending" do
+        expect(logger).to receive(:debug).with(/^TODO/)
+        subject.IsHostLocal(ip6)
+      end
+
+      it "returns false" do
+        expect(subject.IsHostLocal(ip6)).to eq(false)
+      end
+    end
   end
 
   describe ".Read" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.2.54/test/y2network/interface_config_builder_test.rb 
new/yast2-network-4.2.56/test/y2network/interface_config_builder_test.rb
--- old/yast2-network-4.2.54/test/y2network/interface_config_builder_test.rb    
2020-02-18 13:02:19.000000000 +0100
+++ new/yast2-network-4.2.56/test/y2network/interface_config_builder_test.rb    
2020-02-24 10:19:16.000000000 +0100
@@ -110,6 +110,19 @@
       subject.save
     end
 
+    context "when the new connection config is for an unplugged interface" do
+      subject(:config_builder) do
+        res = Y2Network::InterfaceConfigBuilder.for("eth")
+        res.name = "eth1"
+        res
+      end
+
+      it "assigns the added interface to the builder" do
+        subject.save
+        expect(subject.interface.name).to eq("eth1")
+      end
+    end
+
     context "when interface was renamed" do
       before do
         subject.rename_interface("eth2")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.2.54/test/y2network/ntp_server_test.rb 
new/yast2-network-4.2.56/test/y2network/ntp_server_test.rb
--- old/yast2-network-4.2.54/test/y2network/ntp_server_test.rb  1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-network-4.2.56/test/y2network/ntp_server_test.rb  2020-02-24 
10:19:16.000000000 +0100
@@ -0,0 +1,114 @@
+# Copyright (c) [2020] 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 "y2network/ntp_server"
+
+describe Y2Network::NtpServer do
+  describe ".default_servers" do
+    before do
+      allow(Yast::Product).to receive(:FindBaseProducts)
+        .and_return(products)
+    end
+
+    context "when running in an openSUSE system" do
+      let(:products) do
+        [{ "name" => "openSUSE" }]
+      end
+
+      it "returns a set of opensuse.pool.ntp.org servers" do
+        domain = "opensuse.pool.ntp.org"
+        expect(described_class.default_servers.map(&:hostname)).to eq(
+          ["0.#{domain}", "1.#{domain}", "2.#{domain}", "3.#{domain}"]
+        )
+      end
+    end
+
+    context "when not running in an openSUSE system" do
+      let(:products) do
+        [{ "name" => "SLES" }]
+      end
+
+      it "returns a set of suse.pool.ntp.org servers" do
+        domain = "suse.pool.ntp.org"
+        expect(described_class.default_servers.map(&:hostname)).to eq(
+          ["0.#{domain}", "1.#{domain}", "2.#{domain}", "3.#{domain}"]
+        )
+      end
+    end
+
+    context "when a list of base product is given" do
+      let(:products) do
+        [{ "name" => "openSUSE" }]
+      end
+
+      it "returns the set of servers for that product" do
+        domain = "opensuse.pool.ntp.org"
+        expect(Yast::Product).to_not receive(:FindBaseProducts)
+        servers = described_class.default_servers(products)
+        expect(servers.map(&:hostname)).to eq(
+          ["0.#{domain}", "1.#{domain}", "2.#{domain}", "3.#{domain}"]
+        )
+      end
+    end
+  end
+
+  describe "#==" do
+    subject { Y2Network::NtpServer.new("suse.pool.ntp.org", country: "DE", 
location: "Germany") }
+
+    let(:other) do
+      Y2Network::NtpServer.new(other_hostname, country: other_country, 
location: other_location)
+    end
+    let(:other_hostname) { subject.hostname }
+    let(:other_country) { subject.country }
+    let(:other_location) { subject.location }
+
+    context "when both objects contain the same information" do
+      it "returns true" do
+        expect(subject).to eq(other)
+      end
+    end
+
+    context "when the hostname is different" do
+      let(:other_hostname) { "opensuse.pool.ntp.org" }
+
+      it "returns false" do
+        expect(subject).to_not eq(other)
+      end
+    end
+
+    context "when the country is different" do
+      let(:other_country) { "ES" }
+
+      it "returns false" do
+        expect(subject).to_not eq(other)
+      end
+    end
+
+    context "when the hostname is different" do
+      let(:other_location) { "Spain" }
+
+      it "returns false" do
+        expect(subject).to_not eq(other)
+      end
+    end
+
+  end
+end


Reply via email to