diff --git a/tests/configlet/util/common.py b/tests/configlet/util/common.py index 1370524351e..c3d5f38f1c3 100755 --- a/tests/configlet/util/common.py +++ b/tests/configlet/util/common.py @@ -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, @@ -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() } } @@ -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: + 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: