Skip to content

Commit c681b41

Browse files
committed
change to runningconfig verification
1 parent ba0977d commit c681b41

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

tests/generic_config_updater/test_bgpl.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,18 @@
1515

1616
logger = logging.getLogger(__name__)
1717

18-
def show_bgp_monitor(duthost):
18+
def get_bgp_monitor_runningconfig(duthost):
1919
""" Get bgp listener config
2020
"""
21-
cmds = "show ip bgp summary"
21+
cmds = "show runningconfiguration bgp"
2222
output = duthost.shell(cmds)
2323
pytest_assert(not output['rc'],
2424
"'{}' failed with rc={}".format(cmds, output['rc'])
2525
)
2626

2727
# Sample:
28-
# Neighbhor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd NeighborName
29-
# ----------- --- ----- --------- --------- -------- ----- ------ --------- -------------- --------------
30-
# 11.0.0.1 4 65100 0 0 0 0 0 never Connect BGPMonitor
31-
bgp_listener_pattern = r".*BGPMonitor.*"
28+
# neighbor 11.0.0.1 description BGPMonitor
29+
bgp_listener_pattern = r"\s+neighbor.*description BGPMonitor"
3230
bgp_listener_config = re.findall(bgp_listener_pattern, output['stdout'])
3331
return bgp_listener_config
3432

@@ -41,15 +39,15 @@ def setup_env(duthosts, rand_one_dut_hostname):
4139
rand_selected_dut: The fixture returns a randomly selected DuT.
4240
"""
4341
duthost = duthosts[rand_one_dut_hostname]
44-
original_bgp_listener_config = show_bgp_monitor(duthost)
42+
original_bgp_listener_config = get_bgp_monitor_runningconfig(duthost)
4543
create_checkpoint(duthost)
4644

4745
yield
4846

4947
try:
5048
logger.info("Rolled back to original checkpoint")
5149
rollback_or_reload(duthost)
52-
current_bgp_listener_config = show_bgp_monitor(duthost)
50+
current_bgp_listener_config = get_bgp_monitor_runningconfig(duthost)
5351
pytest_assert(set(original_bgp_listener_config) == set(current_bgp_listener_config),
5452
"bgp listener config are not suppose to change after test"
5553
)

0 commit comments

Comments
 (0)