tests: adding LDP tests for advertising host-routes.

Adding test to verify that proper LDP labels are advertised if
host-route configuration is changed.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
This commit is contained in:
lynne 2020-03-29 13:43:05 -04:00
parent 8fcca5024f
commit 6b4830dc1e
5 changed files with 269 additions and 0 deletions

View File

@ -0,0 +1,61 @@
{
"bindings":[
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"2.2.2.2",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"2.2.2.2",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"4.4.4.4/32",
"neighborId":"0.0.0.0",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.1.0/24",
"neighborId":"2.2.2.2",
"localLabel":"imp-null",
"remoteLabel":"imp-null",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.2.0/24",
"neighborId":"2.2.2.2",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"10.0.3.0/24",
"neighborId":"2.2.2.2",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"123.0.1.0/24",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
}
]
}

View File

@ -0,0 +1,63 @@
{
"bindings":[
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"1.1.1.1",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"3.3.3.3",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"4.4.4.4/32",
"neighborId":"0.0.0.0",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.1.0/24",
"neighborId":"1.1.1.1",
"localLabel":"imp-null",
"remoteLabel":"imp-null",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.2.0/24",
"neighborId":"3.3.3.3",
"localLabel":"imp-null",
"remoteLabel":"imp-null",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.3.0/24",
"neighborId":"3.3.3.3",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"123.0.1.0/24",
"neighborId":"1.1.1.1",
"remoteLabel":"imp-null",
"inUse":1
}
]
}

View File

@ -0,0 +1,61 @@
{
"bindings":[
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"2.2.2.2",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"2.2.2.2",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"4.4.4.4/32",
"neighborId":"0.0.0.0",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.1.0/24",
"neighborId":"2.2.2.2",
"remoteLabel":"imp-null",
"inUse":1
},
{
"addressFamily":"ipv4",
"prefix":"10.0.2.0/24",
"neighborId":"2.2.2.2",
"localLabel":"imp-null",
"remoteLabel":"imp-null",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.3.0/24",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"123.0.1.0/24",
"neighborId":"2.2.2.2",
"inUse":1
}
]
}

View File

@ -0,0 +1,68 @@
{
"bindings":[
{
"addressFamily":"ipv4",
"prefix":"1.1.1.1/32",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"2.2.2.2/32",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"3.3.3.3/32",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"4.4.4.4/32",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.1.0/24",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.2.0/24",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"10.0.3.0/24",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
},
{
"addressFamily":"ipv4",
"prefix":"123.0.1.0/24",
"neighborId":"0.0.0.0",
"localLabel":"imp-null",
"remoteLabel":"-",
"inUse":0
}
]
}

View File

@ -213,6 +213,22 @@ def test_ldp_bindings():
for rname in ['r1', 'r2', 'r3', 'r4']:
router_compare_json_output(rname, "show mpls ldp binding json", "show_ldp_binding.ref")
def test_ldp_bindings_all_routes():
logger.info("Test: verify LDP bindings after host filter removed")
tgen = get_topogen()
# Skip if previous fatal error condition is raised
if tgen.routers_have_failure():
pytest.skip(tgen.errors)
# remove ACL that blocks advertising everything but host routes */
cmd = 'vtysh -c \"configure terminal\" -c \"mpls ldp\" -c \"address-family ipv4\" -c \"no label local allocate host-routes\"'
tgen.net['r1'].cmd(cmd)
sleep(2)
for rname in ['r1', 'r2', 'r3', 'r4']:
router_compare_json_output(rname, "show mpls ldp binding json", "show_ldp_all_binding.ref")
# Memory leak test template
def test_memory_leak():
"Run the memory leak test and report results."