Remove networkd gating test
Resolves: RHEL-25990 Signed-off-by: Hangbin Liu <haliu@redhat.com>
This commit is contained in:
parent
e2a31c5850
commit
ddc0345060
@ -10,7 +10,7 @@
|
||||
|
||||
Name: lldpd
|
||||
Version: 1.0.18
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
Summary: ISC-licensed implementation of LLDP
|
||||
|
||||
License: ISC
|
||||
@ -175,6 +175,9 @@ fi
|
||||
|
||||
|
||||
%changelog
|
||||
* Sun Feb 18 2024 Hangbin Liu <haliu@redhat.com> - 1.0.18-2
|
||||
- Remove networkd gating test [RHEL-25990]
|
||||
|
||||
* Wed Jan 31 2024 Hangbin Liu <haliu@redhat.com> - 1.0.18-1
|
||||
- Rebased to 1.0.18 [RHEL-2211]
|
||||
|
||||
|
@ -91,14 +91,6 @@ WantedBy=multi-user.target
|
||||
unit.write(contents)
|
||||
self.addCleanup(os.remove, unit_path)
|
||||
|
||||
def WriteNetworkFile(self, unit_name, contents):
|
||||
"""Write a networkd unit file, and queue it to be removed."""
|
||||
unit_path = os.path.join(NETWORK_UNITDIR, unit_name)
|
||||
|
||||
with open(unit_path, 'w') as unit:
|
||||
unit.write(contents)
|
||||
self.addCleanup(os.remove, unit_path)
|
||||
|
||||
def FindProtocolFieldsinTCPDump(self, **kwargs):
|
||||
"""Look attributes in lldpd logs."""
|
||||
|
||||
@ -107,70 +99,6 @@ WantedBy=multi-user.target
|
||||
for key in kwargs:
|
||||
self.assertRegex(contents, kwargs[key])
|
||||
|
||||
class lldpdTestsViaNetworkd(unittest.TestCase, lldpdUtilities):
|
||||
|
||||
def setUp(self):
|
||||
|
||||
""" Setup veth interface """
|
||||
self.WriteNetworkFile('lldpd-veth.netdev', '''\
|
||||
[NetDev]
|
||||
Name=lldpd
|
||||
Kind=veth
|
||||
MACAddress=12:34:56:78:9a:bc
|
||||
|
||||
[Peer]
|
||||
Name=lldpd-peer
|
||||
MACAddress=12:34:56:78:9a:bd
|
||||
''')
|
||||
|
||||
""" Receive LLDP packets via networkd """
|
||||
self.WriteNetworkFile('lldp.network', '''\
|
||||
[Match]
|
||||
Name=lldpd
|
||||
|
||||
[Network]
|
||||
DHCP=no
|
||||
IPv6AcceptRA=false
|
||||
LLDP=yes
|
||||
EmitLLDP=yes
|
||||
''')
|
||||
""" Receive LLDP packets via networkd """
|
||||
self.WriteNetworkFile('lldp-peer.network', '''\
|
||||
[Match]
|
||||
Name=lldpd-peer
|
||||
''')
|
||||
subprocess.check_output(['systemctl', 'restart', 'systemd-networkd'])
|
||||
time.sleep(5)
|
||||
|
||||
def tearDown(self):
|
||||
self.Stoplldpd()
|
||||
subprocess.check_output(['ip', 'link', 'del', 'lldpd'])
|
||||
|
||||
def test_lldpd_received_lldp_packets_sent_by_systemd_networkd(self):
|
||||
self.Startlldpd()
|
||||
|
||||
time.sleep(10)
|
||||
|
||||
''' Test whether lldpd receved LLDP packets from networkd '''
|
||||
output=subprocess.check_output(['lldpctl']).rstrip().decode('utf-8')
|
||||
self.assertRegex(output, "ifname lldpd")
|
||||
self.assertRegex(output, socket.gethostname())
|
||||
|
||||
def test_systemd_networkd_received_lldp_packets(self):
|
||||
self.Startlldpd()
|
||||
|
||||
time.sleep(10)
|
||||
|
||||
# lldpd 02:01:02:03:04:09 [hostname] 02:01:02:03:04:09 lldpd-peer
|
||||
output=subprocess.check_output(['networkctl', 'lldp', '--no-legend', '--no-pager']).rstrip().decode('utf-8')
|
||||
self.assertRegex(output, "lldpd")
|
||||
self.assertRegex(output, "lldpd-peer")
|
||||
self.assertRegex(output, "12:34:56:78:9a:bd")
|
||||
self.assertRegex(output, socket.gethostname())
|
||||
|
||||
# Port ID and Chasiss id count should be 2
|
||||
self.assertEqual(2, output.count("12:34:56:78:9a:bd"))
|
||||
|
||||
class lldpdTests(unittest.TestCase, lldpdUtilities):
|
||||
|
||||
def setUp(self):
|
||||
|
Loading…
Reference in New Issue
Block a user