From: Vincent Bernat Date: Sat, 30 Jan 2021 15:35:07 +0000 (+0100) Subject: tests: add a test for "configure system interface description" X-Git-Tag: 1.0.9~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7656adf5f6d655e82caa9ecd4a7d954b76543bd0;p=thirdparty%2Flldpd.git tests: add a test for "configure system interface description" --- diff --git a/tests/integration/test_interfaces.py b/tests/integration/test_interfaces.py index bb71458c..dbef4543 100644 --- a/tests/integration/test_interfaces.py +++ b/tests/integration/test_interfaces.py @@ -342,3 +342,18 @@ def test_new_interface(lldpd1, lldpd, lldpcli, namespaces, links): assert out['lldp.eth0.port.descr'] == 'eth1' assert out['lldp.eth2.port.descr'] == 'eth3' assert out['lldp.eth0.rid'] == out['lldp.eth2.rid'] # Same chassis + + +def test_set_interface_description(lldpd, lldpcli, namespaces, links): + links(namespaces(1), namespaces(2)) + with namespaces(1): + lldpd() + result = lldpcli("configure", "system", "interface", "description") + assert result.returncode == 0 + with namespaces(2): + lldpd() + time.sleep(1) + with namespaces(1): + # Alias should be set + alias = open("/sys/class/net/eth0/ifalias").read().strip() + assert alias == "lldpd: connected to ns-2.example.com"