Skip to content

Commit

Permalink
test: new test, verify ifAlias
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Oct 28, 2024
1 parent 0284e2c commit 967bfc1
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/case/ietf_interfaces/Readme.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ include::ipv6_address/Readme.adoc[]

include::ipv4_autoconf/Readme.adoc[]

include::ifalias/Readme.adoc[]

include::iface_phys_address/Readme.adoc[]

include::routing_basic/Readme.adoc[]
Expand Down
3 changes: 3 additions & 0 deletions test/case/ietf_interfaces/ietf_interfaces.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- name: ipv6_address
case: ipv6_address/test.py

- name: ifalias
case: ifalias/test.py

- name: iface_phys_address
case: iface_phys_address/test.py

Expand Down
25 changes: 25 additions & 0 deletions test/case/ietf_interfaces/ifalias/Readme.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
=== Interface Description (ifAlias)
==== Description
Verify interface description (ifAlias) can be set on an interface and
then be read back from the operational datastore.

==== Topology
ifdef::topdoc[]
image::../../test/case/ietf_interfaces/ifalias/topology.svg[Interface Description (ifAlias) topology]
endif::topdoc[]
ifndef::topdoc[]
ifdef::testgroup[]
image::ifalias/topology.svg[Interface Description (ifAlias) topology]
endif::testgroup[]
ifndef::testgroup[]
image::topology.svg[Interface Description (ifAlias) topology]
endif::testgroup[]
endif::topdoc[]
==== Test sequence
. Set up topology and attach to target DUT
. Set up interface target:data with description
. Verify description can be read back from operational


<<<

36 changes: 36 additions & 0 deletions test/case/ietf_interfaces/ifalias/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env python3
"""Interface Description (ifAlias)
Verify interface description (ifAlias) can be set on an interface and
then be read back from the operational datastore.
"""
import infamy
import infamy.iface as iface

with infamy.Test() as test:
with test.step("Set up topology and attach to target DUT"):
env = infamy.Env()
target = env.attach("target", "mgmt")
DESC = "Kilroy was here"

with test.step("Set up interface target:data with description"):
_, tport = env.ltop.xlate("target", "data")

target.put_config_dict("ietf-interfaces", {
"interfaces": {
"interface": [
{
"name": tport,
"description": DESC,
"enabled": True,
}
]
}
})

with test.step("Verify description can be read back from operational"):
text = iface.get_param(target, tport, "description")
if text != DESC:
test.fail()

test.succeed()
1 change: 1 addition & 0 deletions test/case/ietf_interfaces/ifalias/topology.dot
42 changes: 42 additions & 0 deletions test/case/ietf_interfaces/ifalias/topology.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 967bfc1

Please sign in to comment.