Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests/configlet] Update configlet test to align with swss update #12290

Merged
merged 3 commits into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions tests/configlet/util/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ def do_pause(secs, msg):
# BUFFER_PG.*3-4 is an auto created entry by buffermgr
# configlet skips it. So skip verification too.
"BUFFER_PG_TABLE:Ethernet[0-9][0-9]*:3-4"},
"keys_skip_val_comp": set()
"keys_skip_val_comp": {
"last_up_time",
"flap_count"
}
},
"state-db": {
"db_no": 6,
Expand All @@ -115,10 +118,10 @@ def do_pause(secs, msg):
"VLAN_MEMBER_TABLE",
"VLAN_TABLE"
},
"keys_to_skip_comp": set(),
"keys_skip_val_comp": {
"keys_to_skip_comp": {
"PORT_TABLE"
}
},
"keys_skip_val_comp": set()
}
}

Expand Down Expand Up @@ -235,8 +238,13 @@ def get_dump(duthost, db_name, db_info, dir_name, data_dir):
db_write = {}
for k in db_read:
# Transient keys start with "_"; Hence skipped
if ((not k.startswith("_")) and (not match_key(k, keys_skip_cmp))):
db_write[k] = {} if match_key(k, keys_skip_val) else db_read[k]
if (not k.startswith("_")) and (not match_key(k, keys_skip_cmp)):
value = db_read[k].get("value", {}) # Get the value or empty dictionary if

for skip_val in keys_skip_val:
wen587 marked this conversation as resolved.
Show resolved Hide resolved
if match_key(skip_val, value):
value.pop(skip_val)
db_write[k] = db_read[k]

dst_file = os.path.join(dir_name, "{}.json".format(db_name))
with open(dst_file, "w") as s:
Expand Down
Loading