mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-24 02:48:55 +00:00
tests: use new def for redistribution in ospf
Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
This commit is contained in:
parent
881fa68f05
commit
c6b59ef48c
@ -277,7 +277,7 @@ def test_ospf_ecmp_tc16_p0(request):
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
|
||||
dut = "r0"
|
||||
red_static(dut)
|
||||
redistribute(dut, "static")
|
||||
|
||||
step("Verify that route in R2 in stalled with 8 next hops.")
|
||||
nh = []
|
||||
@ -358,7 +358,7 @@ def test_ospf_ecmp_tc16_p0(request):
|
||||
step(" Un configure static route on R0")
|
||||
|
||||
dut = "r0"
|
||||
red_static(dut, config=False)
|
||||
redistribute(dut, "static", delete=True)
|
||||
|
||||
# Wait for R0 to flush external LSAs.
|
||||
sleep(10)
|
||||
@ -389,7 +389,7 @@ def test_ospf_ecmp_tc16_p0(request):
|
||||
|
||||
step("Re configure the static route in R0.")
|
||||
dut = "r0"
|
||||
red_static(dut)
|
||||
redistribute(dut, "static")
|
||||
|
||||
dut = "r1"
|
||||
result = verify_ospf_rib(tgen, dut, input_dict, next_hop=nh)
|
||||
@ -444,7 +444,7 @@ def test_ospf_ecmp_tc17_p0(request):
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
|
||||
dut = "r0"
|
||||
red_static(dut)
|
||||
redistribute(dut, "static")
|
||||
|
||||
step("Verify that route in R2 in stalled with 2 next hops.")
|
||||
|
||||
@ -463,7 +463,7 @@ def test_ospf_ecmp_tc17_p0(request):
|
||||
step(" Un configure static route on R0")
|
||||
|
||||
dut = "r0"
|
||||
red_static(dut, config=False)
|
||||
redistribute(dut, "static", delete=True)
|
||||
# sleep till the route gets withdrawn
|
||||
sleep(10)
|
||||
|
||||
@ -493,7 +493,7 @@ def test_ospf_ecmp_tc17_p0(request):
|
||||
|
||||
step("Reconfigure the static route in R0.Change ECMP value to 2.")
|
||||
dut = "r0"
|
||||
red_static(dut)
|
||||
redistribute(dut, "static")
|
||||
|
||||
step("Configure cost on R0 as 100")
|
||||
r0_ospf_cost = {"r0": {"links": {"r1": {"ospf": {"cost": 100}}}}}
|
||||
|
@ -288,7 +288,7 @@ def test_ospf_lan_ecmp_tc18_p0(request):
|
||||
)
|
||||
|
||||
dut = rtr
|
||||
red_static(dut)
|
||||
redistribute(dut, "static")
|
||||
|
||||
step(
|
||||
"Verify that route in R0 in stalled with 8 hops. "
|
||||
|
@ -281,7 +281,7 @@ def test_ospf_learning_tc15_p0(request):
|
||||
|
||||
step("Redistribute static route in R2 ospf.")
|
||||
dut = "r2"
|
||||
red_static(dut)
|
||||
redistribute(dut, "static")
|
||||
|
||||
step("Verify that Type 5 LSA is originated by R2.")
|
||||
dut = "r0"
|
||||
|
@ -239,9 +239,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request):
|
||||
result = create_static_routes(tgen, input_dict)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
|
||||
ospf_red_r1 = {"r0": {"ospf": {"redistribute": [{"redist_type": "static"}]}}}
|
||||
result = create_router_ospf(tgen, topo, ospf_red_r1)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
redistribute("r0", "static")
|
||||
|
||||
dut = "r1"
|
||||
lsid = NETWORK["ipv4"][0].split("/")[0]
|
||||
@ -253,13 +251,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request):
|
||||
result = verify_rib(tgen, "ipv4", dut, input_dict, protocol=protocol)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
|
||||
ospf_red_r1 = {
|
||||
"r0": {
|
||||
"ospf": {"redistribute": [{"redist_type": "static", "del_action": True}]}
|
||||
}
|
||||
}
|
||||
result = create_router_ospf(tgen, topo, ospf_red_r1)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
redistribute("r0", "static", delete=True)
|
||||
|
||||
step(
|
||||
"Create prefix-list in R0 to permit 10.0.20.1/32 prefix &" " deny 10.0.20.2/32"
|
||||
@ -306,15 +298,7 @@ def test_ospf_routemaps_functionality_tc19_p0(request):
|
||||
" ospf using route map rmap1"
|
||||
)
|
||||
|
||||
ospf_red_r1 = {
|
||||
"r0": {
|
||||
"ospf": {
|
||||
"redistribute": [{"redist_type": "static", "route_map": "rmap_ipv4"}]
|
||||
}
|
||||
}
|
||||
}
|
||||
result = create_router_ospf(tgen, topo, ospf_red_r1)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
redistribute("r0", "static", route_map="rmap_ipv4")
|
||||
|
||||
step("Change prefix rules to permit 10.0.20.2 and deny 10.0.20.1")
|
||||
# Create ip prefix list
|
||||
@ -508,15 +492,7 @@ def test_ospf_routemaps_functionality_tc20_p0(request):
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
|
||||
step("Redistribute to ospf using route map ( non existent route map)")
|
||||
ospf_red_r1 = {
|
||||
"r0": {
|
||||
"ospf": {
|
||||
"redistribute": [{"redist_type": "static", "route_map": "rmap_ipv4"}]
|
||||
}
|
||||
}
|
||||
}
|
||||
result = create_router_ospf(tgen, topo, ospf_red_r1)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
redistribute("r0", "static", route_map="rmap_ipv4")
|
||||
|
||||
step(
|
||||
"Verify that routes are not allowed in OSPF even tough no "
|
||||
@ -646,15 +622,7 @@ def test_ospf_routemaps_functionality_tc21_p0(request):
|
||||
result = create_static_routes(tgen, input_dict)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
|
||||
ospf_red_r0 = {
|
||||
"r0": {
|
||||
"ospf": {
|
||||
"redistribute": [{"redist_type": "static", "route_map": "rmap_ipv4"}]
|
||||
}
|
||||
}
|
||||
}
|
||||
result = create_router_ospf(tgen, topo, ospf_red_r0)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
redistribute("r0", "static", route_map="rmap_ipv4")
|
||||
|
||||
# Create route map
|
||||
routemaps = {
|
||||
@ -890,15 +858,7 @@ def test_ospf_routemaps_functionality_tc24_p0(request):
|
||||
result = create_static_routes(tgen, input_dict)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
|
||||
ospf_red_r0 = {
|
||||
"r0": {
|
||||
"ospf": {
|
||||
"redistribute": [{"redist_type": "static", "route_map": "rmap_ipv4"}]
|
||||
}
|
||||
}
|
||||
}
|
||||
result = create_router_ospf(tgen, topo, ospf_red_r0)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
|
||||
redistribute("r0", "static", route_map="rmap_ipv4")
|
||||
|
||||
# Create ip prefix list
|
||||
pfx_list = {
|
||||
|
@ -499,8 +499,8 @@ def test_ospf_redistribution_tc8_p1(request):
|
||||
"advertised/exchaged via ospf"
|
||||
)
|
||||
for rtr in topo["routers"]:
|
||||
red_static(rtr)
|
||||
red_connected(rtr)
|
||||
redistribute(rtr, "static")
|
||||
redistribute(rtr, "connected")
|
||||
for node in topo["routers"]:
|
||||
input_dict = {
|
||||
"r0": {
|
||||
@ -557,13 +557,7 @@ def test_ospf_redistribution_tc8_p1(request):
|
||||
)
|
||||
|
||||
for rtr in topo["routers"]:
|
||||
ospf_red = {
|
||||
rtr: {"ospf": {"redistribute": [{"redist_type": "static", "delete": True}]}}
|
||||
}
|
||||
result = create_router_ospf(tgen, topo, ospf_red)
|
||||
assert result is True, "Testcase {} : Failed \n Error: {}".format(
|
||||
tc_name, result
|
||||
)
|
||||
redistribute(rtr, "static", delete=True)
|
||||
|
||||
input_dict = {
|
||||
"r0": {
|
||||
|
Loading…
Reference in New Issue
Block a user