Skip to content

Commit

Permalink
[cirque] Enable TestResolve (#9321)
Browse files Browse the repository at this point in the history
  • Loading branch information
erjiaqing authored and pull[bot] committed Sep 28, 2021
1 parent 2a45c20 commit 8045924
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/controller/python/test/test_scripts/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,20 @@ def TestOnOffCluster(self, nodeid: int, endpoint: int, group: int):
return False
return True

def TestResolve(self, fabricid, nodeid):
def TestResolve(self, nodeid):
fabricid = self.devCtrl.GetCompressedFabricId()
self.logger.info(
"Resolve {} with fabric id: {}".format(nodeid, fabricid))
"Resolve: node id = {:08x} (compressed) fabric id = {:08x}".format(nodeid, fabricid))
try:
self.devCtrl.ResolveNode(fabricid=fabricid, nodeid=nodeid)
addr = self.devCtrl.GetAddressAndPort(nodeid)
if not addr:
return False
self.logger.info(f"Resolved address: {addr[0]}:{addr[1]}")
return True
except Exception as ex:
self.logger.exception("Failed to resolve. {}".format(ex))
return False

def TestReadBasicAttribiutes(self, nodeid: int, endpoint: int, group: int):
basic_cluster_attrs = {
Expand Down
9 changes: 9 additions & 0 deletions src/controller/python/test/test_scripts/mobile-device-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ def main():
logger.info("Testing closing sessions")
FailIfNot(test.TestCloseSession(nodeid=1), "Failed to close sessions")

logger.info("Testing resolve")
FailIfNot(test.TestResolve(nodeid=1),
"Failed to resolve nodeid")

logger.info("Testing on off cluster over resolved connection")
FailIfNot(test.TestOnOffCluster(nodeid=1,
endpoint=LIGHTING_ENDPOINT_ID,
group=GROUP_ID), "Failed to test on off cluster")

logger.info("Testing non-controller APIs")
FailIfNot(test.TestNonControllerAPIs(), "Non controller API test failed")

Expand Down

0 comments on commit 8045924

Please sign in to comment.