diff --git a/src/app/tests/suites/certification/Test_TC_OO_2_4.yaml b/src/app/tests/suites/certification/Test_TC_OO_2_4.yaml index 736a8706b92072..0b7caf3b680d21 100644 --- a/src/app/tests/suites/certification/Test_TC_OO_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_OO_2_4.yaml @@ -238,24 +238,12 @@ tests: PICS: OO.S.C00.Rsp command: "Off" - # We get an acknowledgment that the command off above is received, but it takes - # a few milliseconds for the off command to actually turn it off. Without this - # delay the preceding reboot command might happen before the command is fully - # processed resulting in flaky test failure that comes from the readAddribute - # verification after the reboot. - # TODO once https://github.com/CHIP-Specifications/chip-test-plans/pull/2464 is - # merged, change this command to a readAtribute and update PICS code to - # OO.S.A0000. PR is blocked from being merged at this time due to freeze for - # SVE. Likely after March 17th, 2023 this PR can be merged and associated - # changes made here to officially fix the flake discovered by CI. - - label: "Wait for send Off command to take affect" - PICS: PICS_SDK_CI_ONLY - cluster: "DelayCommands" - command: "WaitForMs" - arguments: - values: - - name: "ms" - value: 10 + - label: "TH reads the OnOff attribute from the DUT" + PICS: OO.S.A0000 + command: "readAttribute" + attribute: "OnOff" + response: + value: 0 - label: "Reboot target device" PICS: PICS_SDK_CI_ONLY diff --git a/zzz_generated/chip-tool/zap-generated/test/Commands.h b/zzz_generated/chip-tool/zap-generated/test/Commands.h index 1696aa2afc2543..74fe8807e0ca3a 100644 --- a/zzz_generated/chip-tool/zap-generated/test/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/test/Commands.h @@ -37863,7 +37863,11 @@ class Test_TC_OO_2_4Suite : public TestCommand break; case 27: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); - shouldContinue = true; + { + bool value; + VerifyOrReturn(CheckDecodeValue(chip::app::DataModel::Decode(*data, value))); + VerifyOrReturn(CheckValue("onOff", value, 0)); + } break; case 28: VerifyOrReturn(CheckValue("status", chip::to_underlying(status.mStatus), 0)); @@ -38115,12 +38119,9 @@ class Test_TC_OO_2_4Suite : public TestCommand ); } case 27: { - LogStep(27, "Wait for send Off command to take affect"); - VerifyOrDo(!ShouldSkip("PICS_SDK_CI_ONLY"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); - ListFreer listFreer; - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10UL; - return WaitForMs(kIdentityAlpha, value); + LogStep(27, "TH reads the OnOff attribute from the DUT"); + VerifyOrDo(!ShouldSkip("OO.S.A0000"), return ContinueOnChipMainThread(CHIP_NO_ERROR)); + return ReadAttribute(kIdentityAlpha, GetEndpoint(1), OnOff::Id, OnOff::Attributes::OnOff::Id, true, chip::NullOptional); } case 28: { LogStep(28, "Reboot target device"); diff --git a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h index bfccaf83dbe46f..217820fc3a6d98 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/test/Commands.h @@ -52823,12 +52823,12 @@ class Test_TC_OO_2_4 : public TestCommandBridge { err = TestThSendsOffCommandToDut_26(); break; case 27: - ChipLogProgress(chipTool, " ***** Test Step 27 : Wait for send Off command to take affect\n"); - if (ShouldSkip("PICS_SDK_CI_ONLY")) { + ChipLogProgress(chipTool, " ***** Test Step 27 : TH reads the OnOff attribute from the DUT\n"); + if (ShouldSkip("OO.S.A0000")) { NextTest(); return; } - err = TestWaitForSendOffCommandToTakeAffect_27(); + err = TestThReadsTheOnOffAttributeFromTheDut_27(); break; case 28: ChipLogProgress(chipTool, " ***** Test Step 28 : Reboot target device\n"); @@ -53358,12 +53358,27 @@ class Test_TC_OO_2_4 : public TestCommandBridge { return CHIP_NO_ERROR; } - CHIP_ERROR TestWaitForSendOffCommandToTakeAffect_27() + CHIP_ERROR TestThReadsTheOnOffAttributeFromTheDut_27() { - chip::app::Clusters::DelayCommands::Commands::WaitForMs::Type value; - value.ms = 10UL; - return WaitForMs("alpha", value); + MTRBaseDevice * device = GetDevice("alpha"); + __auto_type * cluster = [[MTRBaseClusterOnOff alloc] initWithDevice:device endpointID:@(1) queue:mCallbackQueue]; + VerifyOrReturnError(cluster != nil, CHIP_ERROR_INCORRECT_STATE); + + [cluster readAttributeOnOffWithCompletion:^(NSNumber * _Nullable value, NSError * _Nullable err) { + NSLog(@"TH reads the OnOff attribute from the DUT Error: %@", err); + + VerifyOrReturn(CheckValue("status", err ? err.code : 0, 0)); + + { + id actualValue = value; + VerifyOrReturn(CheckValue("OnOff", actualValue, 0)); + } + + NextTest(); + }]; + + return CHIP_NO_ERROR; } CHIP_ERROR TestRebootTargetDevice_28()