From 1656f4c8b1f227b2dd0d6331bfcc8975dbdbcad7 Mon Sep 17 00:00:00 2001 From: Jie Feng Date: Fri, 31 May 2024 23:07:05 -0700 Subject: [PATCH] Add test coverage --- tests/test_fabric_capacity.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_fabric_capacity.py b/tests/test_fabric_capacity.py index c202e8e3e0..cb10e09af2 100644 --- a/tests/test_fabric_capacity.py +++ b/tests/test_fabric_capacity.py @@ -64,6 +64,21 @@ def test_voq_switch_fabric_capacity(self, vst): config_db.update_entry("FABRIC_PORT", cdb_port, {"isolateStatus": "False"}) sdb.wait_for_field_match("FABRIC_PORT_TABLE", sdb_port, {"ISOLATED": "0"}, polling_config=max_poll) sdb.wait_for_field_match("FABRIC_CAPACITY_TABLE", "FABRIC_CAPACITY_DATA", {'operating_links': capacity}, polling_config=max_poll) + + # now disable fabric link monitor + 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) + # isolate the link from config_db + config_db.update_entry("FABRIC_PORT", cdb_port, {"isolateStatus": "True"}) + try: + max_poll = PollingConfig(polling_interval=30, timeout=90, strict=True) + sdb.wait_for_field_match("FABRIC_PORT_TABLE", sdb_port, {"ISOLATED": "1"}, polling_config=max_poll) + # check if capacity reduced + sdb.wait_for_field_negative_match("FABRIC_CAPACITY_TABLE", "FABRIC_CAPACITY_DATA", {'operating_links': capacity}, polling_config=max_poll) + assert False, "Expecting no change here" + except Exception as e: + # Expect field not change here + pass finally: # cleanup sdb.update_entry("FABRIC_PORT_TABLE", sdb_port, {"TEST_CRC_ERRORS": "0"})