diff --git a/lldpad.spec b/lldpad.spec index 798f078..15c8da8 100644 --- a/lldpad.spec +++ b/lldpad.spec @@ -11,7 +11,7 @@ Name: lldpad Version: 1.1.1 -Release: 1.git%{shortcommit}%{?dist} +Release: 2.git%{shortcommit}%{?dist} Summary: Intel LLDP Agent %forgemeta @@ -92,7 +92,10 @@ rm -f %{buildroot}%{_libdir}/liblldp_clif.la %{_libdir}/liblldp_clif.so %changelog -* Wed Sep 4 Hangbin Liu - 1.1.1-1.gitf1dd9eb +* Wed Sep 4 2024 Hangbin Liu - 1.1.1-2.gitf1dd9eb +- Update gating test + +* Wed Sep 4 2024 Hangbin Liu - 1.1.1-1.gitf1dd9eb - Rebase to 1.1.1 - Fix program segfaults after entering the quit command (RHEL-5814) - Fix setting interface status not survive reboot (RHEL-5824) diff --git a/tests/miscellaneous-tests/lldp.network b/tests/miscellaneous-tests/lldp.network deleted file mode 100644 index 25d3573..0000000 --- a/tests/miscellaneous-tests/lldp.network +++ /dev/null @@ -1,8 +0,0 @@ -[Match] -Name=lldpad - -[Network] -DHCP=no -IPv6AcceptRA=false -LLDP=yes -EmitLLDP=yes diff --git a/tests/miscellaneous-tests/lldpad-test.py b/tests/miscellaneous-tests/lldpad-test.py index b5ee7bf..487dac7 100755 --- a/tests/miscellaneous-tests/lldpad-test.py +++ b/tests/miscellaneous-tests/lldpad-test.py @@ -16,8 +16,6 @@ import unittest import subprocess import signal import shutil -import psutil -from pyroute2 import IPRoute LLDPAD_TCP_DUMP_FILE='/tmp/lldpad-tcp-dump.pcap' @@ -49,26 +47,15 @@ class lldpadUtilities(): def SetupVethInterface(self): """Setup veth interface""" + subprocess.check_output(['ip', 'link', 'add', 'lldpad', 'type', 'veth', 'peer', 'name', 'lldpad-peer']) + subprocess.check_output(['ip', 'link', 'set', 'lldpad', 'address', '02:01:02:03:04:08']) + subprocess.check_output(['ip', 'link', 'set', 'lldpad-peer', 'address', '02:01:02:03:04:09']) + subprocess.check_output(['ip', 'link', 'set', 'lldpad', 'up']) + subprocess.check_output(['ip', 'link', 'set', 'lldpad-peer', 'up']) - ip = IPRoute() + time.sleep(3); - ip.link('add', ifname='lldpad', peer='lldpad-peer', kind='veth') - idx_ladvd= ip.link_lookup(ifname='lldpad')[0] - idx_ladvd_peer = ip.link_lookup(ifname='lldpad-peer')[0] - - ip.link('set', index=idx_ladvd, address='02:01:02:03:04:08') - ip.link('set', index=idx_ladvd_peer, address='02:01:02:03:04:09') - ip.link('set', index=idx_ladvd, state='up') - ip.link('set', index=idx_ladvd_peer, state='up') - - ip.close() - time.sleep(4) - - def TearDownVethInterface(self): - - ip = IPRoute() - ip.link('del', index=ip.link_lookup(ifname='lldpad')[0]) - ip.close() + self.addCleanup(subprocess.call, ['ip', 'link', 'del', 'dev', 'lldpad']) def FindLLDPFieldsinTCPDump(self, **kwargs): """Look attributes in lldpad logs.""" @@ -78,32 +65,6 @@ class lldpadUtilities(): for key in kwargs: self.assertRegex(contents, kwargs[key]) -class lldpadTestsViaNetworkd(unittest.TestCase, lldpadUtilities): - - def setUp(self): - """ Setup """ - self.SetupVethInterface() - self.Startlldpad() - self.ConfigureLldpad() - - def tearDown(self): - self.TearDownVethInterface() - - def test_systemd_networkd_lldp(self): - """ Receive LLDP packets via networkd """ - - subprocess.check_output(['systemctl', 'restart', 'systemd-networkd']) - time.sleep(30) - - output=subprocess.check_output(['networkctl','lldp', 'lldpad']).rstrip().decode('utf-8') - self.assertRegex(output, "lldpad") - self.assertRegex(output, "02:01:02:03:04:09") - - """ Verify LLDP Packets received by lldpad transmitted from networkd """ - output = subprocess.check_output(['lldptool', 'get-tlv', '-n', '-i', 'lldpad-peer']).rstrip().decode('utf-8') - self.assertRegex(output, "Ifname: lldpad") - self.assertRegex(output, "120") - class lldpadTests(unittest.TestCase, lldpadUtilities): def setUp(self): @@ -118,9 +79,6 @@ class lldpadTests(unittest.TestCase, lldpadUtilities): self.StopCaptureLLDPPackets() time.sleep(1) - def tearDown(self): - self.TearDownVethInterface() - def test_lldpad_configured(self): """ Verify lldpad-peer interface configured """ diff --git a/tests/miscellaneous-tests/runtest.sh b/tests/miscellaneous-tests/runtest.sh index 3b558bf..c1a9b05 100755 --- a/tests/miscellaneous-tests/runtest.sh +++ b/tests/miscellaneous-tests/runtest.sh @@ -16,7 +16,6 @@ PACKAGE="lldpad" SERVICE_UNITDIR="/run/systemd/system" -NETWORK_UNITDIR="/run/systemd/network" rlJournalStart rlPhaseStartSetup @@ -24,9 +23,6 @@ rlJournalStart rlRun "systemctl stop firewalld" 0,5 rlRun "setenforce 0" 0,1 - rlRun "mkdir -p $NETWORK_UNITDIR" - rlRun "cp lldp.network $NETWORK_UNITDIR/" - rlRun "cp tcpdumpd.service $SERVICE_UNITDIR" rlRun "systemctl daemon-reload" rlRun "cp lldpad-test.py /usr/bin/" @@ -38,7 +34,7 @@ rlJournalStart rlPhaseEnd rlPhaseStartCleanup - rlRun "rm /usr/bin/lldpad-test.py $NETWORK_UNITDIR/lldp.network $SERVICE_UNITDIR/tcpdumpd.service" + rlRun "rm /usr/bin/lldpad-test.py $SERVICE_UNITDIR/tcpdumpd.service" rlRun "systemctl daemon-reload" rlRun "setenforce 1" 0,1 rlLog "lldpad tests done" diff --git a/tests/tests.yml b/tests/tests.yml index 02a5c4b..57adb50 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -11,4 +11,3 @@ - tcpdump - systemd - iproute - - python3-pyroute2