]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
tests: add a test for "configure system interface description"
authorVincent Bernat <vincent@bernat.ch>
Sat, 30 Jan 2021 15:35:07 +0000 (16:35 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sat, 30 Jan 2021 15:35:07 +0000 (16:35 +0100)
tests/integration/test_interfaces.py

index bb71458c2cd4c2e9c9c324a07dea48753a9b1a6a..dbef45436c4f18bc4e903d9f0ef6103db5f1f3e9 100644 (file)
@@ -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"