ldp-topo1: Support implicit-null and old format on "show_mpls_table"

Signed-off-by: Martin Winter <mwinter@opensourcerouting.org>
This commit is contained in:
Martin Winter 2018-02-13 18:09:41 -08:00 committed by Donald Sharp
parent a209417da6
commit d01e89f168
9 changed files with 60 additions and 18 deletions

View File

@ -1,8 +1,8 @@
Inbound Outbound
Label Type Nexthop Label
-------- ------- --------------- --------
XX LDP 10.0.1.2 3
XX LDP 10.0.1.2 3
XX LDP 10.0.1.2 3
XX LDP 10.0.1.2 XX
XX LDP 10.0.1.2 XX
XX LDP 10.0.1.2 implicit-null
XX LDP 10.0.1.2 implicit-null
XX LDP 10.0.1.2 implicit-null

View File

@ -0,0 +1,8 @@
Inbound Outbound
Label Type Nexthop Label
-------- ------- --------------- --------
XX LDP 10.0.1.2 3
XX LDP 10.0.1.2 3
XX LDP 10.0.1.2 3
XX LDP 10.0.1.2 XX
XX LDP 10.0.1.2 XX

View File

@ -1,7 +1,7 @@
Inbound Outbound
Label Type Nexthop Label
-------- ------- --------------- --------
XX LDP 10.0.1.1 3
XX LDP 10.0.2.3 3
XX LDP 10.0.2.4 3
XX LDP 10.0.3.3 3
XX LDP 10.0.1.1 implicit-null
XX LDP 10.0.2.3 implicit-null
XX LDP 10.0.2.4 implicit-null
XX LDP 10.0.3.3 implicit-null

View File

@ -0,0 +1,7 @@
Inbound Outbound
Label Type Nexthop Label
-------- ------- --------------- --------
XX LDP 10.0.1.1 3
XX LDP 10.0.2.3 3
XX LDP 10.0.2.4 3
XX LDP 10.0.3.3 3

View File

@ -1,10 +1,10 @@
Inbound Outbound
Label Type Nexthop Label
-------- ------- --------------- --------
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 XX
XX LDP 10.0.2.4 3
XX LDP 10.0.3.2 3
XX LDP 10.0.3.2 3
XX LDP 10.0.2.2 implicit-null
XX LDP 10.0.2.2 implicit-null
XX LDP 10.0.2.4 implicit-null
XX LDP 10.0.3.2 XX
XX LDP 10.0.3.2 implicit-null
XX LDP 10.0.3.2 implicit-null

View File

@ -0,0 +1,10 @@
Inbound Outbound
Label Type Nexthop Label
-------- ------- --------------- --------
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 XX
XX LDP 10.0.2.4 3
XX LDP 10.0.3.2 3
XX LDP 10.0.3.2 3
XX LDP 10.0.3.2 XX

View File

@ -1,9 +1,9 @@
Inbound Outbound
Label Type Nexthop Label
-------- ------- --------------- --------
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 XX
XX LDP 10.0.2.3 3
XX LDP 10.0.2.3 3
XX LDP 10.0.2.2 implicit-null
XX LDP 10.0.2.2 implicit-null
XX LDP 10.0.2.2 implicit-null
XX LDP 10.0.2.3 implicit-null
XX LDP 10.0.2.3 implicit-null

View File

@ -0,0 +1,9 @@
Inbound Outbound
Label Type Nexthop Label
-------- ------- --------------- --------
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 3
XX LDP 10.0.2.2 XX
XX LDP 10.0.2.3 3
XX LDP 10.0.2.3 3

View File

@ -606,8 +606,16 @@ def test_mpls_table():
print("\n\n** Verifying MPLS table")
print("******************************************\n")
failures = 0
version = cli_version
if (version == ""):
# check for new output without implicit-null
output = net['r1'].cmd('vtysh -c "show mpls table" 2> /dev/null').rstrip()
if 'LDP 10.0.1.2 3' in output:
version = "-no-impl-null"
for i in range(1, 5):
refTableFile = '%s/r%s/show_mpls_table.ref%s' % (thisDir, i, cli_version)
refTableFile = '%s/r%s/show_mpls_table.ref%s' % (thisDir, i, version)
if os.path.isfile(refTableFile):
# Read expected result from file
expected = open(refTableFile).read().rstrip()