Skip to content

Commit

Permalink
Merge branch 'master' into ci_workflow_rule
Browse files Browse the repository at this point in the history
  • Loading branch information
andy31415 authored Dec 2, 2022
2 parents 5c9f7f9 + 85aa144 commit ad01ab5
Show file tree
Hide file tree
Showing 53 changed files with 2,005 additions and 1,207 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/unit_integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

name: Unit / Interation Tests
name: Unit / Integration Tests

on:
push:
Expand All @@ -24,7 +24,7 @@ concurrency:

jobs:
unit_tests:
name: Unit / Interation Tests
name: Unit / Integration Tests
timeout-minutes: 60
if: github.actor != 'restyled-io[bot]'

Expand Down
2 changes: 1 addition & 1 deletion examples/chip-tool/commands/common/Command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/

#include "Command.h"
#include "platform/PlatformManager.h"

#include <functional>
#include <netdb.h>
#include <sstream>
#include <sys/socket.h>
Expand Down
1 change: 0 additions & 1 deletion examples/chip-tool/commands/common/Command.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <app/data-model/Nullable.h>
#include <commands/clusters/ComplexArgument.h>
#include <commands/clusters/CustomArgument.h>
#include <controller/CHIPDeviceController.h>
#include <inet/InetInterface.h>
#include <lib/core/Optional.h>
#include <lib/support/Span.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@
#pragma once

#include <app/util/basic-types.h>
#include <controller/CHIPDeviceControllerFactory.h>
#include <credentials/attestation_verifier/DeviceAttestationVerifier.h>
#include <lib/core/CHIPCore.h>
#include <lib/core/CHIPPersistentStorageDelegate.h>
#include <vector>

namespace chip {
namespace Controller {
struct SetupParams;
class OperationalCredentialsDelegate;
} // namespace Controller
} // namespace chip

class CredentialIssuerCommands
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include "DiscoverCommissionersCommand.h"
#include <arpa/inet.h>
#include <controller/CHIPDeviceController.h>

using namespace ::chip;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#pragma once

#include <commands/common/CredentialIssuerCommands.h>
#include <controller/CHIPDeviceControllerFactory.h>
#include <controller/ExampleOperationalCredentialsIssuer.h>
#include <credentials/DeviceAttestationCredsProvider.h>
#include <credentials/attestation_verifier/DefaultDeviceAttestationVerifier.h>
Expand Down
14 changes: 10 additions & 4 deletions examples/chip-tool/commands/pairing/PairingCommand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,23 @@ CHIP_ERROR PairingCommand::RunInternal(NodeId remoteId)

CommissioningParameters PairingCommand::GetCommissioningParameters()
{
auto params = CommissioningParameters();
params.SetSkipCommissioningComplete(mSkipCommissioningComplete.ValueOr(false));

switch (mNetworkType)
{
case PairingNetworkType::WiFi:
return CommissioningParameters().SetWiFiCredentials(Controller::WiFiCredentials(mSSID, mPassword));
params.SetWiFiCredentials(Controller::WiFiCredentials(mSSID, mPassword));
break;
case PairingNetworkType::Thread:
return CommissioningParameters().SetThreadOperationalDataset(mOperationalDataset);
params.SetThreadOperationalDataset(mOperationalDataset);
break;
case PairingNetworkType::Ethernet:
case PairingNetworkType::None:
return CommissioningParameters();
break;
}
return CommissioningParameters();

return params;
}

