-
Notifications
You must be signed in to change notification settings - Fork 546
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fc409b
commit 7b73c97
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from swsscommon import swsscommon | ||
from dvslib.dvs_database import DVSDatabase | ||
|
||
|
||
class TestVirtualChassis(object): | ||
def test_voq_switch_fabric_link(self, vst): | ||
"""Test fabric link manual isolation commands in VOQ switch. | ||
By issuing config fabric port isolation command, the value | ||
of isolateStatus field in config_db get changed. This test validates appl_db | ||
updates of a fabric link isolateStatus as the value in config_db changed. | ||
""" | ||
|
||
dvss = vst.dvss | ||
for name in dvss.keys(): | ||
dvs = dvss[name] | ||
# Get the config info | ||
config_db = dvs.get_config_db() | ||
metatbl = config_db.get_entry("DEVICE_METADATA", "localhost") | ||
|
||
cfg_switch_type = metatbl.get("switch_type") | ||
if cfg_switch_type == "fabric": | ||
|
||
# get config_db information | ||
cdb = dvs.get_config_db() | ||
# check if the link isolateStatus in config_db is False as a start value. | ||
cdb.wait_for_field_match("FABRIC_PORT", "Fabric1", {"isolateStatus": "False"}) | ||
|
||
# set config_db to isolateStatus: True | ||
cdb.update_entry("FABRIC_PORT", "Fabric1", {"isolateStatus": "True"}) | ||
cdb.wait_for_field_match("FABRIC_PORT", "Fabric1", {"isolateStatus": "True"}) | ||
|
||
# check if appl_db value changes to isolateStatus: True | ||
adb = dvs.get_app_db() | ||
adb.wait_for_field_match("FABRIC_PORT_TABLE", "Fabric1", {"isolateStatus": "True"}) | ||
|
||
# cleanup | ||
cdb.update_entry("FABRIC_PORT", "Fabric1", {"isolateStatus": "False"}) | ||
cdb.wait_for_field_match("FABRIC_PORT", "Fabric1", {"isolateStatus": "False"}) | ||
adb.wait_for_field_match("FABRIC_PORT_TABLE", "Fabric1", {"isolateStatus": "False"}) | ||
else: | ||
print( "We do not check switch type:", cfg_switch_type ) | ||
|
||
|
||
# Add Dummy always-pass test at end as workaroud | ||
# for issue when Flaky fail on final test it invokes module tear-down before retrying | ||
def test_nonflaky_dummy(): | ||
pass | ||
|
||
|