tests: fix nhc1 route check after nhs1 down

After setting down nhs1, the test is checking that nhc1 routing table
matches routes in nhc1/nhrp_route.json. It is incorrect because it
checks that the NHRP route to nhs1 is still present but it should have
disappeared.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
This commit is contained in:
Louis Scalbert 2024-08-30 14:08:51 +02:00
parent dbd888cce6
commit df630bbc3e
2 changed files with 52 additions and 3 deletions

View File

@ -0,0 +1,49 @@
{
"176.16.1.1\/32": null,
"176.16.1.2\/32": [
{
"prefix": "176.16.1.2\/32",
"protocol": "nhrp",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 10,
"metric": 0,
"installed": true,
"internalNextHopNum": 1,
"internalNextHopActiveNum": 1,
"nexthops": [
{
"fib": true,
"directlyConnected": true,
"interfaceName": "nhc1-gre0",
"active": true
}
]
}
],
"176.16.1.3\/32": [
{
"prefix": "176.16.1.3\/32",
"protocol": "nhrp",
"vrfId": 0,
"vrfName": "default",
"selected": true,
"destSelected": true,
"distance": 10,
"metric": 0,
"installed": true,
"internalNextHopNum": 1,
"internalNextHopActiveNum": 1,
"nexthops": [
{
"fib": true,
"directlyConnected": true,
"interfaceName": "nhc1-gre0",
"active": true
}
]
}
]
}

View File

@ -200,7 +200,7 @@ def test_protocols_convergence():
# Check NHRP cache on servers and clients # Check NHRP cache on servers and clients
for rname, router in router_list.items(): for rname, router in router_list.items():
if 'nh' not in rname: if "nh" not in rname:
continue continue
json_file = "{}/{}/nhrp_cache.json".format(CWD, router.name) json_file = "{}/{}/nhrp_cache.json".format(CWD, router.name)
@ -219,7 +219,7 @@ def test_protocols_convergence():
# Check NHRP IPV4 routes on servers and clients # Check NHRP IPV4 routes on servers and clients
logger.info("Checking IPv4 routes for convergence") logger.info("Checking IPv4 routes for convergence")
for rname, router in router_list.items(): for rname, router in router_list.items():
if 'nh' not in rname: if "nh" not in rname:
continue continue
json_file = "{}/{}/nhrp_route.json".format(CWD, router.name) json_file = "{}/{}/nhrp_route.json".format(CWD, router.name)
@ -381,7 +381,7 @@ def test_redundancy_shortcut():
logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK") logger.info("Check Ping IPv4 from host to nhc2 via shortcut OK")
# Now verify shortcut is purged with lack of traffic # Now verify shortcut is purged with lack of traffic
json_file = "{}/{}/nhrp_route.json".format(CWD, nhc1.name) json_file = "{}/{}/nhrp_route_nhs1_down.json".format(CWD, nhc1.name)
assertmsg = "No nhrp_route file found" assertmsg = "No nhrp_route file found"
assert os.path.isfile(json_file), assertmsg assert os.path.isfile(json_file), assertmsg