From 68b1e2abba69a9d5d7905a90ccdcff9047b989b7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 24 Jun 2021 23:25:50 -0400 Subject: [PATCH] Use CASE for our "Tests" test suite. There are three changes here: 1) When doing onnetwork commissioning, make sure to run the part of the commissioning state machine that is meant to run on the operational network, starting with the mdns resolution of the device operational address. This ensures that we put ourselves into a state where we know the operational cert is fully provisioned on the device and we can talk to it via CASE. 2) Fix the fabric id in the script's pairing command to match the fabric id all-clusters-app advertises, so our operational discovery looks for the right thing. 3) Ensure that we actually start operational advertisement when we get a new opcert. Just restarting our mdns server does not do that, due to https://github.com/project-chip/connectedhomeip/issues/7911 --- .../chip-tool/commands/pairing/PairingCommand.cpp | 12 +++++++++--- scripts/tests/test_suites.sh | 2 +- .../operational-credentials-server.cpp | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/examples/chip-tool/commands/pairing/PairingCommand.cpp b/examples/chip-tool/commands/pairing/PairingCommand.cpp index 51c6080fc678c5..f21554299fcd45 100644 --- a/examples/chip-tool/commands/pairing/PairingCommand.cpp +++ b/examples/chip-tool/commands/pairing/PairingCommand.cpp @@ -110,11 +110,15 @@ void PairingCommand::OnPairingComplete(CHIP_ERROR err) if (err == CHIP_NO_ERROR) { ChipLogProgress(chipTool, "Pairing Success"); - SetupNetwork(); + err = SetupNetwork(); } else { ChipLogProgress(chipTool, "Pairing Failure: %s", ErrorStr(err)); + } + + if (err != CHIP_NO_ERROR) + { SetCommandExitStatus(err); } } @@ -156,8 +160,10 @@ CHIP_ERROR PairingCommand::SetupNetwork() { case PairingNetworkType::None: case PairingNetworkType::Ethernet: - // Nothing to do - SetCommandExitStatus(err); + // Nothing to do other than to resolve the device's operational address. + err = UpdateNetworkAddress(); + VerifyOrExit(err == CHIP_NO_ERROR, + ChipLogError(chipTool, "Setup failure! Error calling UpdateNetworkAddress: %s", ErrorStr(err))); break; case PairingNetworkType::WiFi: case PairingNetworkType::Thread: diff --git a/scripts/tests/test_suites.sh b/scripts/tests/test_suites.sh index a8404345451c3b..0aa875e183dcee 100755 --- a/scripts/tests/test_suites.sh +++ b/scripts/tests/test_suites.sh @@ -88,7 +88,7 @@ for j in "${iter_array[@]}"; do # the data is there yet. background_pid="$(