.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
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 == {}
+
+
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