Skip to content

Commit

Permalink
tests: fix ospf json config confusion for topojson.
Browse files Browse the repository at this point in the history
Signed-off-by: nguggarigoud <nguggarigoud@vmware.com>
  • Loading branch information
nguggarigoud committed Aug 24, 2021
1 parent 5809c29 commit af81dca
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
22 changes: 11 additions & 11 deletions tests/topotests/lib/ospf.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,15 +500,15 @@ def config_ospf_interface(tgen, topo, input_dict=None, build=False, load_config=
else:
cmd = "ip ospf authentication"

if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

if "message-digest-key" in ospf_data:
cmd = "ip ospf message-digest-key {} md5 {}".format(
ospf_data["message-digest-key"], ospf_data["authentication-key"]
)
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

Expand All @@ -519,28 +519,28 @@ def config_ospf_interface(tgen, topo, input_dict=None, build=False, load_config=
cmd = "ip ospf authentication-key {}".format(
ospf_data["authentication-key"]
)
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

# interface ospf dr priority
if data_ospf_dr_priority:
cmd = "ip ospf priority {}".format(ospf_data["priority"])
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

# interface ospf cost
if data_ospf_cost:
cmd = "ip ospf cost {}".format(ospf_data["cost"])
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

# interface ospf mtu
if data_ospf_mtu:
cmd = "ip ospf mtu-ignore"
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

Expand Down Expand Up @@ -2372,7 +2372,7 @@ def config_ospf6_interface(tgen, topo, input_dict=None, build=False, load_config
if data_ospf_auth:
cmd = "ipv6 ospf6 authentication"

if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)

if "hash-algo" in ospf_data:
Expand All @@ -2382,28 +2382,28 @@ def config_ospf6_interface(tgen, topo, input_dict=None, build=False, load_config
ospf_data["hash-algo"],
ospf_data["key"],
)
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

# interface ospf dr priority
if data_ospf_dr_priority:
cmd = "ipv6 ospf priority {}".format(ospf_data["priority"])
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

# interface ospf cost
if data_ospf_cost:
cmd = "ipv6 ospf cost {}".format(ospf_data["cost"])
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

# interface ospf mtu
if data_ospf_mtu:
cmd = "ipv6 ospf mtu-ignore"
if "del_action" in ospf_data:
if "delete" in ospf_data:
cmd = "no {}".format(cmd)
config_data.append(cmd)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def red_connected(dut, config=True):
ospf_red = {
dut: {
"ospf": {
"redistribute": [{"redist_type": "connected", "del_action": True}]
"redistribute": [{"redist_type": "connected", "delete": True}]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def test_ospf_authentication_simple_pass_tc28_p1(request):
"ospf": {
"authentication": True,
"authentication-key": "ospf",
"del_action": True,
"delete": True,
}
}
}
Expand Down Expand Up @@ -449,7 +449,7 @@ def test_ospf_authentication_md5_tc29_p1(request):
"authentication": "message-digest",
"authentication-key": "ospf",
"message-digest-key": "10",
"del_action": True,
"delete": True,
}
}
}
Expand Down Expand Up @@ -661,7 +661,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request):
"authentication": "message-digest",
"authentication-key": "ospf",
"message-digest-key": "10",
"del_action": True,
"delete": True,
}
}
}
Expand All @@ -678,7 +678,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request):
"authentication": "message-digest",
"authentication-key": "ospf",
"message-digest-key": "10",
"del_action": True,
"delete": True,
}
}
}
Expand Down Expand Up @@ -772,7 +772,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request):
"ospf": {
"authentication": True,
"authentication-key": "OSPFv4",
"del_action": True,
"delete": True,
}
}
}
Expand All @@ -788,7 +788,7 @@ def test_ospf_authentication_different_auths_tc30_p1(request):
"ospf": {
"authentication": True,
"authentication-key": "OSPFv4",
"del_action": True,
"delete": True,
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ def test_ospf_cost_tc52_p0(request):

step(" Un configure cost from the interface r0 - r1.")

r0_ospf_cost = {"r0": {"links": {"r1": {"ospf": {"cost": 30, "del_action": True}}}}}
r0_ospf_cost = {"r0": {"links": {"r1": {"ospf": {"cost": 30, "delete": True}}}}}
result = config_ospf_interface(tgen, topo, r0_ospf_cost)
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)

Expand All @@ -646,7 +646,7 @@ def test_ospf_cost_tc52_p0(request):

step(" Un configure cost from the interface r0 - r2.")

r0_ospf_cost = {"r0": {"links": {"r2": {"ospf": {"cost": 20, "del_action": True}}}}}
r0_ospf_cost = {"r0": {"links": {"r2": {"ospf": {"cost": 20, "delete": True}}}}}
result = config_ospf_interface(tgen, topo, r0_ospf_cost)
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ def test_ospf_tc4_mtu_ignore_p0(request):
)

r1_ospf_mtu = {
"r1": {"links": {"r0": {"ospf": {"mtu_ignore": True, "del_action": True}}}}
"r1": {"links": {"r0": {"ospf": {"mtu_ignore": True, "delete": True}}}}
}
result = config_ospf_interface(tgen, topo, r1_ospf_mtu)
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def red_connected(dut, config=True):
ospf_red = {
dut: {
"ospf6": {
"redistribute": [{"redist_type": "connected", "del_action": True}]
"redistribute": [{"redist_type": "connected", "delete": True}]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def red_static(dut, config=True):
ospf_red = {
dut: {
"ospf6": {
"redistribute": [{"redist_type": "static", "del_action": True}]
"redistribute": [{"redist_type": "static", "delete": True}]
}
}
}
Expand All @@ -273,7 +273,7 @@ def red_connected(dut, config=True):
ospf_red = {
dut: {
"ospf6": {
"redistribute": [{"redist_type": "connected", "del_action": True}]
"redistribute": [{"redist_type": "connected", "delete": True}]
}
}
}
Expand Down Expand Up @@ -560,7 +560,7 @@ def test_ospfv3_cost_tc52_p0(request):
step(" Un configure cost from the interface r0 - r1.")

r0_ospf_cost = {
"r0": {"links": {"r1": {"ospf6": {"cost": 30, "del_action": True}}}}
"r0": {"links": {"r1": {"ospf6": {"cost": 30, "delete": True}}}}
}
result = config_ospf6_interface(tgen, topo, r0_ospf_cost)
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
Expand All @@ -579,7 +579,7 @@ def test_ospfv3_cost_tc52_p0(request):
step(" Un configure cost from the interface r0 - r2.")

r0_ospf_cost = {
"r0": {"links": {"r2": {"ospf6": {"cost": 20, "del_action": True}}}}
"r0": {"links": {"r2": {"ospf6": {"cost": 20, "delete": True}}}}
}
result = config_ospf6_interface(tgen, topo, r0_ospf_cost)
assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result)
Expand Down

0 comments on commit af81dca

Please sign in to comment.