CHIP_ERROR PairingCommand::PaseWithCode(NodeId remoteId)
Expand Down
6 changes: 6 additions & 0 deletions examples/chip-tool/commands/pairing/PairingCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,27 +78,32 @@ class PairingCommand : public CHIPCommand,
case PairingMode::None:
break;
case PairingMode::Code:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
case PairingMode::CodePaseOnly:
AddArgument("payload", &mOnboardingPayload);
AddArgument("discover-once", 0, 1, &mDiscoverOnce);
AddArgument("use-only-onnetwork-discovery", 0, 1, &mUseOnlyOnNetworkDiscovery);
break;
case PairingMode::Ble:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("discriminator", 0, 4096, &mDiscriminator);
break;
case PairingMode::OnNetwork:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
case PairingMode::SoftAP:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("discriminator", 0, 4096, &mDiscriminator);
AddArgument("device-remote-ip", &mRemoteAddr);
AddArgument("device-remote-port", 0, UINT16_MAX, &mRemotePort);
AddArgument("pase-only", 0, 1, &mPaseOnly);
break;
case PairingMode::Ethernet:
AddArgument("skip-commissioning-complete", 0, 1, &mSkipCommissioningComplete);
AddArgument("setup-pin-code", 0, 134217727, &mSetupPINCode);
AddArgument("discriminator", 0, 4096, &mDiscriminator);
AddArgument("device-remote-ip", &mRemoteAddr);
Expand Down Expand Up @@ -169,6 +174,7 @@ class PairingCommand : public CHIPCommand,
chip::Optional<bool> mDiscoverOnce;
chip::Optional<bool> mUseOnlyOnNetworkDiscovery;
chip::Optional<bool> mPaseOnly;
chip::Optional<bool> mSkipCommissioningComplete;
uint16_t mRemotePort;
uint16_t mDiscriminator;
uint32_t mSetupPINCode;
Expand Down
68 changes: 54 additions & 14 deletions examples/darwin-framework-tool/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,6 @@ executable("darwin-framework-tool") {

deps = [
":build-darwin-framework",
"${chip_root}/src/app/tests/suites/commands/delay",

# IM is needed for MTRError
"${chip_root}/src/app/tests/suites/commands/interaction_model",

# Log is needed by tests UserPrompt and Log
"${chip_root}/src/app/tests/suites/commands/log",

# System is needed by tests FactoryReset etc..
"${chip_root}/src/app/tests/suites/commands/system",

# pics is needed by tests
"${chip_root}/src/app/tests/suites/pics",
"${chip_root}/third_party/inipp",
"${chip_root}/third_party/jsoncpp",
]

Expand All @@ -175,6 +161,60 @@ executable("darwin-framework-tool") {
"Security.framework",
]

# When config_enable_yaml_tests=true the Matter SDK is pulled in as a dependency because the code of the test suite
# uses some helpers from the Matter SDK. As a result, the SDK is built twice. Once because of this dependency and once
# when the Matter.framework is built.
# It may results in different versions of the Matter SDK between the output binary and the linked Matter.framework.
#
# When config_enable_yaml_tests=false the Matter SDK is built once when the Matter.framework is built and the resulting
# libCHIP.a library is linked statically to the output binary.
if (config_enable_yaml_tests) {
deps += [
"${chip_root}/src/app/tests/suites/commands/delay",

# IM is needed for MTRError
"${chip_root}/src/app/tests/suites/commands/interaction_model",

# Log is needed by tests UserPrompt and Log
"${chip_root}/src/app/tests/suites/commands/log",

# System is needed by tests FactoryReset etc..
"${chip_root}/src/app/tests/suites/commands/system",

# pics is needed by tests
"${chip_root}/src/app/tests/suites/pics",
]
} else {
include_dirs = [
"${chip_root}/config/standalone/",
"${chip_root}/src/",
"${chip_root}/src/include/",
"${chip_root}/third_party/nlassert/repo/include/",
"${chip_root}/third_party/nlio/repo/include/",
"${chip_root}/zzz_generated/app-common/",
"${root_gen_dir}/include",
"${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/gen/include",
]

defines = [
"CHIP_HAVE_CONFIG_H=1",
"CHIP_SYSTEM_CONFIG_USE_SOCKETS=1",
]

frameworks += [
"CoreFoundation.framework",
"Foundation.framework",
"CoreBluetooth.framework",
"Network.framework",
]

# Other SDKs are linked statically to Matter.framework but the macosx SDK is linked dynamically but needs some symbols that are
# not exposed by the dylib.
if (sdk == "macosx") {
libs = [ "${root_out_dir}/macos_framework_output/Build/Intermediates.noindex/Matter.build/${output_sdk_type}/Matter.build/out/lib/libCHIP.a" ]
}
}

public_configs = [ ":config" ]

output_dir = root_out_dir
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
class ModelCommand : public CHIPCommandBridge
{
public:
using ChipDevice = ::chip::OperationalDeviceProxy;

ModelCommand(const char * _Nonnull commandName) : CHIPCommandBridge(commandName) {}

void AddArguments()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <commands/common/Command.h>
#include <commands/common/CredentialIssuerCommands.h>
#include <map>
#include <set>
#include <string>

#include "../provider/OTAProviderDelegate.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ class OpenCommissioningWindowCommand : public CHIPCommandBridge
"1 to use Enhanced Commissioning Method.\n 0 to use Basic Commissioning Method.");
AddArgument("window-timeout", 0, UINT16_MAX, &mCommissioningWindowTimeoutMs,
"Time, in seconds, before the commissioning window closes.");
AddArgument("iteration", chip::kSpake2p_Min_PBKDF_Iterations, chip::kSpake2p_Max_PBKDF_Iterations, &mIteration,
"Number of PBKDF iterations to use to derive the verifier. Ignored if 'option' is 0.");
AddArgument("iteration", chip::Crypto::kSpake2p_Min_PBKDF_Iterations, chip::Crypto::kSpake2p_Max_PBKDF_Iterations,
&mIteration, "Number of PBKDF iterations to use to derive the verifier. Ignored if 'option' is 0.");
AddArgument("discriminator", 0, 4096, &mDiscriminator, "Discriminator to use for advertising. Ignored if 'option' is 0.");
AddArgument("timeout", 0, UINT16_MAX, &mTimeout, "Time, in seconds, before this command is considered to have timed out.");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#if CONFIG_ENABLE_YAML_TESTS

#include <app/util/af-enums.h>
#include <commands/tests/TestCommandBridge.h>
#include <lib/core/Optional.h>
#include <system/SystemClock.h>
Expand Down
Loading

0 comments on commit ad01ab5

Please sign in to comment.