mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 15:33:56 +00:00
topotests: fix 'parse_topology' function in test_isis_topo1_vrf.py
Now the parse_topology function handles well the vertex type identifier. Signed-off-by: Emanuele Altomare <emanuele@common-net.org>
This commit is contained in:
parent
dc66229da8
commit
dbceeaa502
@ -5,73 +5,73 @@
|
|||||||
{
|
{
|
||||||
"vertex": "r1"
|
"vertex": "r1"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r1"
|
"vertex": "r1"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"level-2": {
|
"level-2": {
|
||||||
"ipv4": [
|
"ipv4": [
|
||||||
{
|
{
|
||||||
"vertex": "r1"
|
"vertex": "r1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r1(4)",
|
||||||
"type": "IP",
|
"type": "IP internal",
|
||||||
"vertex": "10.0.20.0/24"
|
"vertex": "10.0.20.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r1-eth0",
|
"interface": "r1-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r3",
|
"next-hop": "r3",
|
||||||
"parent": "r1(4)",
|
"parent": "r1(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3",
|
"interface": "r1-eth0",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r3",
|
||||||
"parent": "r1-eth0",
|
"parent": "r3(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.20.0/24"
|
"vertex": "10.0.20.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3",
|
"interface": "r1-eth0",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r3",
|
||||||
"parent": "r1-eth0",
|
"parent": "r3(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.10.0/24"
|
"vertex": "10.0.10.0/24"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r1"
|
"vertex": "r1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r1(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:1:1::/64"
|
"vertex": "2001:db8:1:1::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r1-eth0",
|
"interface": "r1-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r3",
|
"next-hop": "r3",
|
||||||
"parent": "r1(4)",
|
"parent": "r1(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3",
|
"interface": "r1-eth0",
|
||||||
"metric": "internal",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r3",
|
||||||
"parent": "r1-eth0",
|
"parent": "r3(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:2:1::/64"
|
"vertex": "2001:db8:2:1::/64"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -5,76 +5,76 @@
|
|||||||
{
|
{
|
||||||
"vertex": "r2"
|
"vertex": "r2"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r2"
|
"vertex": "r2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"level-2": {
|
"level-2": {
|
||||||
"ipv4": [
|
"ipv4": [
|
||||||
{
|
{
|
||||||
"vertex": "r2"
|
"vertex": "r2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r2(4)",
|
||||||
"type": "IP",
|
"type": "IP internal",
|
||||||
"vertex": "10.0.21.0/24"
|
"vertex": "10.0.21.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r2-eth0",
|
"interface": "r2-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r4",
|
"next-hop": "r4",
|
||||||
"parent": "r2(4)",
|
"parent": "r2(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r4"
|
"vertex": "r4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4",
|
"interface": "r2-eth0",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r4",
|
||||||
"parent": "r2-eth0",
|
"parent": "r4(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.21.0/24"
|
"vertex": "10.0.21.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4",
|
"interface": "r2-eth0",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r4",
|
||||||
"parent": "r2-eth0",
|
"parent": "r4(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.11.0/24"
|
"vertex": "10.0.11.0/24"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r2"
|
"vertex": "r2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r2(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:1:2::/64"
|
"vertex": "2001:db8:1:2::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r2-eth0",
|
"interface": "r2-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r4",
|
"next-hop": "r4",
|
||||||
"parent": "r2(4)",
|
"parent": "r2(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r4"
|
"vertex": "r4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4",
|
"interface": "r2-eth0",
|
||||||
"metric": "internal",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r4",
|
||||||
"parent": "r2-eth0",
|
"parent": "r4(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:2:2::/64"
|
"vertex": "2001:db8:2:2::/64"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,126 +4,126 @@
|
|||||||
"ipv4": [
|
"ipv4": [
|
||||||
{
|
{
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r3(4)",
|
||||||
"type": "IP",
|
"type": "IP internal",
|
||||||
"vertex": "10.0.10.0/24"
|
"vertex": "10.0.10.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3-eth1",
|
"interface": "r3-eth1",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r5",
|
"next-hop": "r5",
|
||||||
"parent": "r3(4)",
|
"parent": "r3(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r5"
|
"vertex": "r5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r3-eth1",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r5",
|
||||||
"parent": "r3-eth1",
|
"parent": "r5(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.10.0/24"
|
"vertex": "10.0.10.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r3-eth1",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r5",
|
||||||
"parent": "r3-eth1",
|
"parent": "r5(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.11.0/24"
|
"vertex": "10.0.11.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r3-eth1",
|
||||||
"metric": "TE",
|
"metric": "30",
|
||||||
"next-hop": "30",
|
"next-hop": "r5",
|
||||||
"parent": "r3-eth1",
|
"parent": "r4(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.21.0/24"
|
"vertex": "10.0.21.0/24"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r3(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:2:1::/64"
|
"vertex": "2001:db8:2:1::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3-eth1",
|
"interface": "r3-eth1",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r5",
|
"next-hop": "r5",
|
||||||
"parent": "r3(4)",
|
"parent": "r3(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r5"
|
"vertex": "r5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r3-eth1",
|
||||||
"metric": "internal",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r5",
|
||||||
"parent": "r3-eth1",
|
"parent": "r5(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:2:2::/64"
|
"vertex": "2001:db8:2:2::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r3-eth1",
|
||||||
"metric": "internal",
|
"metric": "30",
|
||||||
"next-hop": "30",
|
"next-hop": "r5",
|
||||||
"parent": "r3-eth1",
|
"parent": "r4(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:1:2::/64"
|
"vertex": "2001:db8:1:2::/64"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"level-2": {
|
"level-2": {
|
||||||
"ipv4": [
|
"ipv4": [
|
||||||
{
|
{
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r3(4)",
|
||||||
"type": "IP",
|
"type": "IP internal",
|
||||||
"vertex": "10.0.20.0/24"
|
"vertex": "10.0.20.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3-eth0",
|
"interface": "r3-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r3",
|
"next-hop": "r3",
|
||||||
"parent": "r3(4)",
|
"parent": "r3(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3",
|
"interface": "r3-eth0",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r3",
|
||||||
"parent": "r3-eth0",
|
"parent": "r3(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.20.0/24"
|
"vertex": "10.0.20.0/24"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r3(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:1:1::/64"
|
"vertex": "2001:db8:1:1::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3-eth0",
|
"interface": "r3-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r3",
|
"next-hop": "r3",
|
||||||
"parent": "r3(4)",
|
"parent": "r3(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -4,126 +4,126 @@
|
|||||||
"ipv4": [
|
"ipv4": [
|
||||||
{
|
{
|
||||||
"vertex": "r4"
|
"vertex": "r4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r4(4)",
|
||||||
"type": "IP",
|
"type": "IP internal",
|
||||||
"vertex": "10.0.11.0/24"
|
"vertex": "10.0.11.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4-eth1",
|
"interface": "r4-eth1",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r5",
|
"next-hop": "r5",
|
||||||
"parent": "r4(4)",
|
"parent": "r4(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r5"
|
"vertex": "r5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r4-eth1",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r5",
|
||||||
"parent": "r4-eth1",
|
"parent": "r5(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.10.0/24"
|
"vertex": "10.0.10.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r4-eth1",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r5",
|
||||||
"parent": "r4-eth1",
|
"parent": "r5(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.11.0/24"
|
"vertex": "10.0.11.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r4-eth1",
|
||||||
"metric": "TE",
|
"metric": "30",
|
||||||
"next-hop": "30",
|
"next-hop": "r5",
|
||||||
"parent": "r4-eth1",
|
"parent": "r3(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.20.0/24"
|
"vertex": "10.0.20.0/24"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r4"
|
"vertex": "r4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r4(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:2:2::/64"
|
"vertex": "2001:db8:2:2::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4-eth1",
|
"interface": "r4-eth1",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r5",
|
"next-hop": "r5",
|
||||||
"parent": "r4(4)",
|
"parent": "r4(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r5"
|
"vertex": "r5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r4-eth1",
|
||||||
"metric": "internal",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r5",
|
||||||
"parent": "r4-eth1",
|
"parent": "r5(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:2:1::/64"
|
"vertex": "2001:db8:2:1::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5",
|
"interface": "r4-eth1",
|
||||||
"metric": "internal",
|
"metric": "30",
|
||||||
"next-hop": "30",
|
"next-hop": "r5",
|
||||||
"parent": "r4-eth1",
|
"parent": "r3(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:1:1::/64"
|
"vertex": "2001:db8:1:1::/64"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"level-2": {
|
"level-2": {
|
||||||
"ipv4": [
|
"ipv4": [
|
||||||
{
|
{
|
||||||
"vertex": "r4"
|
"vertex": "r4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r4(4)",
|
||||||
"type": "IP",
|
"type": "IP internal",
|
||||||
"vertex": "10.0.21.0/24"
|
"vertex": "10.0.21.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4-eth0",
|
"interface": "r4-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r2",
|
"next-hop": "r2",
|
||||||
"parent": "r4(4)",
|
"parent": "r4(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r2"
|
"vertex": "r2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r2",
|
"interface": "r4-eth0",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r2",
|
||||||
"parent": "r4-eth0",
|
"parent": "r2(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.21.0/24"
|
"vertex": "10.0.21.0/24"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r4"
|
"vertex": "r4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r4(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:1:2::/64"
|
"vertex": "2001:db8:1:2::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4-eth0",
|
"interface": "r4-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r2",
|
"next-hop": "r2",
|
||||||
"parent": "r4(4)",
|
"parent": "r4(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r2"
|
"vertex": "r2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -4,121 +4,121 @@
|
|||||||
"ipv4": [
|
"ipv4": [
|
||||||
{
|
{
|
||||||
"vertex": "r5"
|
"vertex": "r5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r5(4)",
|
||||||
"type": "IP",
|
"type": "IP internal",
|
||||||
"vertex": "10.0.10.0/24"
|
"vertex": "10.0.10.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r5(4)",
|
||||||
"type": "IP",
|
"type": "IP internal",
|
||||||
"vertex": "10.0.11.0/24"
|
"vertex": "10.0.11.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5-eth0",
|
"interface": "r5-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r3",
|
"next-hop": "r3",
|
||||||
"parent": "r5(4)",
|
"parent": "r5(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5-eth1",
|
"interface": "r5-eth1",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r4",
|
"next-hop": "r4",
|
||||||
"parent": "r5(4)",
|
"parent": "r5(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r4"
|
"vertex": "r4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3",
|
"interface": "r5-eth0",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r3",
|
||||||
"parent": "r5-eth0",
|
"parent": "r3(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.20.0/24"
|
"vertex": "10.0.20.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3",
|
"interface": "r5-eth0",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r3",
|
||||||
"parent": "r5-eth0",
|
"parent": "r3(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.10.0/24"
|
"vertex": "10.0.10.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4",
|
"interface": "r5-eth1",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r4",
|
||||||
"parent": "r5-eth1",
|
"parent": "r4(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.21.0/24"
|
"vertex": "10.0.21.0/24"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4",
|
"interface": "r5-eth1",
|
||||||
"metric": "TE",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r4",
|
||||||
"parent": "r5-eth1",
|
"parent": "r4(4)",
|
||||||
"type": "IP",
|
"type": "IP TE",
|
||||||
"vertex": "10.0.11.0/24"
|
"vertex": "10.0.11.0/24"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ipv6": [
|
"ipv6": [
|
||||||
{
|
{
|
||||||
"vertex": "r5"
|
"vertex": "r5"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r5(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:2:1::/64"
|
"vertex": "2001:db8:2:1::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"metric": "internal",
|
"metric": "0",
|
||||||
"parent": "0",
|
"parent": "r5(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:2:2::/64"
|
"vertex": "2001:db8:2:2::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5-eth0",
|
"interface": "r5-eth0",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r3",
|
"next-hop": "r3",
|
||||||
"parent": "r5(4)",
|
"parent": "r5(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r3"
|
"vertex": "r3"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r5-eth1",
|
"interface": "r5-eth1",
|
||||||
"metric": "10",
|
"metric": "10",
|
||||||
"next-hop": "r4",
|
"next-hop": "r4",
|
||||||
"parent": "r5(4)",
|
"parent": "r5(4)",
|
||||||
"type": "TE-IS",
|
"type": "TE-IS",
|
||||||
"vertex": "r4"
|
"vertex": "r4"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r3",
|
"interface": "r5-eth0",
|
||||||
"metric": "internal",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r3",
|
||||||
"parent": "r5-eth0",
|
"parent": "r3(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:1:1::/64"
|
"vertex": "2001:db8:1:1::/64"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"interface": "r4",
|
"interface": "r5-eth1",
|
||||||
"metric": "internal",
|
"metric": "20",
|
||||||
"next-hop": "20",
|
"next-hop": "r4",
|
||||||
"parent": "r5-eth1",
|
"parent": "r4(4)",
|
||||||
"type": "IP6",
|
"type": "IP6 internal",
|
||||||
"vertex": "2001:db8:1:2::/64"
|
"vertex": "2001:db8:1:2::/64"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"level-2": {
|
"level-2": {
|
||||||
"ipv4": [],
|
"ipv4": [],
|
||||||
"ipv6": []
|
"ipv6": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,19 @@ from mininet.topo import Topo
|
|||||||
|
|
||||||
pytestmark = [pytest.mark.isisd]
|
pytestmark = [pytest.mark.isisd]
|
||||||
|
|
||||||
|
VERTEX_TYPE_LIST = [
|
||||||
|
"pseudo_IS",
|
||||||
|
"pseudo_TE-IS",
|
||||||
|
"IS",
|
||||||
|
"TE-IS",
|
||||||
|
"ES",
|
||||||
|
"IP internal",
|
||||||
|
"IP external",
|
||||||
|
"IP TE",
|
||||||
|
"IP6 internal",
|
||||||
|
"IP6 external",
|
||||||
|
"UNKNOWN"
|
||||||
|
]
|
||||||
|
|
||||||
class ISISTopo1(Topo):
|
class ISISTopo1(Topo):
|
||||||
"Simple two layer ISIS vrf topology"
|
"Simple two layer ISIS vrf topology"
|
||||||
@ -316,6 +329,7 @@ def parse_topology(lines, level):
|
|||||||
areas = {}
|
areas = {}
|
||||||
area = None
|
area = None
|
||||||
ipv = None
|
ipv = None
|
||||||
|
vertex_type_regex = "|".join(VERTEX_TYPE_LIST)
|
||||||
|
|
||||||
for line in lines:
|
for line in lines:
|
||||||
area_match = re.match(r"Area (.+):", line)
|
area_match = re.match(r"Area (.+):", line)
|
||||||
@ -335,44 +349,50 @@ def parse_topology(lines, level):
|
|||||||
ipv = "ipv4"
|
ipv = "ipv4"
|
||||||
continue
|
continue
|
||||||
|
|
||||||
item_match = re.match(r"([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)", line)
|
item_match = re.match(r"([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+)"
|
||||||
if item_match is not None:
|
, line)
|
||||||
|
if (
|
||||||
|
item_match is not None
|
||||||
|
and item_match.group(1) == "Vertex"
|
||||||
|
and item_match.group(2) == "Type"
|
||||||
|
and item_match.group(3) == "Metric"
|
||||||
|
and item_match.group(4) == "Next-Hop"
|
||||||
|
and item_match.group(5) == "Interface"
|
||||||
|
and item_match.group(6) == "Parent"
|
||||||
|
):
|
||||||
# Skip header
|
# Skip header
|
||||||
if (
|
|
||||||
item_match.group(1) == "Vertex"
|
|
||||||
and item_match.group(2) == "Type"
|
|
||||||
and item_match.group(3) == "Metric"
|
|
||||||
and item_match.group(4) == "Next-Hop"
|
|
||||||
and item_match.group(5) == "Interface"
|
|
||||||
and item_match.group(6) == "Parent"
|
|
||||||
):
|
|
||||||
continue
|
|
||||||
|
|
||||||
areas[area][level][ipv].append(
|
|
||||||
{
|
|
||||||
"vertex": item_match.group(1),
|
|
||||||
"type": item_match.group(2),
|
|
||||||
"metric": item_match.group(3),
|
|
||||||
"next-hop": item_match.group(4),
|
|
||||||
"interface": item_match.group(5),
|
|
||||||
"parent": item_match.group(6),
|
|
||||||
}
|
|
||||||
)
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
item_match = re.match(r"([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)", line)
|
item_match = re.match(r"([^\s]+) ({}) ([0]|([1-9][0-9]*)) ([^\s]+) ([^\s]+) ([^\s]+)"
|
||||||
|
.format(vertex_type_regex), line)
|
||||||
if item_match is not None:
|
if item_match is not None:
|
||||||
areas[area][level][ipv].append(
|
areas[area][level][ipv].append(
|
||||||
{
|
{
|
||||||
"vertex": item_match.group(1),
|
"vertex": item_match.group(1),
|
||||||
"type": item_match.group(2),
|
"type": item_match.group(2),
|
||||||
"metric": item_match.group(3),
|
"metric": item_match.group(3),
|
||||||
"parent": item_match.group(4),
|
"next-hop": item_match.group(5),
|
||||||
|
"interface": item_match.group(6),
|
||||||
|
"parent": item_match.group(7),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
item_match = re.match(r"([^ ]+)", line)
|
item_match = re.match(r"([^\s]+) ({}) ([0]|([1-9][0-9]*)) ([^\s]+)"
|
||||||
|
.format(vertex_type_regex), line)
|
||||||
|
|
||||||
|
if item_match is not None:
|
||||||
|
areas[area][level][ipv].append(
|
||||||
|
{
|
||||||
|
"vertex": item_match.group(1),
|
||||||
|
"type": item_match.group(2),
|
||||||
|
"metric": item_match.group(3),
|
||||||
|
"parent": item_match.group(5),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
|
||||||
|
item_match = re.match(r"([^\s]+)", line)
|
||||||
if item_match is not None:
|
if item_match is not None:
|
||||||
areas[area][level][ipv].append({"vertex": item_match.group(1)})
|
areas[area][level][ipv].append({"vertex": item_match.group(1)})
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user