Skip to content

Commit

Permalink
Activating scenes yaml tests on CI now that the level control cluster…
Browse files Browse the repository at this point in the history
… handler is implemented
  • Loading branch information
lpbeliveau-silabs committed Oct 4, 2023
1 parent 041ba33 commit f405ba7
Show file tree
Hide file tree
Showing 13 changed files with 198 additions and 113 deletions.
115 changes: 106 additions & 9 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -11038,6 +11038,30 @@
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
"name": "EnhancedAddScene",
"code": 64,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "EnhancedViewScene",
"code": 65,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "CopyScene",
"code": 66,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
}
],
"attributes": [
Expand Down Expand Up @@ -11130,6 +11154,30 @@
"source": "server",
"incoming": 1,
"outgoing": 1
},
{
"name": "EnhancedAddSceneResponse",
"code": 64,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
},
{
"name": "EnhancedViewSceneResponse",
"code": 65,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
},
{
"name": "CopySceneResponse",
"code": 66,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
}
],
"attributes": [
Expand Down Expand Up @@ -11207,7 +11255,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "0x80",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -11239,7 +11287,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -11255,7 +11303,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -11335,7 +11383,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -31132,6 +31180,30 @@
"source": "client",
"incoming": 1,
"outgoing": 1
},
{
"name": "EnhancedAddScene",
"code": 64,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "EnhancedViewScene",
"code": 65,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
},
{
"name": "CopyScene",
"code": 66,
"mfgCode": null,
"source": "client",
"incoming": 1,
"outgoing": 0
}
],
"attributes": [
Expand Down Expand Up @@ -31224,6 +31296,30 @@
"source": "server",
"incoming": 1,
"outgoing": 1
},
{
"name": "EnhancedAddSceneResponse",
"code": 64,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
},
{
"name": "EnhancedViewSceneResponse",
"code": 65,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
},
{
"name": "CopySceneResponse",
"code": 66,
"mfgCode": null,
"source": "server",
"incoming": 0,
"outgoing": 1
}
],
"attributes": [
Expand Down Expand Up @@ -31301,7 +31397,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "0x80",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -31333,7 +31429,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "16",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand All @@ -31349,7 +31445,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "8",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -31429,7 +31525,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0",
"defaultValue": "1",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -35392,5 +35488,6 @@
"endpointId": 65534,
"networkId": 0
}
]
],
"log": []
}
4 changes: 0 additions & 4 deletions scripts/tests/chiptest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def _GetInDevelopmentTests() -> Set[str]:
"Test_TC_SMOKECO_2_6.yaml", # chip-repl does not support local timeout (07/20/2023) and test assumes
# TestEventTriggersEnabled is true, which it's not in CI.
"Test_TC_IDM_1_2.yaml", # Broken harness: https://github.com/project-chip/connectedhomeip/issues/29115
"Test_TC_S_2_4.yaml", # https://github.com/project-chip/connectedhomeip/issues/29117
}


Expand All @@ -178,9 +177,6 @@ def _GetChipReplUnsupportedTests() -> Set[str]:
"Test_TC_ACE_1_6.yaml", # Test fails only in chip-repl: Refer--> https://github.com/project-chip/connectedhomeip/pull/27910#issuecomment-1632485584
"Test_TC_IDM_1_2.yaml", # chip-repl does not support AnyCommands (19/07/2023)
"TestGroupKeyManagementCluster.yaml", # chip-repl does not support EqualityCommands (2023-08-04)
"Test_TC_S_2_2.yaml", # chip-repl does not support scenes cluster commands
"Test_TC_S_2_3.yaml", # chip-repl does not support scenes cluster commands
"Test_TC_S_2_4.yaml", # chip-repl does not support scenes cluster commands
"Test_TC_MOD_3_1.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_MOD_3_2.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
"Test_TC_MOD_3_3.yaml", # chip-repl does not support EqualityCommands pseudo-cluster
Expand Down
16 changes: 8 additions & 8 deletions src/app/clusters/level-control/level-control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,14 +419,6 @@ void emberAfLevelControlClusterServerTickCallback(EndpointId endpoint)

updateCoupledColorTemp(endpoint);

#ifdef EMBER_AF_PLUGIN_SCENES
// The level has changed, so the scene is no longer valid.
if (emberAfContainsServer(endpoint, Scenes::Id))
{
Scenes::ScenesServer::Instance().MakeSceneInvalid(endpoint);
}
#endif // EMBER_AF_PLUGIN_SCENES

