diff --git a/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h b/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h index b6c15f4c98230e..7da9b435f152ef 100644 --- a/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h +++ b/examples/all-clusters-app/linux/include/CHIPProjectAppConfig.h @@ -32,3 +32,6 @@ // Allows app options (ports) to be configured on launch of app #define CHIP_DEVICE_ENABLE_PORT_PARAMS 1 + +// Expose the device type in the advertisement for CI testing. +#define CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONABLE_DEVICE_TYPE 1 diff --git a/src/app/tests/suites/TestDiscovery.yaml b/src/app/tests/suites/TestDiscovery.yaml index b41299870c88fb..c4f1afc08be9f8 100644 --- a/src/app/tests/suites/TestDiscovery.yaml +++ b/src/app/tests/suites/TestDiscovery.yaml @@ -31,7 +31,7 @@ config: defaultValue: 32769 deviceType: type: int16u - defaultValue: 5 + defaultValue: 65535 tests: - label: "Stop target device" @@ -105,8 +105,6 @@ tests: - label: "Check Hostname" PICS: "(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR" - # On macOS the hostname is the device name and because of it this test is disabled for now. - disabled: true cluster: "DiscoveryCommands" command: "FindCommissionable" response: @@ -114,14 +112,12 @@ tests: - name: "hostName" constraints: minLength: 12 - maxLength: 12 + maxLength: 16 isUpperCase: true isHexString: true - label: "Check Hostname" PICS: "(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR" - # On macOS the hostname is the device name and because of it this test is disabled for now. - disabled: true cluster: "DiscoveryCommands" command: "FindCommissionable" response: @@ -165,8 +161,6 @@ tests: value: vendorId - label: "Check Device Type ID (_T)" - # The device type is not broadcasted by the accessory under CI. - disabled: true PICS: MCORE.SC.DEVTYPE_SUBTYPE cluster: "DiscoveryCommands" command: "FindCommissionableByDeviceType" @@ -217,6 +211,7 @@ tests: values: - name: "mrpRetryIntervalIdle" constraints: + minValue: 0 maxValue: 3600000 - label: "Optional TXT key for MRP Sleepy Active Interval (SAI)" @@ -227,6 +222,7 @@ tests: values: - name: "mrpRetryIntervalActive" constraints: + minValue: 0 maxValue: 3600000 - label: "TXT key for commissioning mode (CM)" @@ -238,7 +234,6 @@ tests: value: 1 - label: "Optional TXT key for device type (DT)" - disabled: true PICS: MCORE.SC.DT_KEY cluster: "DiscoveryCommands" command: "FindCommissionable" @@ -246,10 +241,6 @@ tests: values: - name: "deviceType" value: deviceType - constraints: - # The specification says this is a number expressed as , but it seems like it can goes - # up to 0xBFFF (49151). - maxValue: 999 - label: "Optional TXT key for device name (DN)" PICS: MCORE.SC.DN_KEY diff --git a/src/app/tests/suites/certification/ci-pics-values b/src/app/tests/suites/certification/ci-pics-values index a9de920c7bee25..c2aeee0e6abe43 100644 --- a/src/app/tests/suites/certification/ci-pics-values +++ b/src/app/tests/suites/certification/ci-pics-values @@ -1835,7 +1835,7 @@ MCORE.SC.DEVTYPE_SUBTYPE=1 MCORE.SC.VP_KEY=1 MCORE.SC.DT_KEY=1 MCORE.SC.DN_KEY=1 -MCORE.SC.RI_KEY=1 +MCORE.SC.RI_KEY=0 MCORE.SC.PH_KEY=1 MCORE.SC.PI_KEY=1 MCORE.SC.EXTENDED_DISCOVERY=1 diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 63b41695f40832..e05ff01df48e43 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -65839,7 +65839,7 @@ class TestEventsSuite : public TestCommand class TestDiscoverySuite : public TestCommand { public: - TestDiscoverySuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestDiscovery", 26, credsIssuerConfig) + TestDiscoverySuite(CredentialIssuerCommands * credsIssuerConfig) : TestCommand("TestDiscovery", 30, credsIssuerConfig) { AddArgument("nodeId", 0, UINT64_MAX, &mNodeId); AddArgument("endpoint", 0, UINT16_MAX, &mEndpoint); @@ -65935,6 +65935,10 @@ class TestDiscoverySuite : public TestCommand { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 12)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); } shouldContinue = true; break; @@ -65943,6 +65947,10 @@ class TestDiscoverySuite : public TestCommand { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckConstraintMinLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintMaxLength("value.hostName", value.hostName, 16)); + VerifyOrReturn(CheckConstraintIsUpperCase("value.hostName", value.hostName, true)); + VerifyOrReturn(CheckConstraintIsHexString("value.hostName", value.hostName, true)); } shouldContinue = true; break; @@ -65963,6 +65971,30 @@ class TestDiscoverySuite : public TestCommand shouldContinue = true; break; case 11: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 12: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 13: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + } + shouldContinue = true; + break; + case 14: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -65974,7 +66006,7 @@ class TestDiscoverySuite : public TestCommand } shouldContinue = true; break; - case 12: + case 15: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -65983,33 +66015,37 @@ class TestDiscoverySuite : public TestCommand } shouldContinue = true; break; - case 13: + case 16: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); if (value.mrpRetryIntervalIdle.HasValue()) { + VerifyOrReturn( + CheckConstraintMinValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), 0UL)); VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalIdle.Value()", value.mrpRetryIntervalIdle.Value(), 3600000UL)); } } shouldContinue = true; break; - case 14: + case 17: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); if (value.mrpRetryIntervalActive.HasValue()) { + VerifyOrReturn( + CheckConstraintMinValue("value.mrpRetryIntervalActive.Value()", value.mrpRetryIntervalActive.Value(), 0UL)); VerifyOrReturn(CheckConstraintMaxValue("value.mrpRetryIntervalActive.Value()", value.mrpRetryIntervalActive.Value(), 3600000UL)); } } shouldContinue = true; break; - case 15: + case 18: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -66018,7 +66054,16 @@ class TestDiscoverySuite : public TestCommand } shouldContinue = true; break; - case 16: + case 19: + VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); + { + chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("deviceType", value.deviceType, mDeviceType.HasValue() ? mDeviceType.Value() : 65535U)); + } + shouldContinue = true; + break; + case 20: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -66027,7 +66072,7 @@ class TestDiscoverySuite : public TestCommand } shouldContinue = true; break; - case 17: + case 21: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -66036,7 +66081,7 @@ class TestDiscoverySuite : public TestCommand } shouldContinue = true; break; - case 18: + case 22: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -66045,7 +66090,7 @@ class TestDiscoverySuite : public TestCommand } shouldContinue = true; break; - case 19: + case 23: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -66054,7 +66099,7 @@ class TestDiscoverySuite : public TestCommand } shouldContinue = true; break; - case 20: + case 24: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -66063,22 +66108,22 @@ class TestDiscoverySuite : public TestCommand } shouldContinue = true; break; - case 21: + case 25: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 22: + case 26: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 23: + case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); shouldContinue = true; break; - case 24: + case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); break; - case 25: + case 29: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); { chip::app::Clusters::DiscoveryCommands::Commands::DiscoveryCommandResponse::DecodableType value; @@ -66167,123 +66212,154 @@ class TestDiscoverySuite : public TestCommand return FindCommissionable(kIdentityAlpha, value); } case 7: { - LogStep(7, "Check Long Discriminator _L"); + LogStep(7, "Check Hostname"); + VerifyOrDo(!ShouldSkip("(MCORE.COM.WIFI || MCORE.COM.ETH) && !MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 8: { + LogStep(8, "Check Hostname"); + VerifyOrDo(!ShouldSkip("(!MCORE.COM.WIFI && !MCORE.COM.ETH) && MCORE.COM.THR"), + return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 9: { + LogStep(9, "Check Long Discriminator _L"); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByLongDiscriminator::Type value; value.value = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840ULL; return FindCommissionableByLongDiscriminator(kIdentityAlpha, value); } - case 8: { - LogStep(8, "Check Short Discriminator (_S)"); + case 10: { + LogStep(10, "Check Short Discriminator (_S)"); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByShortDiscriminator::Type value; value.value = mShortDiscriminator.HasValue() ? mShortDiscriminator.Value() : 15ULL; return FindCommissionableByShortDiscriminator(kIdentityAlpha, value); } - case 9: { - LogStep(9, "Check Commissioning Mode (_CM)"); + case 11: { + LogStep(11, "Check Commissioning Mode (_CM)"); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByCommissioningMode::Type value; return FindCommissionableByCommissioningMode(kIdentityAlpha, value); } - case 10: { - LogStep(10, "Check Vendor ID (_V)"); + case 12: { + LogStep(12, "Check Vendor ID (_V)"); VerifyOrDo(!ShouldSkip("MCORE.SC.VENDOR_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByVendorId::Type value; value.value = mVendorId.HasValue() ? mVendorId.Value() : 65521ULL; return FindCommissionableByVendorId(kIdentityAlpha, value); } - case 11: { - LogStep(11, "TXT key for discriminator (D)"); + case 13: { + LogStep(13, "Check Device Type ID (_T)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DEVTYPE_SUBTYPE"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionableByDeviceType::Type value; + value.value = mDeviceType.HasValue() ? mDeviceType.Value() : 65535ULL; + return FindCommissionableByDeviceType(kIdentityAlpha, value); + } + case 14: { + LogStep(14, "TXT key for discriminator (D)"); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 12: { - LogStep(12, "TXT key for Vendor ID and Product ID (VP)"); + case 15: { + LogStep(15, "TXT key for Vendor ID and Product ID (VP)"); VerifyOrDo(!ShouldSkip("MCORE.SC.VP_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 13: { - LogStep(13, "Optional TXT key for MRP Sleepy Idle Interval (SII)"); + case 16: { + LogStep(16, "Optional TXT key for MRP Sleepy Idle Interval (SII)"); VerifyOrDo(!ShouldSkip("MCORE.SC.SII_COMM_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 14: { - LogStep(14, "Optional TXT key for MRP Sleepy Active Interval (SAI)"); + case 17: { + LogStep(17, "Optional TXT key for MRP Sleepy Active Interval (SAI)"); VerifyOrDo(!ShouldSkip("MCORE.SC.SAI_COMM_DISCOVERY_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 15: { - LogStep(15, "TXT key for commissioning mode (CM)"); + case 18: { + LogStep(18, "TXT key for commissioning mode (CM)"); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 16: { - LogStep(16, "Optional TXT key for device name (DN)"); + case 19: { + LogStep(19, "Optional TXT key for device type (DT)"); + VerifyOrDo(!ShouldSkip("MCORE.SC.DT_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + ListFreer listFreer; + chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; + return FindCommissionable(kIdentityAlpha, value); + } + case 20: { + LogStep(20, "Optional TXT key for device name (DN)"); VerifyOrDo(!ShouldSkip("MCORE.SC.DN_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 17: { - LogStep(17, "Optional TXT key for rotating device identifier (RI)"); + case 21: { + LogStep(21, "Optional TXT key for rotating device identifier (RI)"); VerifyOrDo(!ShouldSkip("MCORE.SC.RI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 18: { - LogStep(18, "Optional TXT key for pairing hint (PH)"); + case 22: { + LogStep(22, "Optional TXT key for pairing hint (PH)"); VerifyOrDo(!ShouldSkip("MCORE.SC.PH_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 19: { - LogStep(19, "Optional TXT key for pairing instructions (PI)"); + case 23: { + LogStep(23, "Optional TXT key for pairing instructions (PI)"); VerifyOrDo(!ShouldSkip("MCORE.SC.PI_KEY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 20: { - LogStep(20, "Check IPs"); + case 24: { + LogStep(24, "Check IPs"); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value); } - case 21: { - LogStep(21, "Stop target device"); + case 25: { + LogStep(25, "Stop target device"); ListFreer listFreer; chip::app::Clusters::SystemCommands::Commands::Stop::Type value; return Stop(kIdentityAlpha, value); } - case 22: { - LogStep(22, "Start target device with the provided discriminator for basic commissioning advertisement"); + case 26: { + LogStep(26, "Start target device with the provided discriminator for basic commissioning advertisement"); ListFreer listFreer; chip::app::Clusters::SystemCommands::Commands::Start::Type value; value.discriminator.Emplace(); value.discriminator.Value() = mDiscriminator.HasValue() ? mDiscriminator.Value() : 3840U; return Start(kIdentityAlpha, value); } - case 23: { - LogStep(23, "Wait for the commissioned device to be retrieved"); + case 27: { + LogStep(27, "Wait for the commissioned device to be retrieved"); ListFreer listFreer; chip::app::Clusters::DelayCommands::Commands::WaitForCommissionee::Type value; value.nodeId = mNodeId.HasValue() ? mNodeId.Value() : 305414945ULL; return WaitForCommissionee(kIdentityAlpha, value); } - case 24: { - LogStep(24, "Open Commissioning Window"); + case 28: { + LogStep(28, "Open Commissioning Window"); ListFreer listFreer; chip::app::Clusters::AdministratorCommissioning::Commands::OpenBasicCommissioningWindow::Type value; value.commissioningTimeout = 180U; @@ -66293,8 +66369,8 @@ class TestDiscoverySuite : public TestCommand ); } - case 25: { - LogStep(25, "Check Instance Name"); + case 29: { + LogStep(29, "Check Instance Name"); ListFreer listFreer; chip::app::Clusters::DiscoveryCommands::Commands::FindCommissionable::Type value; return FindCommissionable(kIdentityAlpha, value);