mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-06 07:33:01 +02:00
This commit greatly simplifies AsciiDoc image references in generated Readme.adoc files. The two focused use-cases that remain after this change are working references in: - Generated output/images/test-report.pdf - Viewing test's Readme.adoc from GitHub Previously we aimed to have working images also when the test's Readme was included in the parent directory's Readme.adoc. This, however, is not supported as of this commit. It seems unlikely also to ever be a supported feature of AsciiDoc on GitHub, for details, see the following issue: <https://github.com/github/markup/issues/1095> Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
86 lines
2.7 KiB
Python
Executable File
86 lines
2.7 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Dual bridges on one device
|
|
|
|
Verify that it is possible to ping through a bridge to another bridge
|
|
via a VETH pair connected to both.
|
|
|
|
....
|
|
PING --> br0 br1 10.0.0.2
|
|
/ \\ /
|
|
PC - target:data veth0a - veth0b
|
|
....
|
|
|
|
"""
|
|
import infamy
|
|
|
|
with infamy.Test() as test:
|
|
with test.step("Set up topology and attach to target DUTs"):
|
|
env = infamy.Env()
|
|
target = env.attach("target", "mgmt")
|
|
|
|
with test.step("Configure two bridges linked and a veth pair"):
|
|
_, tport = env.ltop.xlate("target", "data")
|
|
|
|
target.put_config_dict("ietf-interfaces", {
|
|
"interfaces": {
|
|
"interface": [
|
|
{
|
|
"name": "br0",
|
|
"type": "infix-if-type:bridge",
|
|
"enabled": True,
|
|
},
|
|
{
|
|
"name": "br1",
|
|
"type": "infix-if-type:bridge",
|
|
"enabled": True,
|
|
"ipv4": {
|
|
"address": [
|
|
{
|
|
"ip": "10.0.0.2",
|
|
"prefix-length": 24,
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"name": "veth0a",
|
|
"type": "infix-if-type:veth",
|
|
"enabled": True,
|
|
"infix-interfaces:veth": {
|
|
"peer": "veth0b"
|
|
},
|
|
"infix-interfaces:bridge-port": {
|
|
"bridge": "br0"
|
|
}
|
|
},
|
|
{
|
|
"name": "veth0b",
|
|
"type": "infix-if-type:veth",
|
|
"enabled": True,
|
|
"infix-interfaces:veth": {
|
|
"peer": "veth0a"
|
|
},
|
|
"infix-interfaces:bridge-port": {
|
|
"bridge": "br1"
|
|
}
|
|
},
|
|
{
|
|
"name": tport,
|
|
"enabled": True,
|
|
"infix-interfaces:bridge-port": {
|
|
"bridge": "br0"
|
|
}
|
|
},
|
|
]
|
|
}
|
|
})
|
|
|
|
with test.step("Verify ping from host:data to 10.0.0.2"):
|
|
_, hport = env.ltop.xlate("host", "data")
|
|
|
|
with infamy.IsolatedMacVlan(hport) as ns:
|
|
ns.addip("10.0.0.1")
|
|
ns.must_reach("10.0.0.2")
|
|
|
|
test.succeed()
|