test: refactor test environment

This commit is contained in:
Ahmed Karic
2024-09-03 12:13:32 +02:00
committed by Mattias Walström
parent e7c9f59582
commit 46ad19793b
105 changed files with 1285 additions and 107 deletions
+12 -11
View File
@@ -3,30 +3,31 @@
- case: meta/wait.py
- name: Misc tests
suite: misc/all.yaml
suite: misc/misc.yaml
- name: ietf-system
suite: ietf_system/all.yaml
suite: ietf_system/ietf_system.yaml
- name: ietf-syslog
suite: ietf_syslog/all.yaml
suite: ietf_syslog/ietf_syslog.yaml
- name: ietf-interfaces
suite: ietf_interfaces/all.yaml
suite: ietf_interfaces/ietf_interfaces.yaml
- name: infix-interfaces
suite: infix_interfaces/all.yaml
suite: infix_interfaces/infix_interfaces.yaml
- name: ietf-routing
suite: ietf_routing/all.yaml
suite: ietf_routing/ietf_routing.yaml
- name: infix-containers
suite: infix_containers/all.yaml
suite: infix_containers/infix_containers.yaml
- name: infix-dhcp
suite: infix_dhcp/all.yaml
suite: infix_dhcp/infix_dhcp.yaml
- name: ietf-hardware
suite: ietf_hardware/all.yaml
#- name: infix-services
# suite: infix_services/all.yaml
suite: ietf_hardware/ietf_hardware.yaml
- name: infix-services
suite: infix_services/infix_services.yaml
-2
View File
@@ -1,2 +0,0 @@
---
- case: usb.py
@@ -0,0 +1,3 @@
---
- name: usb
case: usb/test.py
@@ -9,7 +9,7 @@ from infamy.util import until,wait_boot
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
available=usb.get_usb_ports(target)
+23
View File
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
-7
View File
@@ -1,7 +0,0 @@
---
- case: vlan_ping.py
- case: ipv4_address.py
- case: ipv6_address.py
- case: iface_phys_address.py
- case: iface_status.py
- case: routing_basic.py
@@ -0,0 +1,18 @@
---
- name: vlan_ping
case: vlan_ping/test.py
- name: ipv4_address
case: ipv4_address/test.py
- name: ipv6_address
case: ipv6_address/test.py
- name: iface_phys_address
case: iface_phys_address/test.py
- name: iface_status
case: iface_status/test.py
- name: routing_basic
case: routing_basic/test.py
@@ -8,7 +8,7 @@ from infamy.util import until
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, tport = env.ltop.xlate("target", "data")
pmac = iface.get_phys_address(target, tport)
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -2,6 +2,7 @@
import infamy
import infamy.iface as iface
import os
def print_err_msg(interface, param, val):
@@ -27,7 +28,7 @@ def asser_iface_exists(target, interface):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
iface.print_all(target)
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
@@ -12,7 +12,7 @@ new_prefix_length = 24
with infamy.Test() as test:
with test.step("Setup"):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, interface_name = env.ltop.xlate("target", "mgmt")
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
@@ -6,7 +6,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initializing ..."):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
tgtssh = env.attach("target", "mgmt", "ssh")
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -50,7 +50,7 @@ def config_target(target, tport0, tport1, enable_fwd):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x3"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, tport0 = env.ltop.xlate("target", "data0")
_, tport1 = env.ltop.xlate("target", "data1")
@@ -0,0 +1,25 @@
graph "1x3" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data0> data0 | <data1> data1 }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data0 -- target:data0
host:data1 -- target:data1
}
@@ -22,7 +22,7 @@ def test_ping(hport, should_pass):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Configure VLAN 10 on target:data with IP 10.0.0.2"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
-5
View File
@@ -1,5 +0,0 @@
---
- case: static_routing.py
- case: ospf_basic.py
- case: ospf_unnumbered_interface.py
- case: ospf_multiarea.py
+12
View File
@@ -0,0 +1,12 @@
---
- name: static_routing
case: static_routing/test.py
- name: ospf_basic
case: ospf_basic/test.py
- name: ospf_unnumbered_interface
case: ospf_unnumbered_interface/test.py
- name: ospf_multiarea
case: ospf_multiarea/test.py
@@ -153,7 +153,7 @@ def config_target2(target, link):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("2x2"))
env = infamy.Env()
target1 = env.attach("target1", "mgmt")
target2 = env.attach("target2", "mgmt")
@@ -0,0 +1,32 @@
graph "2x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data1> data1 | <mgmt2> mgmt2 | <data2> data2 }",
pos="0,12!",
kind="controller",
];
target1 [
label="{ <mgmt> mgmt | <data> data | <target2> target2} | target1",
pos="10,18!",
kind="infix",
];
target2 [
label="{ <target1> target1 |<mgmt> mgmt | <data> data } | target2",
pos="10,6!",
kind="infix",
];
host:mgmt1 -- target1:mgmt [kind=mgmt]
host:mgmt2 -- target2:mgmt [kind=mgmt]
host:data1 -- target1:data
host:data2 -- target2:data
target1:target2 -- target2:target1
}
@@ -424,7 +424,6 @@ def config_target3(target, ring1, ring2, cross, link):
}
})
def config_target4(target, ring1, ring2, cross, link):
target.put_config_dict("ietf-interfaces", {
"interfaces": {
@@ -540,7 +539,7 @@ def disable_link(target, link):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("ring-4-duts"))
env = infamy.Env()
dut1 = env.attach("dut1", "mgmt")
dut2 = env.attach("dut2", "mgmt")
dut3 = env.attach("dut3", "mgmt")
@@ -0,0 +1,59 @@
graph "ring-4-duts" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data1> data1 | <mgmt2> mgmt2 | <data2> data20 | <data2> data2 | <mgmt3> mgmt3 | <data3> data3 | <mgmt4> mgmt4 | <data4> data4 }",
pos="0,15!",
kind="controller",
];
dut1 [
label="{ <mgmt> mgmt | <data> data | <ring1> ring1 } | dut1 | { <ring2> ring2 | <cross> cross }",
pos="10,18!",
kind="infix",
];
dut2 [
label="{ <mgmt> mgmt | <data> data | <ring1> ring1 } | dut2 | { <ring2> ring2 | <cross> cross }",
pos="10,12!",
kind="infix",
];
dut3 [
label="{ <mgmt> mgmt | <data> data | <ring1> ring1 } | dut2 | { <ring2> ring2 | <cross> cross}",
pos="10,12!",
kind="infix",
];
dut4 [
label="{ <mgmt> mgmt | <data> data | <ring1> ring1 } | dut2 | { <ring2> ring2 | <cross> cross }",
pos="10,12!",
kind="infix",
];
host:mgmt1 -- dut1:mgmt [kind=mgmt]
host:mgmt2 -- dut2:mgmt [kind=mgmt]
host:mgmt3 -- dut3:mgmt [kind=mgmt]
host:mgmt4 -- dut4:mgmt [kind=mgmt]
# Host-Dut links
host:data1 -- dut1:data
host:data2 -- dut2:data
host:data3 -- dut3:data
host:data4 -- dut4:data
# Ring
dut1:ring1 -- dut2:ring2
dut2:ring1 -- dut3:ring2
dut3:ring1 -- dut4:ring2
dut4:ring1 -- dut1:ring2
# Cross
dut1:cross -- dut3:cross
dut2:cross -- dut4:cross
}
@@ -157,7 +157,7 @@ def config_target2(target, link):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("2x2"))
env = infamy.Env()
target1 = env.attach("target1", "mgmt")
target2 = env.attach("target2", "mgmt")
@@ -0,0 +1,32 @@
graph "2x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data1> data1 | <mgmt2> mgmt2 | <data2> data2 }",
pos="0,12!",
kind="controller",
];
target1 [
label="{ <mgmt> mgmt | <data> data | <target2> target2} | target1",
pos="10,18!",
kind="infix",
];
target2 [
label="{ <target1> target1 |<mgmt> mgmt | <data> data } | target2",
pos="10,6!",
kind="infix",
];
host:mgmt1 -- target1:mgmt [kind=mgmt]
host:mgmt2 -- target2:mgmt [kind=mgmt]
host:data1 -- target1:data
host:data2 -- target2:data
target1:target2 -- target2:target1
}
@@ -185,7 +185,7 @@ def config_target2(target, link):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("2x2"))
env = infamy.Env()
target1 = env.attach("target1", "mgmt")
target2 = env.attach("target2", "mgmt")
@@ -0,0 +1,32 @@
graph "2x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data1> data1 | <mgmt2> mgmt2 | <data2> data2 }",
pos="0,12!",
kind="controller",
];
target1 [
label="{ <mgmt> mgmt | <data> data | <target2> target2} | target1",
pos="10,18!",
kind="infix",
];
target2 [
label="{ <target1> target1 |<mgmt> mgmt | <data> data } | target2",
pos="10,6!",
kind="infix",
];
host:mgmt1 -- target1:mgmt [kind=mgmt]
host:mgmt2 -- target2:mgmt [kind=mgmt]
host:data1 -- target1:data
host:data2 -- target2:data
target1:target2 -- target2:target1
}
-3
View File
@@ -1,3 +0,0 @@
---
- case: basic.py
- case: remote.py
@@ -9,7 +9,7 @@ import infamy.ssh as ssh
with infamy.Test() as test:
with test.step("Initializing ..."):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
tgtssh = env.attach("target", "mgmt", "ssh")
factory = env.get_password("target")
+23
View File
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
+6
View File
@@ -0,0 +1,6 @@
---
- name: basic
case: basic/test.py
- name: remote
case: remote/test.py
@@ -6,7 +6,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("2x2"))
env = infamy.Env()
client = env.attach("target1", "mgmt")
server = env.attach("target2", "mgmt")
clientssh = env.attach("target1", "mgmt", "ssh")
+32
View File
@@ -0,0 +1,32 @@
graph "2x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data1> data1 | <mgmt2> mgmt2 | <data2> data2 }",
pos="0,12!",
kind="controller",
];
target1 [
label="{ <mgmt> mgmt | <data> data | <target2> target2} | target1",
pos="10,18!",
kind="infix",
];
target2 [
label="{ <target1> target1 |<mgmt> mgmt | <data> data } | target2",
pos="10,6!",
kind="infix",
];
host:mgmt1 -- target1:mgmt [kind=mgmt]
host:mgmt2 -- target2:mgmt [kind=mgmt]
host:data1 -- target1:data
host:data2 -- target2:data
target1:target2 -- target2:target1
}
@@ -19,7 +19,7 @@ def generate_restrictred_credential():
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Add new user"):
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
-6
View File
@@ -1,6 +0,0 @@
---
- case: hostname.py
- case: add_delete_user.py
- case: user_admin.py
- case: timezone.py
- case: timezone_utc_offset.py
@@ -7,7 +7,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
tgtssh = env.attach("target", "mgmt", "ssh")
fmt = "%h-%m"
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
+15
View File
@@ -0,0 +1,15 @@
---
- name: hostname
case: hostname/test.py
- name: add_delete_user
case: add_delete_user/test.py
- name: user_admin
case: user_admin/test.py
- name: timezone
case: timezone/test.py
- name: timezone_utc_offset
case: timezone_utc_offset/test.py
@@ -6,7 +6,7 @@ import infamy
import lxml
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Set timezone"):
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
@@ -5,7 +5,7 @@ import lxml
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Set timezone UTC offset"):
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
@@ -44,7 +44,7 @@ class FileServer(http.server.HTTPServer):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
if not env.args.package:
print("No package supplied")
test.skip()
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
@@ -12,7 +12,7 @@ from passlib.hash import sha256_crypt
with infamy.Test() as test:
with test.step("Initializing ..."):
env = infamy.Env(infamy.std_topology("1x1"))
env = infamy.Env()
target = env.attach("target", "mgmt")
tgtssh = env.attach("target", "mgmt", "ssh")
factory = env.get_password("target")
@@ -0,0 +1,23 @@
graph "1x1" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
}
-6
View File
@@ -1,6 +0,0 @@
---
- case: container_basic.py
- case: container_bridge.py
- case: container_phys.py
- case: container_veth.py
@@ -18,7 +18,7 @@ with infamy.Test() as test:
NAME = "web"
with test.step("Set up topology and attach to target DUT"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
addr = target.get_mgmt_ip()
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -18,7 +18,7 @@ with infamy.Test() as test:
URL = f"http://{DUTIP}:8080/index.html"
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step(f"Create {NAME} container from bundled OCI image"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -16,7 +16,7 @@ with infamy.Test() as test:
URL = f"http://{DUTIP}:91/index.html"
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step(f"Create {NAME} container from bundled OCI image"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -16,7 +16,7 @@ with infamy.Test() as test:
URL = f"http://{DUTIP}:91/index.html"
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step(f"Create {NAME} container from bundled OCI image"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -0,0 +1,13 @@
---
- name: container_basic
case: container_basic/test.py
- name: container_bridge
case: container_bridge/test.py
- name: container_phys
case: container_phys/test.py
- name: container_veth
case: container_veth/test.py
-4
View File
@@ -1,4 +0,0 @@
---
- case: dhcp_basic.py
- case: dhcp_router.py
- case: dhcp_routes.py
@@ -11,7 +11,7 @@ from infamy.util import until
with infamy.Test() as test:
ADDRESS = '10.0.0.42'
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, host = env.ltop.xlate("host", "data")
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -10,7 +10,7 @@ from infamy.util import until
with infamy.Test() as test:
ROUTER = '192.168.0.254'
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, host = env.ltop.xlate("host", "data")
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -11,7 +11,7 @@ with infamy.Test() as test:
PREFIX = '10.0.0.0/24'
ROUTER = '192.168.0.254'
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, host = env.ltop.xlate("host", "data")
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
+9
View File
@@ -0,0 +1,9 @@
---
- name: dhcp_basic
case: dhcp_basic/test.py
- name: dhcp_router
case: dhcp_router/test.py
- name: dhcp_routes
case: dhcp_routes/test.py
-13
View File
@@ -1,13 +0,0 @@
---
- case: bridge_basic.py
- case: bridge_veth.py
- case: dual_bridge.py
- case: bridge_vlan.py
- case: ipv4_autoconf.py
- case: bridge_fwd_sgl_dut.py
- case: bridge_fwd_dual_dut.py
- case: bridge_vlan_separation.py
- case: igmp_basic.py
- case: igmp_vlan.py
- case: static_multicast_filters.py
- case: vlan_qos.py
@@ -9,7 +9,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Configure single bridge with a single physical port, bridge @ IP 10.0.0.2"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -19,7 +19,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("2x4"))
env = infamy.Env()
dut1 = env.attach("dut1", "mgmt")
dut2 = env.attach("dut2", "mgmt")
@@ -0,0 +1,38 @@
graph "2x4" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data10> data10 | <data11> data11 | <mgmt2> mgmt2 | <data20> data20 | <data21> data21 }",
pos="0,15!",
kind="controller",
];
dut1 [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | dut1 | { <data2> data2 }",
pos="10,18!",
kind="infix",
];
dut2 [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | dut2 | { <data2> data2 }",
pos="10,12!",
kind="infix",
];
host:mgmt1 -- dut1:mgmt [kind=mgmt]
host:data10 -- dut1:data0
host:data11 -- dut1:data1
host:mgmt2 -- dut2:mgmt [kind=mgmt]
host:data20 -- dut2:data0
host:data21 -- dut2:data1
dut1:data2 -- dut2:data2
}
@@ -19,7 +19,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x3"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Configure a bridge with dual physical port"):
@@ -0,0 +1,25 @@
graph "1x3" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data0> data0 | <data1> data1 }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data0 -- target:data0
host:data1 -- target:data1
}
@@ -9,7 +9,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Configure bridged eth port and veth pair with IP 10.0.0.2"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -11,7 +11,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("2x2"))
env = infamy.Env()
dut1 = env.attach("target1", "mgmt")
dut2 = env.attach("target2", "mgmt")
@@ -0,0 +1,32 @@
graph "2x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data1> data1 | <mgmt2> mgmt2 | <data2> data2 }",
pos="0,12!",
kind="controller",
];
target1 [
label="{ <mgmt> mgmt | <data> data | <target2> target2} | target1",
pos="10,18!",
kind="infix",
];
target2 [
label="{ <target1> target1 |<mgmt> mgmt | <data> data } | target2",
pos="10,6!",
kind="infix",
];
host:mgmt1 -- target1:mgmt [kind=mgmt]
host:mgmt2 -- target2:mgmt [kind=mgmt]
host:data1 -- target1:data
host:data2 -- target2:data
target1:target2 -- target2:target1
}
@@ -19,7 +19,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("2x4"))
env = infamy.Env()
dut1 = env.attach("dut1", "mgmt")
dut2 = env.attach("dut2", "mgmt")
@@ -0,0 +1,38 @@
graph "2x4" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data10> data10 | <data11> data11 | <mgmt2> mgmt2 | <data20> data20 | <data21> data21 }",
pos="0,15!",
kind="controller",
];
dut1 [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | dut1 | { <data2> data2 }",
pos="10,18!",
kind="infix",
];
dut2 [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | dut2 | { <data2> data2 }",
pos="10,12!",
kind="infix",
];
host:mgmt1 -- dut1:mgmt [kind=mgmt]
host:data10 -- dut1:data0
host:data11 -- dut1:data1
host:mgmt2 -- dut2:mgmt [kind=mgmt]
host:data20 -- dut2:data0
host:data21 -- dut2:data1
dut1:data2 -- dut2:data2
}
@@ -9,7 +9,7 @@ import infamy
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Configure two bridges linked with a veth pair furthest bridge has IP 10.0.0.2"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -22,7 +22,7 @@ import infamy.multicast as mcast
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x4"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, msend = env.ltop.xlate("target", "data0")
_, mreceive = env.ltop.xlate("target", "data1")
@@ -0,0 +1,26 @@
graph "1x4" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data0> data0 | <data1> data1 | <data2> data2 }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 | <data2> data2 } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data0 -- target:data0
host:data1 -- target:data1
host:data2 -- target:data2
}
@@ -30,7 +30,7 @@ from infamy.util import parallel
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("2x4"))
env = infamy.Env()
dut1 = env.attach("dut1", "mgmt")
_, d1send = env.ltop.xlate("dut1", "data0")
_, d1receiver = env.ltop.xlate("dut1", "data1")
@@ -0,0 +1,38 @@
graph "2x4" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <mgmt1> mgmt1 | <data10> data10 | <data11> data11 | <mgmt2> mgmt2 | <data20> data20 | <data21> data21 }",
pos="0,15!",
kind="controller",
];
dut1 [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | dut1 | { <data2> data2 }",
pos="10,18!",
kind="infix",
];
dut2 [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | dut2 | { <data2> data2 }",
pos="10,12!",
kind="infix",
];
host:mgmt1 -- dut1:mgmt [kind=mgmt]
host:data10 -- dut1:data0
host:data11 -- dut1:data1
host:mgmt2 -- dut2:mgmt [kind=mgmt]
host:data20 -- dut2:data0
host:data21 -- dut2:data1
dut1:data2 -- dut2:data2
}
@@ -0,0 +1,36 @@
---
- name: bridge_basic
case: bridge_basic/test.py
- name: bridge_veth
case: bridge_veth/test.py
- name: dual_bridge
case: dual_bridge/test.py
- name: bridge_vlan
case: bridge_vlan/test.py
- name: ipv4_autoconf
case: ipv4_autoconf/test.py
- name: bridge_fwd_sgl_dut
case: bridge_fwd_sgl_dut/test.py
- name: bridge_fwd_dual_dut
case: bridge_fwd_dual_dut/test.py
- name: bridge_vlan_separation
case: bridge_vlan_separation/test.py
- name: igmp_basic
case: igmp_basic/test.py
- name: igmp_vlan
case: igmp_vlan/test.py
- name: static_multicast_filters
case: static_multicast_filters/test.py
- name: vlan_qos
case: vlan_qos/test.py
@@ -20,7 +20,7 @@ def has_linklocal(target, iface):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Configure an interface with IPv4 ZeroConf IP"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
@@ -49,7 +49,7 @@ def set_static_multicast_filter(target, address, port):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x4"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, msend = env.ltop.xlate("target", "data0")
_, mreceive = env.ltop.xlate("target", "data1")
@@ -0,0 +1,26 @@
graph "1x4" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data0> data0 | <data1> data1 | <data2> data2 }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 | <data2> data2 } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data0 -- target:data0
host:data1 -- target:data1
host:data2 -- target:data2
}
@@ -31,7 +31,7 @@ PACKETS = (
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x3"))
env = infamy.Env()
target = env.attach("target", "mgmt")
_, td0 = env.ltop.xlate("target", "data0")
_, td1 = env.ltop.xlate("target", "data1")
@@ -0,0 +1,25 @@
graph "1x3" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data0> data0 | <data1> data1 }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data0> data0 | <data1> data1 } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data0 -- target:data0
host:data1 -- target:data1
}
-3
View File
@@ -1,3 +0,0 @@
---
# Too flaky, disabled for now, needs an LLDP discovery/client function
- case: services_basic.py
@@ -0,0 +1,4 @@
---
- name: services_basic
case: services_basic/test.py
@@ -61,7 +61,7 @@ def verify(enabled, sec):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env(infamy.std_topology("1x2"))
env = infamy.Env()
target = env.attach("target", "mgmt")
with test.step("Set static IPv4 address and disable services"):
@@ -0,0 +1,24 @@
graph "1x2" {
layout="neato";
overlap="false";
esep="+20";
node [shape=record, fontname="monospace"];
edge [color="cornflowerblue", penwidth="2"];
host [
label="host | { <tgt> tgt | <data> | data }",
pos="0,12!",
kind="controller",
];
target [
label="{ <mgmt> mgmt | <data> data } | target",
pos="10,12!",
kind="infix",
];
host:tgt -- target:mgmt [kind=mgmt]
host:data -- target:data
}
+2 -1
View File
@@ -33,7 +33,8 @@ def netconf_syn(neigh):
with infamy.Test() as test:
with test.step("Initialize"):
env = infamy.Env()
# The test is designed to be run on a physical topology.
env = infamy.Env(ltop=False)
ctrl = env.ptop.get_ctrl()
infixen = env.ptop.get_infixen()
-2
View File
@@ -1,2 +0,0 @@
---
- case: operational_all.py
+6
View File
@@ -0,0 +1,6 @@
---
- name: operational_all
case: operational_all/test.py
#- name: start_from_startup
# case: start_from_startup.py

Some files were not shown because too many files have changed in this diff Show More