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="$(GetPeerConnectionState(mSecureSession); - VerifyOrReturnError(connectionState != nullptr, CHIP_ERROR_INCORRECT_STATE); + if (connectionState == nullptr) + { + // Nothing needs to be done here. It's not an error to not have a + // connectionState. For one thing, we could have gotten an different + // UpdateAddress already and that caused connections to be torn down and + // whatnot. + return CHIP_NO_ERROR; + } mDeviceAddress = addr; connectionState->SetPeerAddress(addr);