Skip to content

Commit

Permalink
Fix vstest
Browse files Browse the repository at this point in the history
Signed-off-by: bingwang <wang.bing@microsoft.com>
  • Loading branch information
bingwang-ms committed Apr 28, 2022
1 parent ca75f35 commit 97f3027
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,16 @@ def getVlanOid(self, vlanId):
break
return vlan_oid

def port_field_set(self, port, field, value):
cdb = swsscommon.DBConnector(4, self.redis_sock, 0)
tbl = swsscommon.Table(cdb, "PORT")
fvs = swsscommon.FieldValuePairs([(field, value)])
tbl.set(port, fvs)
time.sleep(1)

def port_admin_set(self, port, status):
self.port_field_set(port, "admin_status", status)

# deps: acl_portchannel, fdb
def getCrmCounterValue(self, key, counter):
counters_db = swsscommon.DBConnector(swsscommon.COUNTERS_DB, self.redis_sock, 0)
Expand Down
6 changes: 3 additions & 3 deletions tests/test_buffer_traditional.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_zero_cable_len_profile_update(self, dvs, setup_teardown_test):

# buffer pgs should still point to the original buffer profile
for pg in self.lossless_pgs:
self.app_db.wait_for_field_match("BUFFER_PG_TABLE", self.INTF + ":" + pg, {"profile": orig_lossless_profile})
self.app_db.wait_for_field_match("BUFFER_PG_TABLE", self.INTF + ":" + pg, {"profile": "[BUFFER_PROFILE_TABLE:{}]".format(orig_lossless_profile)})
fvs = dict()
for pg in self.pg_name_map:
fvs["SAI_INGRESS_PRIORITY_GROUP_ATTR_BUFFER_PROFILE"] = self.buf_pg_profile[pg]
Expand Down Expand Up @@ -222,7 +222,7 @@ def test_buffer_pg_update(self, dvs, setup_teardown_test):

# Verify BUFFER_PG is updated
for pg in self.lossless_pgs:
self.app_db.wait_for_field_match("BUFFER_PG_TABLE", self.INTF + ":" + pg, {"profile": new_lossless_profile})
self.app_db.wait_for_field_match("BUFFER_PG_TABLE", self.INTF + ":" + pg, {"profile": "[BUFFER_PROFILE_TABLE:{}]".format(new_lossless_profile)})

fvs_negative = {}
for pg in self.pg_name_map:
Expand All @@ -235,7 +235,7 @@ def test_buffer_pg_update(self, dvs, setup_teardown_test):
time.sleep(1)
# Verify BUFFER_PG is updated when pfc_enable is available
for pg in self.lossless_pgs:
self.app_db.wait_for_field_match("BUFFER_PG_TABLE", extra_port + ":" + pg, {"profile": new_lossless_profile})
self.app_db.wait_for_field_match("BUFFER_PG_TABLE", extra_port + ":" + pg, {"profile": "[BUFFER_PROFILE_TABLE:{}]".format(new_lossless_profile)})
finally:
if orig_cable_len:
self.change_cable_len(orig_cable_len, extra_port)
Expand Down

0 comments on commit 97f3027

Please sign in to comment.