gating: update gating test
As per RHBZ#1650342, systemd-networkd is not supported. So remove networkd testing. Also remove pyroute2 requirement Resolves: RHEL-5814 Signed-off-by: Hangbin Liu <haliu@redhat.com>
This commit is contained in:
parent
f263980d98
commit
3240d46c24
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
Name: lldpad
|
Name: lldpad
|
||||||
Version: 1.1.1
|
Version: 1.1.1
|
||||||
Release: 1.git%{shortcommit}%{?dist}
|
Release: 2.git%{shortcommit}%{?dist}
|
||||||
Summary: Intel LLDP Agent
|
Summary: Intel LLDP Agent
|
||||||
%forgemeta
|
%forgemeta
|
||||||
|
|
||||||
@ -92,7 +92,10 @@ rm -f %{buildroot}%{_libdir}/liblldp_clif.la
|
|||||||
%{_libdir}/liblldp_clif.so
|
%{_libdir}/liblldp_clif.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Wed Sep 4 Hangbin Liu <haliu@redhat.com> - 1.1.1-1.gitf1dd9eb
|
* Wed Sep 4 2024 Hangbin Liu <haliu@redhat.com> - 1.1.1-2.gitf1dd9eb
|
||||||
|
- Update gating test
|
||||||
|
|
||||||
|
* Wed Sep 4 2024 Hangbin Liu <haliu@redhat.com> - 1.1.1-1.gitf1dd9eb
|
||||||
- Rebase to 1.1.1
|
- Rebase to 1.1.1
|
||||||
- Fix program segfaults after entering the quit command (RHEL-5814)
|
- Fix program segfaults after entering the quit command (RHEL-5814)
|
||||||
- Fix setting interface status not survive reboot (RHEL-5824)
|
- Fix setting interface status not survive reboot (RHEL-5824)
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
[Match]
|
|
||||||
Name=lldpad
|
|
||||||
|
|
||||||
[Network]
|
|
||||||
DHCP=no
|
|
||||||
IPv6AcceptRA=false
|
|
||||||
LLDP=yes
|
|
||||||
EmitLLDP=yes
|
|
@ -16,8 +16,6 @@ import unittest
|
|||||||
import subprocess
|
import subprocess
|
||||||
import signal
|
import signal
|
||||||
import shutil
|
import shutil
|
||||||
import psutil
|
|
||||||
from pyroute2 import IPRoute
|
|
||||||
|
|
||||||
LLDPAD_TCP_DUMP_FILE='/tmp/lldpad-tcp-dump.pcap'
|
LLDPAD_TCP_DUMP_FILE='/tmp/lldpad-tcp-dump.pcap'
|
||||||
|
|
||||||
@ -49,26 +47,15 @@ class lldpadUtilities():
|
|||||||
|
|
||||||
def SetupVethInterface(self):
|
def SetupVethInterface(self):
|
||||||
"""Setup veth interface"""
|
"""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')
|
self.addCleanup(subprocess.call, ['ip', 'link', 'del', 'dev', 'lldpad'])
|
||||||
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()
|
|
||||||
|
|
||||||
def FindLLDPFieldsinTCPDump(self, **kwargs):
|
def FindLLDPFieldsinTCPDump(self, **kwargs):
|
||||||
"""Look attributes in lldpad logs."""
|
"""Look attributes in lldpad logs."""
|
||||||
@ -78,32 +65,6 @@ class lldpadUtilities():
|
|||||||
for key in kwargs:
|
for key in kwargs:
|
||||||
self.assertRegex(contents, kwargs[key])
|
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):
|
class lldpadTests(unittest.TestCase, lldpadUtilities):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@ -118,9 +79,6 @@ class lldpadTests(unittest.TestCase, lldpadUtilities):
|
|||||||
self.StopCaptureLLDPPackets()
|
self.StopCaptureLLDPPackets()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
self.TearDownVethInterface()
|
|
||||||
|
|
||||||
def test_lldpad_configured(self):
|
def test_lldpad_configured(self):
|
||||||
""" Verify lldpad-peer interface configured """
|
""" Verify lldpad-peer interface configured """
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
PACKAGE="lldpad"
|
PACKAGE="lldpad"
|
||||||
|
|
||||||
SERVICE_UNITDIR="/run/systemd/system"
|
SERVICE_UNITDIR="/run/systemd/system"
|
||||||
NETWORK_UNITDIR="/run/systemd/network"
|
|
||||||
|
|
||||||
rlJournalStart
|
rlJournalStart
|
||||||
rlPhaseStartSetup
|
rlPhaseStartSetup
|
||||||
@ -24,9 +23,6 @@ rlJournalStart
|
|||||||
rlRun "systemctl stop firewalld" 0,5
|
rlRun "systemctl stop firewalld" 0,5
|
||||||
rlRun "setenforce 0" 0,1
|
rlRun "setenforce 0" 0,1
|
||||||
|
|
||||||
rlRun "mkdir -p $NETWORK_UNITDIR"
|
|
||||||
rlRun "cp lldp.network $NETWORK_UNITDIR/"
|
|
||||||
|
|
||||||
rlRun "cp tcpdumpd.service $SERVICE_UNITDIR"
|
rlRun "cp tcpdumpd.service $SERVICE_UNITDIR"
|
||||||
rlRun "systemctl daemon-reload"
|
rlRun "systemctl daemon-reload"
|
||||||
rlRun "cp lldpad-test.py /usr/bin/"
|
rlRun "cp lldpad-test.py /usr/bin/"
|
||||||
@ -38,7 +34,7 @@ rlJournalStart
|
|||||||
rlPhaseEnd
|
rlPhaseEnd
|
||||||
|
|
||||||
rlPhaseStartCleanup
|
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 "systemctl daemon-reload"
|
||||||
rlRun "setenforce 1" 0,1
|
rlRun "setenforce 1" 0,1
|
||||||
rlLog "lldpad tests done"
|
rlLog "lldpad tests done"
|
||||||
|
@ -11,4 +11,3 @@
|
|||||||
- tcpdump
|
- tcpdump
|
||||||
- systemd
|
- systemd
|
||||||
- iproute
|
- iproute
|
||||||
- python3-pyroute2
|
|
||||||
|
Loading…
Reference in New Issue
Block a user