Skip to content

Commit

Permalink
Fix core_dump_and_config_check in conftest (sonic-net#13619)
Browse files Browse the repository at this point in the history
What is the motivation for this PR?
Currently compare_running_config would return True if the first key / value is equal, which is incorrect.
Sample:
pre_running_config = {
"key_a": "value_a",
"key_b": "value_b"
}
cur_running_config = {
"key_a": "value_a",
"key_b": "another_value"
}
After compare "key_a" and find that they are equal, it will return True directly rather than continue to compare "key_b"

How did you do it?
Remove the incorrect return

How did you verify/test it?
Run tests
  • Loading branch information
yaqiangz authored Jul 15, 2024
1 parent d0df203 commit 8992ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2064,7 +2064,7 @@ def compare_running_config(pre_running_config, cur_running_config):
for key in pre_running_config.keys():
if not compare_running_config(pre_running_config[key], cur_running_config[key]):
return False
return True
return True
# We only have string in list in running config now, so we can ignore the order of the list.
elif type(pre_running_config) is list:
if set(pre_running_config) != set(cur_running_config):
Expand Down

0 comments on commit 8992ad0

Please sign in to comment.