diff --git a/tests/conftest.py b/tests/conftest.py index 9b565cfa06..dafbc04309 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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) diff --git a/tests/test_buffer_traditional.py b/tests/test_buffer_traditional.py index ae8f0b9e2e..c90bb80919 100644 --- a/tests/test_buffer_traditional.py +++ b/tests/test_buffer_traditional.py @@ -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] @@ -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: @@ -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)