diff --git a/examples/chip-tool/templates/tests.js b/examples/chip-tool/templates/tests.js index 1fc8ad121317be..960acac831ccae 100644 --- a/examples/chip-tool/templates/tests.js +++ b/examples/chip-tool/templates/tests.js @@ -67,6 +67,12 @@ function getTests() const MediaControl = [ 'Test_TC_MC_1_1', + 'Test_TC_MC_3_6', + 'Test_TC_MC_3_7', + 'Test_TC_MC_3_8', + 'Test_TC_MC_3_9', + 'Test_TC_MC_3_10', + 'Test_TC_MC_3_11', ]; const OnOff = [ diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_10.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_10.yaml new file mode 100644 index 00000000000000..5bfdfd6c36e9bf --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_10.yaml @@ -0,0 +1,29 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.5.3. [TC-MC-3.10] Show and Hide Input Status Verification + +config: + cluster: "Media Input" + endpoint: 1 + +tests: + # TDOD: Enable when SDK supports command + - label: "Hide Input Status Command" + disabled: true + command: "HideInputStatus" + # TDOD: Enable when SDK supports command + - label: "Show Input Status Command" + disabled: true + command: "ShowInputStatus" diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_11.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_11.yaml new file mode 100644 index 00000000000000..485a6557f974c6 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_11.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.5.4. [TC-MC-3.11] Rename Input Verification + +config: + cluster: "Media Input" + endpoint: 1 + +tests: + # Remove disable flag when SDK supports command. + - label: "Rename Input Command" + disabled: true + command: "RenameInput" + arguments: + values: + - name: "index" + value: 1 + - name: "name" + value: "A1" + # Remove disable flag when SDK supports command. + - label: "Rename Input Command" + disabled: true + command: "RenameInput" + arguments: + values: + - name: "index" + value: 1 + - name: "name" + value: "A2" + # Remove disable flag when SDK supports command. + - label: "Read attribute media input list" + disabled: true + command: "readAttribute" + attribute: "media input list" + response: + value: [] diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_6.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_6.yaml new file mode 100644 index 00000000000000..48542c9e424273 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_6.yaml @@ -0,0 +1,70 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.4.2. [TC-MC-3.6] Current App Verification + +config: + cluster: "Application Launcher" + endpoint: 1 + +tests: + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update response value to correspond with catalog vendor ID + - label: "Read Current catalog vendor id attribute." + disabled: true + command: "readAttribute" + attribute: "catalog vendor id" + response: + value: 1234 + constraints: + type: uint16 + + # TODO: Update response value to correspond with application ID + - label: "Read Current App ID attribute." + disabled: true + command: "readAttribute" + attribute: "application id" + response: + value: "HelloWorldApp" + constraints: + type: string + + # TODO: Update the corresponding values when feature is supported + - label: "Stop an app with the provided application ID" + disabled: true + command: "StopApp" + arguments: + values: + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update response value to correspond with application ID + - label: "Read Current App ID attribute." + disabled: true + command: "readAttribute" + attribute: "application id" + response: + value: null diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_7.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_7.yaml new file mode 100644 index 00000000000000..310ac4cce8284d --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_7.yaml @@ -0,0 +1,85 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.4.2. [TC-MC-3.6] Current App Verification + +config: + cluster: "Application Launcher" + endpoint: 1 + +tests: + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update the corresponding values when feature is supported + - label: "Stop an app with the provided application ID" + disabled: true + command: "StopApp" + arguments: + values: + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "NonAvailableApp" + response: + error: 1 + + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "HelloWorldApp" + + # TODO: Update the corresponding values when feature is supported + - label: "Launch an app with the provided a application ID" + disabled: true + command: "LaunchApp" + arguments: + values: + - name: "data" + value: "Hello World" + - name: "catalogVendorId" + value: 1234 + - name: "applicationId" + value: "HelloWorldApp2" + response: + error: 2 diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_8.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_8.yaml new file mode 100644 index 00000000000000..09a29a5bceff69 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_8.yaml @@ -0,0 +1,28 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.5.1. [TC-MC-3.8] Input List Verification + +config: + cluster: "Media Input" + endpoint: 1 + +tests: + # TODO: Enable test and update response value when SDK supports. + - label: "Read attribute media input list" + disabled: true + command: "readAttribute" + attribute: "media input list" + response: + value: [] diff --git a/src/app/tests/suites/certification/Test_TC_MC_3_9.yaml b/src/app/tests/suites/certification/Test_TC_MC_3_9.yaml new file mode 100644 index 00000000000000..2b287b78c8ac80 --- /dev/null +++ b/src/app/tests/suites/certification/Test_TC_MC_3_9.yaml @@ -0,0 +1,36 @@ +# Copyright (c) 2021 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: 21.5.2. [TC-MC-3.9] Select Input Verification + +config: + cluster: "Media Input" + endpoint: 1 + +tests: + # Remove disable flag when SDK supports command. + - label: "Select Input Command" + disabled: true + command: "SelectInput" + arguments: + values: + - name: "index" + value: 1 + # Remove disable flag when SDK supports attribute. + - label: "Read current input list" + disabled: true + command: "readAttribute" + attribute: "current media input" + response: + value: 1 diff --git a/src/darwin/Framework/CHIP/templates/tests.js b/src/darwin/Framework/CHIP/templates/tests.js index 55c665528ea87d..f6031dbe25997d 100644 --- a/src/darwin/Framework/CHIP/templates/tests.js +++ b/src/darwin/Framework/CHIP/templates/tests.js @@ -67,6 +67,12 @@ function getTests() const MediaControl = [ 'Test_TC_MC_1_1', + 'Test_TC_MC_3_6', + 'Test_TC_MC_3_7', + 'Test_TC_MC_3_8', + 'Test_TC_MC_3_9', + 'Test_TC_MC_3_10', + 'Test_TC_MC_3_11', ]; const OnOff = [ diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 7fbdea45a81f0e..ff3a598d0a54de 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -11748,6 +11748,294 @@ class Test_TC_MC_1_1 : public TestCommand void OnSuccessResponse_0(uint16_t clusterRevision) { ThrowSuccessResponse(); } }; +class Test_TC_MC_3_6 : public TestCommand +{ +public: + Test_TC_MC_3_6() : TestCommand("Test_TC_MC_3_6"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_6\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_6\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + // + // Tests methods + // +}; + +class Test_TC_MC_3_7 : public TestCommand +{ +public: + Test_TC_MC_3_7() : TestCommand("Test_TC_MC_3_7"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_7\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_7\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + // + // Tests methods + // +}; + +class Test_TC_MC_3_8 : public TestCommand +{ +public: + Test_TC_MC_3_8() : TestCommand("Test_TC_MC_3_8"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_8\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_8\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + // + // Tests methods + // +}; + +class Test_TC_MC_3_9 : public TestCommand +{ +public: + Test_TC_MC_3_9() : TestCommand("Test_TC_MC_3_9"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_9\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_9\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + // + // Tests methods + // +}; + +class Test_TC_MC_3_10 : public TestCommand +{ +public: + Test_TC_MC_3_10() : TestCommand("Test_TC_MC_3_10"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_10\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_10\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + // + // Tests methods + // +}; + +class Test_TC_MC_3_11 : public TestCommand +{ +public: + Test_TC_MC_3_11() : TestCommand("Test_TC_MC_3_11"), mTestIndex(0) {} + + /////////// TestCommand Interface ///////// + void NextTest() override + { + CHIP_ERROR err = CHIP_NO_ERROR; + + if (0 == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Start: Test_TC_MC_3_11\n"); + } + + if (mTestCount == mTestIndex) + { + ChipLogProgress(chipTool, " **** Test Complete: Test_TC_MC_3_11\n"); + SetCommandExitStatus(CHIP_NO_ERROR); + return; + } + + Wait(); + + // Ensure we increment mTestIndex before we start running the relevant + // command. That way if we lose the timeslice after we send the message + // but before our function call returns, we won't end up with an + // incorrect mTestIndex value observed when we get the response. + switch (mTestIndex++) + { + } + + if (CHIP_NO_ERROR != err) + { + ChipLogError(chipTool, " ***** Test Failure: %s\n", chip::ErrorStr(err)); + SetCommandExitStatus(err); + } + } + +private: + std::atomic_uint16_t mTestIndex; + const uint16_t mTestCount = 0; + + // + // Tests methods + // +}; + class Test_TC_OCC_1_1 : public TestCommand { public: @@ -22888,6 +23176,12 @@ void registerCommandsTests(Commands & commands) make_unique(), make_unique(), make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), + make_unique(), make_unique(), make_unique(), make_unique(),