diff --git a/tests/test_fabric_capacity.py b/tests/test_fabric_capacity.py index a796e9f6bf..c202e8e3e0 100644 --- a/tests/test_fabric_capacity.py +++ b/tests/test_fabric_capacity.py @@ -17,14 +17,17 @@ def test_voq_switch_fabric_capacity(self, vst): dvs = dvss[name] # Get the config information and choose a linecard or fabric card to test. config_db = dvs.get_config_db() + adb = dvs.get_app_db() metatbl = config_db.get_entry("DEVICE_METADATA", "localhost") cfg_switch_type = metatbl.get("switch_type") if cfg_switch_type == "fabric": max_poll = PollingConfig(polling_interval=60, timeout=600, strict=True) + config_db.update_entry("FABRIC_MONITOR", "FABRIC_MONITOR_DATA",{'monState': 'disable'}) + adb.wait_for_field_match("FABRIC_MONITOR_TABLE","FABRIC_MONITOR_DATA", {'monState': 'disable'}, polling_config=max_poll) + # enable monitoring config_db.update_entry("FABRIC_MONITOR", "FABRIC_MONITOR_DATA",{'monState': 'enable'}) - adb = dvs.get_app_db() adb.wait_for_field_match("FABRIC_MONITOR_TABLE","FABRIC_MONITOR_DATA", {'monState': 'enable'}, polling_config=max_poll) # get state_db infor @@ -39,8 +42,12 @@ def test_voq_switch_fabric_capacity(self, vst): sdb.update_entry("FABRIC_PORT_TABLE", sdb_port, {"TEST": "TEST"}) # get current fabric capacity - capacity = sdb.get_entry("FABRIC_CAPACITY_TABLE", "FABRIC_CAPACITY_DATA")['operating_links'] - if sdb.get_entry("FABRIC_PORT_TABLE", sdb_port)['STATUS'] == 'up': + fvs = sdb.wait_for_fields("FABRIC_CAPACITY_TABLE", "FABRIC_CAPACITY_DATA",['operating_links'], polling_config=max_poll) + capacity = fvs['operating_links'] + + fvs = sdb.wait_for_fields("FABRIC_PORT_TABLE", sdb_port, ['STATUS'], polling_config=max_poll) + link_status = fvs['STATUS'] + if link_status == 'up': try: # clean up the testing port. # set TEST_CRC_ERRORS to 0 diff --git a/tests/test_fabric_rate.py b/tests/test_fabric_rate.py index 1885aca2a9..4a135b6dd6 100644 --- a/tests/test_fabric_rate.py +++ b/tests/test_fabric_rate.py @@ -17,14 +17,16 @@ def test_voq_switch_fabric_rate(self, vst): dvs = dvss[name] # Get the config info config_db = dvs.get_config_db() + adb = dvs.get_app_db() metatbl = config_db.get_entry("DEVICE_METADATA", "localhost") cfg_switch_type = metatbl.get("switch_type") if cfg_switch_type == "fabric": max_poll = PollingConfig(polling_interval=60, timeout=600, strict=True) + config_db.update_entry("FABRIC_MONITOR", "FABRIC_MONITOR_DATA",{'monState': 'disable'}) + adb.wait_for_field_match("FABRIC_MONITOR_TABLE","FABRIC_MONITOR_DATA", {'monState': 'disable'}, polling_config=max_poll) config_db.update_entry("FABRIC_MONITOR", "FABRIC_MONITOR_DATA",{'monState': 'enable'}) - adb = dvs.get_app_db() adb.wait_for_field_match("FABRIC_MONITOR_TABLE","FABRIC_MONITOR_DATA", {'monState': 'enable'}, polling_config=max_poll) # get state_db infor sdb = dvs.get_state_db() @@ -35,7 +37,9 @@ def test_voq_switch_fabric_rate(self, vst): portNum = random.randint(1, 16) sdb_port = "PORT"+str(portNum) - tx_rate = sdb.get_entry("FABRIC_PORT_TABLE", sdb_port)['OLD_TX_DATA'] + fvs = sdb.wait_for_fields("FABRIC_PORT_TABLE", sdb_port, ['OLD_TX_DATA'], polling_config=max_poll) + tx_rate = fvs['OLD_TX_DATA'] + sdb.update_entry("FABRIC_PORT_TABLE", sdb_port, {"TEST": "TEST"}) sdb.wait_for_field_negative_match("FABRIC_PORT_TABLE", sdb_port, {'OLD_TX_DATA': tx_rate}, polling_config=max_poll) finally: