tests: Adapt to new yangerd

This commit is contained in:
Mattias Walström
2026-06-27 08:41:20 +02:00
parent bf850f59d7
commit e9ff748df9
2 changed files with 12 additions and 12 deletions
@@ -19,10 +19,10 @@ slightly longer than sending the entire configuration at once.
import infamy
import infamy.iface as iface
from infamy.util import until
def verify_interface(target, interface, expected_type):
assert iface.exist(target, interface), f"Interface <{interface}> does not exist."
until(lambda: iface.exist(target, interface))
expected_type = f"infix-if-type:{expected_type}"
actual_type = iface.get_param(target, interface, "type")
+10 -10
View File
@@ -13,7 +13,7 @@ from any other step. This to trigger a new configuration "generation".
import infamy
import infamy.iface as iface
from infamy.util import until
with infamy.Test() as test:
with test.step("Set up topology and attach to target DUT"):
@@ -51,10 +51,8 @@ with infamy.Test() as test:
}})
with test.step("Verify interfaces 'veth0a' and 'veth0b' exist"):
assert iface.exist(target, veth0a), \
f"Interface <{veth0a}> does not exist."
assert iface.exist(target, veth0b), \
f"Interface <{veth0b}> does not exist."
until(lambda: iface.exist(target, veth0a))
until(lambda: iface.exist(target, veth0b))
with test.step("Set IP address on target:data1 (dummy op)"):
target.put_config_dicts({"ietf-interfaces": {
@@ -94,10 +92,12 @@ with infamy.Test() as test:
f"/ietf-interfaces:interfaces/interface[name='{veth0b}']",
])
with test.step("Verify VETH pair has been removed"):
assert not iface.exist(target, veth0a), \
f"Interface <{veth0a}> still exists!"
assert not iface.exist(target, veth0b), \
f"Interface <{veth0b}> still exists!"
with test.step("Verify target:data1 and target:data2 still exist"):
until(lambda: iface.exist(target, data1))
until(lambda: iface.exist(target, data2))
with test.step("Verify VETH pair have been removed"):
until(lambda: not iface.exist(target, veth0a))
until(lambda: not iface.exist(target, veth0b))
test.succeed()