mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
test: simplify interfaces/veth_delete
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -23,8 +23,7 @@ image::topology.svg[Verify that VETH Pairs Can Be Deleted topology, align=center
|
||||
. Verify interfaces 'veth0a' and 'veth0b' exist
|
||||
. Set IP address on target:data1 (dummy op)
|
||||
. Set IP address on target:data2 (dummy op)
|
||||
. Reset configuration
|
||||
. Verify target:data1 and target:data2 still exist
|
||||
. Verify VETH pair have been removed
|
||||
. Delete VETH pair
|
||||
. Verify VETH pair has been removed
|
||||
|
||||
|
||||
|
||||
@@ -86,23 +86,15 @@ with infamy.Test() as test:
|
||||
}
|
||||
}})
|
||||
|
||||
# TODO: need target.del_config_dict() or similar for VETH _pairs_,
|
||||
# because both interfaces must be removed at the same time.
|
||||
# with test.step("Delete VETH pair"):
|
||||
# xpath = f"/ietf-interfaces:interfaces/interface[name='{veth0a}']"
|
||||
# target.delete_xpath(xpath)
|
||||
# XXX: temporary workaround
|
||||
with test.step("Reset configuration"):
|
||||
# Calls target.test_reset() to apply safe-config
|
||||
target = env.attach("target", "mgmt")
|
||||
with test.step("Delete VETH pair"):
|
||||
# Both ends are mutually mandatory leafrefs, so they must be
|
||||
# removed in a single transaction.
|
||||
target.delete_xpaths([
|
||||
f"/ietf-interfaces:interfaces/interface[name='{veth0a}']",
|
||||
f"/ietf-interfaces:interfaces/interface[name='{veth0b}']",
|
||||
])
|
||||
|
||||
with test.step("Verify target:data1 and target:data2 still exist"):
|
||||
assert iface.exist(target, data1), \
|
||||
f"Interface {data1} missing!"
|
||||
assert iface.exist(target, data2), \
|
||||
f"Interface {data2} missing!"
|
||||
|
||||
with test.step("Verify VETH pair have been removed"):
|
||||
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), \
|
||||
|
||||
Reference in New Issue
Block a user