diff --git a/lldpad.spec b/lldpad.spec index ab684d1..b5ad169 100644 --- a/lldpad.spec +++ b/lldpad.spec @@ -7,7 +7,7 @@ Name: lldpad Version: 1.1.0 -Release: 12.git%{checkout}%{?dist} +Release: 13.git%{checkout}%{?dist} Summary: Intel LLDP Agent License: GPLv2 URL: http://open-lldp.org/ @@ -83,6 +83,9 @@ rm -f %{buildroot}%{_libdir}/liblldp_clif.la %{_libdir}/liblldp_clif.so %changelog +* Tue Jul 30 2024 Hangbin Liu - 1.1.0-13.git85e5583 +- Remove pyroute2 + * Tue Jul 30 2024 Hangbin Liu - 1.1.0-12.git85e5583 - Remove networkd tests from gating test diff --git a/tests/miscellaneous-tests/lldpad-test.py b/tests/miscellaneous-tests/lldpad-test.py index eb692b8..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.""" @@ -92,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/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