// Are we at the requested level?
if (currentLevel.Value() == state->moveToLevel)
{
Expand Down Expand Up @@ -918,6 +910,14 @@ static Status moveToLevelHandler(EndpointId endpoint, CommandId commandId, uint8

state->callbackSchedule.runTime = System::Clock::Milliseconds32(0);

#ifdef EMBER_AF_PLUGIN_SCENES
// If the level has changed, so the scene is no longer valid.
if (emberAfContainsServer(endpoint, Scenes::Id))
{
Scenes::ScenesServer::Instance().MakeSceneInvalid(endpoint);
}
#endif // EMBER_AF_PLUGIN_SCENES

// The setup was successful, so mark the new state as active and return.
scheduleTimerCallbackMs(endpoint, computeCallbackWaitTimeMs(state->callbackSchedule, state->eventDurationMs));

Expand Down
4 changes: 3 additions & 1 deletion src/app/clusters/scenes-server/SceneTableImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,9 @@ CHIP_ERROR DefaultSceneTableImpl::DeleteAllScenesInGroup(FabricIndex fabric_inde
FabricSceneData fabric(mEndpointId, fabric_index, mMaxScenesPerFabric, mMaxScenesPerEndpoint);
SceneTableData scene(mEndpointId, fabric_index);

ReturnErrorOnFailure(fabric.Load(mStorage));
CHIP_ERROR err = fabric.Load(mStorage);
VerifyOrReturnValue(CHIP_ERROR_NOT_FOUND != err, CHIP_NO_ERROR);
ReturnErrorOnFailure(err);

for (uint16_t i = 0; i < mMaxScenesPerFabric; i++)
{
Expand Down
15 changes: 9 additions & 6 deletions src/app/clusters/scenes-server/scenes-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ CHIP_ERROR RecallSceneParse(const FabricIndex & fabricIdx, const EndpointId & en
ReturnErrorOnFailure(sceneTable->SceneApplyEFS(scene));

ReturnErrorOnFailure(StatusIB(ToInteractionModelStatus(Attributes::CurrentScene::Set(endpointID, sceneID))).ToChipError());

ReturnErrorOnFailure(StatusIB(ToInteractionModelStatus(Attributes::CurrentGroup::Set(endpointID, groupID))).ToChipError());

return CHIP_NO_ERROR;
Expand Down Expand Up @@ -715,11 +714,15 @@ void ScenesServer::HandleRecallScene(HandlerContext & ctx, const Commands::Recal
if (CHIP_NO_ERROR == err)
{
status = Attributes::SceneValid::Set(ctx.mRequestPath.mEndpointId, true);
if (EMBER_ZCL_STATUS_SUCCESS != status)
{
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, ToInteractionModelStatus(status));
return;
}
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, ToInteractionModelStatus(status));
return;
}

if (CHIP_ERROR_NOT_FOUND == err)
{
// TODO : implement proper mapping between CHIP_ERROR and IM Status
ctx.mCommandHandler.AddStatus(ctx.mRequestPath, Protocols::InteractionModel::Status::NotFound);
return;
}

ctx.mCommandHandler.AddStatus(ctx.mRequestPath, StatusIB(err).mStatus);
Expand Down
12 changes: 6 additions & 6 deletions src/app/tests/suites/certification/Test_TC_S_1_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ tests:
response:
constraints:
type: list
contains: [0, 1, 2, 3, 4, 5, 6, 40, 41, 42]
contains: [0, 1, 2, 3, 4, 5, 6, 64, 65, 66]

- label: "Step 6b: Read AcceptedCommandList (global attribute 65529)"
PICS: (!S.S.C40.Rsp)
Expand All @@ -169,7 +169,7 @@ tests:
response:
constraints:
type: list
contains: [0, 1, 2, 3, 4, 5, 6, 40, 41, 42]
contains: [0, 1, 2, 3, 4, 5, 6, 64, 65, 66]

- label: "Step 6d: Read AcceptedCommandList (global attribute 65529)"
PICS: (!S.C.C40.Tx)
Expand All @@ -186,7 +186,7 @@ tests:
response:
constraints:
type: list
contains: [0, 1, 2, 3, 4, 5, 6]
contains: [0, 1, 2, 3, 4, 6]

- label:
"Step 7b: Read optional command(EnhancedAddSceneResponse) in
Expand All @@ -197,7 +197,7 @@ tests:
response:
constraints:
type: list
contains: [40]
contains: [64]

- label:
"Step 7c: Read optional command(EnhancedViewSceneResponse) in
Expand All @@ -208,7 +208,7 @@ tests:
response:
constraints:
type: list
contains: [41]
contains: [65]

- label:
"Step 7d: Read optional command(CopySceneResponse) in
Expand All @@ -219,4 +219,4 @@ tests:
response:
constraints:
type: list
contains: [42]
contains: [66]
10 changes: 7 additions & 3 deletions src/app/tests/suites/certification/Test_TC_S_2_1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ tests:
attribute: "CurrentGroup"
response:
constraints:
type: groupid
type: int16u

- label: "Step 5: TH reads from the DUT the (0x0003) SceneValid attribute"
PICS: S.S.A0003
command: "readAttribute"
attribute: "SceneValid"
response:
constraints:
type: int8u
type: boolean

- label: "Step 6: TH reads from the DUT the (0x0004) NameSupport attribute"
PICS: S.S.A0003 && S.S.F00
Expand Down Expand Up @@ -99,8 +99,10 @@ tests:
command: "readAttribute"
attribute: "SceneTableSize"
response:
value: 0x10
constraints:
type: uint16
type: int16u


- label:
"Step 9: TH reads from the DUT the (0x0007) RemainingCapacity
Expand All @@ -109,5 +111,7 @@ tests:
command: "readAttribute"
attribute: "RemainingCapacity"
response:
value: 0x08
constraints:
type: int8u

Loading

0 comments on commit f405ba7

Please sign in to comment.