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

Use CASE for our "Tests" test suite. #7896

Merged
merged 1 commit into from
Jun 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion scripts/tests/test_suites.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ for j in "${iter_array[@]}"; do
# the data is there yet.
background_pid="$(</tmp/pid)"
echo " * Pairing to device"
out/debug/standalone/chip-tool pairing onnetwork 1 20202021 3840 ::1 11097
out/debug/standalone/chip-tool pairing onnetwork 0 20202021 3840 ::1 11097
echo " * Starting test run: $i"
out/debug/standalone/chip-tool tests "$i"
# Prevent cleanup trying to kill a process we already killed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ bool emberAfOperationalCredentialsClusterAddOpCertCallback(chip::app::Command *
// can't just wait until we get network configuration commands, because we
// might be on the operational network already, in which case we are
// expected to be live with our new identity at this point.
chip::app::Mdns::StartServer();
chip::app::Mdns::AdvertiseOperational();

exit:
emberAfSendImmediateDefaultResponse(status);
Expand Down
9 changes: 8 additions & 1 deletion src/controller/CHIPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,14 @@ CHIP_ERROR Device::UpdateAddress(const Transport::PeerAddress & addr)
ReturnErrorOnFailure(LoadSecureSessionParametersIfNeeded(didLoad));

Transport::PeerConnectionState * connectionState = mSessionManager->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);
Expand Down