From 7a73629e08bea3a8383e5f4985aac5db33796857 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 27 May 2016 14:25:45 +0200 Subject: [PATCH] tests: fix SONMP test whose result depends on indexes --- tests/integration/test_protocols.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_protocols.py b/tests/integration/test_protocols.py index 3704573a..487df8c4 100644 --- a/tests/integration/test_protocols.py +++ b/tests/integration/test_protocols.py @@ -79,5 +79,6 @@ def test_sonmp(lldpd, lldpcli, links, namespaces): assert out["lldp.eth0.via"] == "SONMP" assert out["lldp.eth0.chassis.name"] == "192.168.14.2" assert out["lldp.eth0.chassis.descr"] == "unknown (via SONMP)" - assert out["lldp.eth0.port.local"] == "00-00-02" - assert out["lldp.eth0.port.descr"] == "port 2" + port = out["lldp.eth0.port.local"][-1] + assert out["lldp.eth0.port.local"] == "00-00-0{}".format(port) + assert out["lldp.eth0.port.descr"] == "port {}".format(port) -- 2.39.5