Skip to content

Commit

Permalink
Groups cluster tests enabled using TestPersistentStorageDelegate.
Browse files Browse the repository at this point in the history
  • Loading branch information
rcasallas-silabs committed Dec 2, 2021
1 parent 753f01c commit ec73c16
Show file tree
Hide file tree
Showing 8 changed files with 1,174 additions and 198 deletions.
1 change: 1 addition & 0 deletions src/app/server/Server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ CHIP_ERROR Server::Init(AppDelegate * delegate, uint16_t secureServicePort, uint
err = mFabrics.Init(&mServerStorage);
SuccessOrExit(err);

// Group data provider must be initialized after mServerStorage
err = mGroupsProvider.Init();
SuccessOrExit(err);
SetGroupDataProvider(&mGroupsProvider);
Expand Down
10 changes: 8 additions & 2 deletions src/app/server/Server.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <credentials/FabricTable.h>
#include <credentials/GroupDataProviderImpl.h>
#include <inet/InetConfig.h>
#include <lib/support/TestPersistentStorageDelegate.h>
#include <messaging/ExchangeMgr.h>
#include <platform/KeyValueStoreManager.h>
#include <protocols/secure_channel/CASEServer.h>
Expand Down Expand Up @@ -91,7 +92,7 @@ class Server
static Server & GetInstance() { return sServer; }

private:
Server() : mCommissioningWindowManager(this), mGroupsProvider(mServerStorage) {}
Server() : mCommissioningWindowManager(this), mGroupsProvider(mGroupsStorage) {}

static Server sServer;

Expand Down Expand Up @@ -146,9 +147,14 @@ class Server
chip::Protocols::UserDirectedCommissioning::UserDirectedCommissioningClient gUDCClient;
#endif // CHIP_DEVICE_CONFIG_ENABLE_COMMISSIONER_DISCOVERY_CLIENT
SecurePairingUsingTestSecret mTestPairing;
CommissioningWindowManager mCommissioningWindowManager;

// Both PersistentStorageDelegate, and GroupDataProvider should be injected by the applications
// See: https://github.com/project-chip/connectedhomeip/issues/12276
ServerStorageDelegate mServerStorage;
CommissioningWindowManager mCommissioningWindowManager;
// Currently, the GroupDataProvider cannot use KeyValueStoreMgr() due to
// (https://github.com/project-chip/connectedhomeip/issues/12174)
TestPersistentStorageDelegate mGroupsStorage;
Credentials::GroupDataProviderImpl mGroupsProvider;

chip::OperationalDeviceProxy * mOperationalDeviceProxy = nullptr;
Expand Down
56 changes: 17 additions & 39 deletions src/app/tests/suites/TestGroupsCluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,20 @@ tests:
- name: "groupId"
value: 0x1111

- label: "Get Group Membership 1 (all)"
command: "GetGroupMembership"
arguments:
values:
- name: "groupList"
value: []
response:
values:
- name: "capacity"
value: 0xff
- name: "groupList"
value: [0x01]

- label: "Add Group 2 (new)"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "AddGroup"
arguments:
values:
Expand All @@ -110,8 +121,6 @@ tests:
value: 0x1111

- label: "View Group 2 (new)"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "ViewGroup"
arguments:
values:
Expand Down Expand Up @@ -140,8 +149,6 @@ tests:
value: 0x7fff

- label: "Add Group 3 (new)"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "AddGroup"
arguments:
values:
Expand Down Expand Up @@ -172,8 +179,6 @@ tests:
value: "Group #1"

- label: "View Group 2 (existing)"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "ViewGroup"
arguments:
values:
Expand All @@ -188,39 +193,20 @@ tests:
- name: "groupName"
value: "Group #2"

- label: "Get Group Membership 1"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "GetGroupMembership"
arguments:
values:
- name: "groupList"
value: [0x01, 0x02, 0x03, 0x7fff]
response:
values:
- name: "capacity"
value: 0xff
- name: "groupList"
value: [0x01, 0x7fff]

- label: "Get Group Membership 2"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "GetGroupMembership"
arguments:
values:
- name: "groupList"
value: []
value: [0x02, 0x03, 0x7fff]
response:
values:
- name: "capacity"
value: 0xff
- name: "groupList"
value: [0x01, 0x1111, 0x7fff]
value: [0x7fff]

- label: "View Group 3 (new)"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "ViewGroup"
arguments:
values:
Expand Down Expand Up @@ -262,8 +248,6 @@ tests:
value: 0x04

- label: "Remove Group 2 (existing)"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "RemoveGroup"
arguments:
values:
Expand Down Expand Up @@ -305,8 +289,6 @@ tests:
value: 0x1111

- label: "View Group 3 (not removed)"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "ViewGroup"
arguments:
values:
Expand All @@ -322,19 +304,17 @@ tests:
value: "Group #3"

- label: "Get Group Membership 3"
# https://github.com/project-chip/connectedhomeip/issues/11312
disabled: true
command: "GetGroupMembership"
arguments:
values:
- name: "groupList"
value: [0x01, 0x02, 0x1111, 0x03, 0x7fff]
value: [0x01, 0x02, 0x1111, 0x03]
response:
values:
- name: "capacity"
value: 0xff
- name: "groupList"
value: [0x01, 0x7fff]
value: [0x01]

- label: "Remove All"
command: "RemoveAllGroups"
Expand Down Expand Up @@ -379,8 +359,6 @@ tests:
value: 0x7fff

- label: "Get Group Membership 4"
# https://github.com/project-chip/connectedhomeip/issues/11495
disabled: true
command: "GetGroupMembership"
arguments:
values:
Expand Down
Loading

0 comments on commit ec73c16

Please sign in to comment.