Skip to content

Commit

Permalink
Merge pull request #107 from opensourcerouting/docker-fixes
Browse files Browse the repository at this point in the history
Topotests misc improvements
  • Loading branch information
donaldsharp committed Jul 27, 2018
2 parents 4e31363 + 47f3162 commit 7de07df
Show file tree
Hide file tree
Showing 10 changed files with 220 additions and 163 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.cache
__pycache__
*.pyc
.pytest_cache
2 changes: 0 additions & 2 deletions isis-topo1/r1/r1_topology.json
Expand Up @@ -76,15 +76,13 @@
},
{
"interface": "r3",
"metric": "internal",
"next-hop": "10",
"parent": "r1-eth0",
"type": "IP6",
"vertex": "2001:db8:2:1::/64"
},
{
"interface": "r3",
"metric": "internal",
"next-hop": "10",
"parent": "r1-eth0",
"type": "IP6",
Expand Down
2 changes: 0 additions & 2 deletions isis-topo1/r2/r2_topology.json
Expand Up @@ -76,15 +76,13 @@
},
{
"interface": "r4",
"metric": "internal",
"next-hop": "10",
"parent": "r2-eth0",
"type": "IP6",
"vertex": "2001:db8:2:2::/64"
},
{
"interface": "r4",
"metric": "internal",
"next-hop": "10",
"parent": "r2-eth0",
"type": "IP6",
Expand Down
39 changes: 4 additions & 35 deletions isis-topo1/r3/r3_topology.json
Expand Up @@ -47,15 +47,6 @@
"interface": "r3-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r5(4)",
"type": "pseudo_TE-IS",
"vertex": "r5"
},
{
"interface": "r3-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r5(2)",
"type": "TE-IS",
"vertex": "r4"
},
Expand Down Expand Up @@ -84,7 +75,7 @@
"metric": "internal",
"parent": "0",
"type": "IP6",
"vertex": "2001:db8:1:1::/64"
"vertex": "2001:db8:2:1::/64"
},
{
"interface": "r3-eth1",
Expand All @@ -96,15 +87,13 @@
},
{
"interface": "r5",
"metric": "internal",
"next-hop": "10",
"parent": "r3-eth1",
"type": "IP6",
"vertex": "2001:db8:1:2::/64"
"vertex": "2001:db8:2:2::/64"
},
{
"interface": "r5",
"metric": "internal",
"next-hop": "10",
"parent": "r3-eth1",
"type": "IP6",
Expand All @@ -114,29 +103,18 @@
"interface": "r3-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r5(4)",
"type": "pseudo_TE-IS",
"vertex": "r5"
},
{
"interface": "r3-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r5(2)",
"type": "TE-IS",
"vertex": "r4"
},
{
"interface": "r5",
"metric": "internal",
"next-hop": "20",
"parent": "r3-eth1",
"type": "IP6",
"vertex": "2001:db8:2:2::/64"
"vertex": "2001:db8:1:2::/64"
},
{
"interface": "r5",
"metric": "internal",
"next-hop": "20",
"parent": "r3-eth1",
"type": "IP6",
Expand Down Expand Up @@ -188,7 +166,7 @@
"metric": "internal",
"parent": "0",
"type": "IP6",
"vertex": "2001:db8:2:1::/64"
"vertex": "2001:db8:1:1::/64"
},
{
"interface": "r3-eth0",
Expand All @@ -200,15 +178,6 @@
},
{
"interface": "r1",
"metric": "internal",
"next-hop": "10",
"parent": "r3-eth0",
"type": "IP6",
"vertex": "2001:db8:1:1::/64"
},
{
"interface": "r1",
"metric": "internal",
"next-hop": "10",
"parent": "r3-eth0",
"type": "IP6",
Expand Down
57 changes: 1 addition & 56 deletions isis-topo1/r4/r4_topology.json
Expand Up @@ -47,23 +47,6 @@
"interface": "r4-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r5(4)",
"type": "pseudo_TE-IS",
"vertex": "r3"
},
{
"interface": "r4-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r5(4)",
"type": "pseudo_TE-IS",
"vertex": "r5"
},
{
"interface": "r4-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r3(2)",
"type": "TE-IS",
"vertex": "r3"
},
Expand Down Expand Up @@ -104,15 +87,13 @@
},
{
"interface": "r5",
"metric": "internal",
"next-hop": "10",
"parent": "r4-eth1",
"type": "IP6",
"vertex": "2001:db8:2:1::/64"
},
{
"interface": "r5",
"metric": "internal",
"next-hop": "10",
"parent": "r4-eth1",
"type": "IP6",
Expand All @@ -122,37 +103,18 @@
"interface": "r4-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r5(4)",
"type": "pseudo_TE-IS",
"vertex": "r3"
},
{
"interface": "r4-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r5(4)",
"type": "pseudo_TE-IS",
"vertex": "r5"
},
{
"interface": "r4-eth1",
"metric": "20",
"next-hop": "r5",
"parent": "r3(2)",
"type": "TE-IS",
"vertex": "r3"
},
{
"interface": "r5",
"metric": "internal",
"next-hop": "20",
"parent": "r4-eth1",
"type": "IP6",
"vertex": "2001:db8:2:1::/64"
"vertex": "2001:db8:1:1::/64"
},
{
"interface": "r5",
"metric": "internal",
"next-hop": "20",
"parent": "r4-eth1",
"type": "IP6",
Expand Down Expand Up @@ -194,14 +156,6 @@
"parent": "r4-eth0",
"type": "IP",
"vertex": "10.254.0.2/32"
},
{
"interface": "r4-eth0",
"metric": "20",
"next-hop": "r2",
"parent": "r2(4)",
"type": "pseudo_TE-IS",
"vertex": "r2"
}
],
"ipv6": [
Expand All @@ -224,19 +178,10 @@
},
{
"interface": "r2",
"metric": "internal",
"next-hop": "10",
"parent": "r4-eth0",
"type": "IP6",
"vertex": "2001:db8:f::2/128"
},
{
"interface": "r4-eth0",
"metric": "20",
"next-hop": "r2",
"parent": "r2(4)",
"type": "pseudo_TE-IS",
"vertex": "r2"
}
]
}
Expand Down
28 changes: 4 additions & 24 deletions isis-topo1/r5/r5_topology.json
Expand Up @@ -80,14 +80,6 @@
"parent": "r5-eth1",
"type": "IP",
"vertex": "10.254.0.4/32"
},
{
"interface": "r5-eth0",
"metric": "20",
"next-hop": "r3",
"parent": "r3(4)",
"type": "pseudo_TE-IS",
"vertex": "r3"
}
],
"ipv6": [
Expand All @@ -98,13 +90,13 @@
"metric": "internal",
"parent": "0",
"type": "IP6",
"vertex": "2001:db8:1:1::/64"
"vertex": "2001:db8:2:1::/64"
},
{
"metric": "internal",
"parent": "0",
"type": "IP6",
"vertex": "2001:db8:1:2::/64"
"vertex": "2001:db8:2:2::/64"
},
{
"interface": "r5-eth0",
Expand All @@ -124,43 +116,31 @@
},
{
"interface": "r3",
"metric": "internal",
"next-hop": "10",
"parent": "r5-eth0",
"type": "IP6",
"vertex": "2001:db8:2:1::/64"
"vertex": "2001:db8:1:1::/64"
},
{
"interface": "r3",
"metric": "internal",
"next-hop": "10",
"parent": "r5-eth0",
"type": "IP6",
"vertex": "2001:db8:f::3/128"
},
{
"interface": "r4",
"metric": "internal",
"next-hop": "10",
"parent": "r5-eth1",
"type": "IP6",
"vertex": "2001:db8:2:2::/64"
"vertex": "2001:db8:1:2::/64"
},
{
"interface": "r4",
"metric": "internal",
"next-hop": "10",
"parent": "r5-eth1",
"type": "IP6",
"vertex": "2001:db8:f::4/128"
},
{
"interface": "r5-eth0",
"metric": "20",
"next-hop": "r3",
"parent": "r3(4)",
"type": "pseudo_TE-IS",
"vertex": "r3"
}
]
},
Expand Down
9 changes: 9 additions & 0 deletions isis-topo1/test_isis_topo1.py
Expand Up @@ -341,6 +341,15 @@ def parse_topology(lines, level):
item_match = re.match(
r"([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+) ([^ ]+)", line)
if item_match is not None:
# 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),
Expand Down

0 comments on commit 7de07df

Please sign in to comment.