From: Vincent Bernat Date: Sat, 30 Jan 2021 15:43:15 +0000 (+0100) Subject: tests: also test if we send interface description if present X-Git-Tag: 1.0.9~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=55029f95f7b8f3220cc910c1a58809e2f0faf88b;p=thirdparty%2Flldpd.git tests: also test if we send interface description if present --- diff --git a/tests/integration/test_interfaces.py b/tests/integration/test_interfaces.py index 5e43752e..04233cf3 100644 --- a/tests/integration/test_interfaces.py +++ b/tests/integration/test_interfaces.py @@ -347,21 +347,27 @@ def test_new_interface(lldpd1, lldpd, lldpcli, namespaces, links): def test_set_interface_description(lldpd, lldpcli, namespaces, links): links(namespaces(1), namespaces(2)) with namespaces(1): + # On namespace 1, put neighbor description in interface description lldpd() result = lldpcli("configure", "system", "interface", "description") assert result.returncode == 0 with namespaces(2): + # On namespace 2, set an interface description + open("/sys/class/net/eth1/ifalias", "w").write("blip blop") 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" - # Alias should not be sent to neighbor + # We should see neighbor interface description + out = lldpcli("-f", "keyvalue", "show", "neighbors", "details") + assert out['lldp.eth0.port.ifname'] == 'eth1' + assert out['lldp.eth0.port.descr'] == 'blip blop' + # Our new alias should not be sent to neighbor lldpcli("update") time.sleep(1) with namespaces(2): out = lldpcli("-f", "keyvalue", "show", "neighbors", "details") - print(out) assert out['lldp.eth1.port.descr'] == 'eth0'