Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[controller] Add IP rendezvous feature to CHIP Device controller #4050

Merged
merged 16 commits into from
Dec 9, 2020
Prev Previous commit
Next Next commit
Update cirque tests
erjiaqing committed Dec 2, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b5a9394f9af6478d1d1d61f12bec19d413b3ccc8
26 changes: 18 additions & 8 deletions src/test_driver/linux-cirque/test-on-off-cluster.py
Original file line number Diff line number Diff line change
@@ -46,6 +46,8 @@
}
}

SETUPPINCODE = 12345678
DISCRIMINATOR = 1 # Randomw number, not used
CHIP_PORT = 11097

CIRQUE_URL = "http://localhost:5000"
@@ -80,22 +82,30 @@ def run_data_model_test(self):
command = "chip-tool onoff {} 1"

for ip in server_ip_address:
ret = self.execute_device_cmd(tool_device_id, "chip-tool pairing bypass {} {}".format(ip, CHIP_PORT))
self.assertEqual(ret['return_code'], '0', "{} command failure: {}".format("pairing bypass", ret['output']))
ret = self.execute_device_cmd(
tool_device_id, "chip-tool pairing softap ssid_not_used passwd_not_used {} {} {} {}".format(SETUPPINCODE, DISCRIMINATOR, ip, CHIP_PORT))
self.assertEqual(ret['return_code'], '0', "{} command failure: {}".format(
"pairing bypass", ret['output']))

ret = self.execute_device_cmd(tool_device_id, command.format("on"))
self.assertEqual(ret['return_code'], '0', "{} command failure: {}".format("on", ret['output']))
self.assertEqual(
ret['return_code'], '0', "{} command failure: {}".format("on", ret['output']))

ret = self.execute_device_cmd(tool_device_id, command.format("off"))
self.assertEqual(ret['return_code'], '0', "{} command failure: {}".format("off", ret['output']))
ret = self.execute_device_cmd(
tool_device_id, command.format("off"))
self.assertEqual(
ret['return_code'], '0', "{} command failure: {}".format("off", ret['output']))

ret = self.execute_device_cmd(tool_device_id, "chip-tool pairing unpair")
self.assertEqual(ret['return_code'], '0', "{} command failure: {}".format("pairing unpair", ret['output']))
ret = self.execute_device_cmd(
tool_device_id, "chip-tool pairing unpair")
self.assertEqual(ret['return_code'], '0', "{} command failure: {}".format(
"pairing unpair", ret['output']))

time.sleep(1)

for device_id in server_ids:
self.logger.info("checking device log for {}".format(self.get_device_pretty_id(device_id)))
self.logger.info("checking device log for {}".format(
self.get_device_pretty_id(device_id)))
self.assertTrue(self.sequenceMatch(self.get_device_log(device_id).decode('utf-8'), ["LightingManager::InitiateAction(ON_ACTION)", "LightingManager::InitiateAction(OFF_ACTION)"]),
"Datamodel test failed: cannot find matching string from device {}".format(device_id))