]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
lldpcli: fix manual page for port status
authorVincent Bernat <vincent@bernat.im>
Tue, 14 Jun 2016 09:19:26 +0000 (11:19 +0200)
committerVincent Bernat <vincent@bernat.im>
Tue, 14 Jun 2016 09:19:26 +0000 (11:19 +0200)
Use rx-only, tx-only, rx-and-tx instead of rxOnly, txOnly, rxAndTx. Also
add some tests.

src/client/lldpcli.8.in
tests/integration/test_basic.py
tests/lldpcli.conf

index b06e4b8c4598417f729e19ff5a77c16fe8dad4c1..01a8ab4d20a78a64452fda5a99ef492ae312c02f 100644 (file)
@@ -415,12 +415,12 @@ the default TTL is 120 seconds.
 .Bd -ragged -offset XXXXXX
 Configure the administrative status of the given port. By default, all
 ports are configured to be in
-.Ar rxAndTx
+.Ar rx-and-tx
 mode. This means they can receive and transmit LLDP frames (as well as
 other protocols if needed). In
-.Ar rxOnly
+.Ar rx-only
 mode, they won't emit any frames and in
-.Ar txOnly
+.Ar tx-only
 mode, they won't receive any frames. In
 .Ar disabled
 mode, no frame will be sent and any incoming frame will be
index 61ffaac8efde7301f833a7fdef6ff8c86c5fc620..3d74e98b8ee096cace9de9fd7c2a7ae2d8df2e25 100644 (file)
@@ -162,3 +162,69 @@ def test_portid_subtype_local_with_alias(lldpd1, lldpd, lldpcli, namespaces):
         out = lldpcli("-f", "keyvalue", "show", "neighbors")
         assert out["lldp.eth0.port.local"] == "localname"
         assert out["lldp.eth0.port.descr"] == "alias of eth1"
+
+
+def test_port_status_txonly(lldpd, lldpcli, namespaces, links):
+    links(namespaces(1), namespaces(2))
+    with namespaces(1):
+        lldpd()
+        lldpcli("configure", "lldp", "status", "tx-only")
+    with namespaces(2):
+        lldpd()
+    with namespaces(1):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors")
+        assert out == {}
+        lldpcli("update")
+    with namespaces(2):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors")
+        assert out["lldp.eth1.chassis.mac"] == "00:00:00:00:00:01"
+
+
+def test_port_status_rxonly(lldpd, lldpcli, namespaces, links):
+    links(namespaces(1), namespaces(2))
+    with namespaces(1):
+        lldpd()
+        lldpcli("configure", "lldp", "status", "rx-only")
+    with namespaces(2):
+        lldpd()
+    with namespaces(1):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors")
+        assert out["lldp.eth0.chassis.mac"] == "00:00:00:00:00:02"
+        lldpcli("update")
+    with namespaces(2):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors")
+        assert out == {}
+
+
+def test_port_status_rxandtx(lldpd, lldpcli, namespaces, links):
+    links(namespaces(1), namespaces(2))
+    with namespaces(1):
+        lldpd()
+        lldpcli("configure", "lldp", "status", "rx-and-tx")  # noop
+    with namespaces(2):
+        lldpd()
+    with namespaces(1):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors")
+        assert out["lldp.eth0.chassis.mac"] == "00:00:00:00:00:02"
+        lldpcli("update")
+    with namespaces(2):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors")
+        assert out["lldp.eth1.chassis.mac"] == "00:00:00:00:00:01"
+
+
+def test_port_status_disabled(lldpd, lldpcli, namespaces, links):
+    links(namespaces(1), namespaces(2))
+    with namespaces(1):
+        lldpd()
+        lldpcli("configure", "lldp", "status", "disabled")
+    with namespaces(2):
+        lldpd()
+    with namespaces(1):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors")
+        assert out == {}
+        lldpcli("update")
+    with namespaces(2):
+        out = lldpcli("-f", "keyvalue", "show", "neighbors")
+        assert out == {}
+
+
index 4c04822213288610dc6efede922e8a87e441e842..a74a4575c9bc628fc3ce80a27b339b74dad7bd97 100644 (file)
@@ -29,8 +29,8 @@ configure lldp portidsubtype local Batman
 configure lldp portidsubtype local Batman description Batman
 configure lldp tx-interval 30
 configure lldp tx-hold 4
-configure lldp ports eth0 status txOnly
-configure lldp status rxAndTx
+configure lldp ports eth0 status tx-only
+configure lldp status rx-and-tx
 configure lldp custom-tlv oui 33,44,55 subtype 44
 configure lldp custom-tlv oui 33,44,55 subtype 44 oui-info 45,45,45,45,45
 configure lldp custom-tlv add oui 33,44,55 subtype 44 oui-info 55,55,55,55,55