Skip to content

Commit

Permalink
Add tests for Smoke CO Alarm (#27123)
Browse files Browse the repository at this point in the history
* Fix decoding of TLV payload data

Ignore empty field events.

* Restyled by autopep8

* Smoke/CO: Add test scripts

* [SMCO] Update test scripts

* SMOKECO: Revised document

* Revised yaml per the documentation

* Regen zap

* Disable all smco tests in Darwin

* Regen zap

* Fix PICS

* Update test scripts per review comments

* Remove Unit Testing Cluster

* Restyled by prettier-yaml

* Update test scripts per review comments

* Regen zap

* Update test scripts per review comments

---------

Co-authored-by: Hare <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
3 people authored and pull[bot] committed Oct 12, 2023
1 parent d4282ee commit 1465154
Show file tree
Hide file tree
Showing 16 changed files with 7,813 additions and 1,807 deletions.
10 changes: 9 additions & 1 deletion examples/darwin-framework-tool/templates/tests/ciTests.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@
"Disabled because the power source configuration cluster is now deprecated and not present in all-clusters",
"Test_TC_PSCFG_1_1",
"Test_TC_PSCFG_2_1",
"Test_TC_PSCFG_2_2"
"Test_TC_PSCFG_2_2",
"Disabled due to SmokeCOAlarm not being enabled in Matter.framework for now:",
"Test_TC_SMCO_1_1",
"Test_TC_SMCO_2_1",
"Test_TC_SMCO_2_2",
"Test_TC_SMCO_2_3",
"Test_TC_SMCO_2_4",
"Test_TC_SMCO_2_5",
"Test_TC_SMCO_2_6"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1725,223 +1725,6 @@ server cluster SmokeCoAlarm = 92 {
command SelfTestRequest(): DefaultSuccess = 0;
}

/** The Test Cluster is meant to validate the generated code */
server cluster UnitTesting = 4294048773 {
enum SimpleEnum : ENUM8 {
kUnspecified = 0;
kValueA = 1;
kValueB = 2;
kValueC = 3;
}

bitmap Bitmap16MaskMap : BITMAP16 {
kMaskVal1 = 0x1;
kMaskVal2 = 0x2;
kMaskVal3 = 0x4;
kMaskVal4 = 0x4000;
}

bitmap Bitmap32MaskMap : BITMAP32 {
kMaskVal1 = 0x1;
kMaskVal2 = 0x2;
kMaskVal3 = 0x4;
kMaskVal4 = 0x40000000;
}

bitmap Bitmap64MaskMap : BITMAP64 {
kMaskVal1 = 0x1;
kMaskVal2 = 0x2;
kMaskVal3 = 0x4;
kMaskVal4 = 0x4000000000000000;
}

bitmap Bitmap8MaskMap : BITMAP8 {
kMaskVal1 = 0x1;
kMaskVal2 = 0x2;
kMaskVal3 = 0x4;
kMaskVal4 = 0x40;
}

bitmap SimpleBitmap : BITMAP8 {
kValueA = 0x1;
kValueB = 0x2;
kValueC = 0x4;
}

struct SimpleStruct {
int8u a = 0;
boolean b = 1;
SimpleEnum c = 2;
octet_string d = 3;
char_string e = 4;
SimpleBitmap f = 5;
single g = 6;
double h = 7;
}

fabric_scoped struct TestFabricScoped {
fabric_sensitive int8u fabricSensitiveInt8u = 1;
optional fabric_sensitive int8u optionalFabricSensitiveInt8u = 2;
nullable fabric_sensitive int8u nullableFabricSensitiveInt8u = 3;
optional nullable fabric_sensitive int8u nullableOptionalFabricSensitiveInt8u = 4;
fabric_sensitive char_string fabricSensitiveCharString = 5;
fabric_sensitive SimpleStruct fabricSensitiveStruct = 6;
fabric_sensitive int8u fabricSensitiveInt8uList[] = 7;
fabric_idx fabricIndex = 254;
}

struct NullablesAndOptionalsStruct {
nullable int16u nullableInt = 0;
optional int16u optionalInt = 1;
optional nullable int16u nullableOptionalInt = 2;
nullable char_string nullableString = 3;
optional char_string optionalString = 4;
optional nullable char_string nullableOptionalString = 5;
nullable SimpleStruct nullableStruct = 6;
optional SimpleStruct optionalStruct = 7;
optional nullable SimpleStruct nullableOptionalStruct = 8;
nullable SimpleEnum nullableList[] = 9;
optional SimpleEnum optionalList[] = 10;
optional nullable SimpleEnum nullableOptionalList[] = 11;
}

struct NestedStruct {
int8u a = 0;
boolean b = 1;
SimpleStruct c = 2;
}

struct NestedStructList {
int8u a = 0;
boolean b = 1;
SimpleStruct c = 2;
SimpleStruct d[] = 3;
int32u e[] = 4;
octet_string f[] = 5;
int8u g[] = 6;
}

struct DoubleNestedStructList {
NestedStructList a[] = 0;
}

struct TestListStructOctet {
int64u member1 = 0;
octet_string<32> member2 = 1;
}

info event TestEvent = 1 {
INT8U arg1 = 1;
SimpleEnum arg2 = 2;
BOOLEAN arg3 = 3;
SimpleStruct arg4 = 4;
SimpleStruct arg5[] = 5;
SimpleEnum arg6[] = 6;
}

fabric_sensitive info event TestFabricScopedEvent = 2 {
fabric_idx fabricIndex = 254;
}

attribute boolean boolean = 0;
attribute Bitmap8MaskMap bitmap8 = 1;
attribute Bitmap16MaskMap bitmap16 = 2;
attribute Bitmap32MaskMap bitmap32 = 3;
attribute Bitmap64MaskMap bitmap64 = 4;
attribute int8u int8u = 5;
attribute int16u int16u = 6;
attribute int24u int24u = 7;
attribute int32u int32u = 8;
attribute int40u int40u = 9;
attribute int48u int48u = 10;
attribute int56u int56u = 11;
attribute int64u int64u = 12;
attribute int8s int8s = 13;
attribute int16s int16s = 14;
attribute int24s int24s = 15;
attribute int32s int32s = 16;
attribute int40s int40s = 17;
attribute int48s int48s = 18;
attribute int56s int56s = 19;
attribute int64s int64s = 20;
attribute enum8 enum8 = 21;
attribute enum16 enum16 = 22;
attribute single floatSingle = 23;
attribute double floatDouble = 24;
attribute octet_string<10> octetString = 25;
attribute INT8U listInt8u[] = 26;
attribute OCTET_STRING listOctetString[] = 27;
attribute TestListStructOctet listStructOctetString[] = 28;
attribute long_octet_string<1000> longOctetString = 29;
attribute char_string<10> charString = 30;
attribute long_char_string<1000> longCharString = 31;
attribute epoch_us epochUs = 32;
attribute epoch_s epochS = 33;
attribute vendor_id vendorId = 34;
attribute NullablesAndOptionalsStruct listNullablesAndOptionalsStruct[] = 35;
attribute SimpleEnum enumAttr = 36;
attribute SimpleStruct structAttr = 37;
attribute int8u rangeRestrictedInt8u = 38;
attribute int8s rangeRestrictedInt8s = 39;
attribute int16u rangeRestrictedInt16u = 40;
attribute int16s rangeRestrictedInt16s = 41;
attribute LONG_OCTET_STRING listLongOctetString[] = 42;
attribute TestFabricScoped listFabricScoped[] = 43;
timedwrite attribute boolean timedWriteBoolean = 48;
attribute boolean generalErrorBoolean = 49;
attribute boolean clusterErrorBoolean = 50;
attribute nullable boolean nullableBoolean = 16384;
attribute nullable Bitmap8MaskMap nullableBitmap8 = 16385;
attribute nullable Bitmap16MaskMap nullableBitmap16 = 16386;
attribute nullable Bitmap32MaskMap nullableBitmap32 = 16387;
attribute nullable Bitmap64MaskMap nullableBitmap64 = 16388;
attribute nullable int8u nullableInt8u = 16389;
attribute nullable int16u nullableInt16u = 16390;
attribute nullable int24u nullableInt24u = 16391;
attribute nullable int32u nullableInt32u = 16392;
attribute nullable int40u nullableInt40u = 16393;
attribute nullable int48u nullableInt48u = 16394;
attribute nullable int56u nullableInt56u = 16395;
attribute nullable int64u nullableInt64u = 16396;
attribute nullable int8s nullableInt8s = 16397;
attribute nullable int16s nullableInt16s = 16398;
attribute nullable int24s nullableInt24s = 16399;
attribute nullable int32s nullableInt32s = 16400;
attribute nullable int40s nullableInt40s = 16401;
attribute nullable int48s nullableInt48s = 16402;
attribute nullable int56s nullableInt56s = 16403;
attribute nullable int64s nullableInt64s = 16404;
attribute nullable enum8 nullableEnum8 = 16405;
attribute nullable enum16 nullableEnum16 = 16406;
attribute nullable single nullableFloatSingle = 16407;
attribute nullable double nullableFloatDouble = 16408;
attribute nullable octet_string<10> nullableOctetString = 16409;
attribute nullable char_string<10> nullableCharString = 16414;
attribute nullable SimpleEnum nullableEnumAttr = 16420;
attribute nullable SimpleStruct nullableStruct = 16421;
attribute nullable int8u nullableRangeRestrictedInt8u = 16422;
attribute nullable int8s nullableRangeRestrictedInt8s = 16423;
attribute nullable int16u nullableRangeRestrictedInt16u = 16424;
attribute nullable int16s nullableRangeRestrictedInt16s = 16425;
readonly attribute command_id generatedCommandList[] = 65528;
readonly attribute command_id acceptedCommandList[] = 65529;
readonly attribute event_id eventList[] = 65530;
readonly attribute attrib_id attributeList[] = 65531;
readonly attribute bitmap32 featureMap = 65532;
readonly attribute int16u clusterRevision = 65533;

request struct TestEmitTestEventRequestRequest {
INT8U arg1 = 0;
SimpleEnum arg2 = 1;
BOOLEAN arg3 = 2;
}

command Test(): DefaultSuccess = 0;
command TestNotHandled(): DefaultSuccess = 1;
command TestSpecific(): TestSpecificResponse = 2;
command TestEmitTestEventRequest(TestEmitTestEventRequestRequest): TestEmitTestEventResponse = 20;
}

endpoint 0 {
device type rootdevice = 22, version 1;
binding cluster OtaSoftwareUpdateProvider;
Expand Down Expand Up @@ -2245,92 +2028,6 @@ endpoint 1 {
ram attribute featureMap default = 3;
ram attribute clusterRevision default = 1;
}

server cluster UnitTesting {
emits event TestEvent;
ram attribute boolean default = false;
ram attribute bitmap8 default = 0;
ram attribute bitmap16 default = 0;
ram attribute bitmap32 default = 0;
ram attribute bitmap64 default = 0;
ram attribute int8u default = 0;
ram attribute int16u default = 0;
ram attribute int24u default = 0;
ram attribute int32u default = 0;
ram attribute int40u default = 0;
ram attribute int48u default = 0;
ram attribute int56u default = 0;
ram attribute int64u default = 0;
ram attribute int8s default = 0;
ram attribute int16s default = 0;
ram attribute int24s default = 0;
ram attribute int32s default = 0;
ram attribute int40s default = 0;
ram attribute int48s default = 0;
ram attribute int56s default = 0;
ram attribute int64s default = 0;
ram attribute enum8 default = 0;
ram attribute enum16 default = 0;
ram attribute floatSingle default = 0;
ram attribute floatDouble default = 0;
ram attribute octetString;
callback attribute listInt8u;
callback attribute listOctetString;
callback attribute listStructOctetString;
ram attribute longOctetString;
ram attribute charString;
ram attribute longCharString;
ram attribute epochUs;
ram attribute epochS;
ram attribute vendorId default = 0;
callback attribute listNullablesAndOptionalsStruct;
ram attribute enumAttr;
callback attribute structAttr;
ram attribute rangeRestrictedInt8u default = 70;
ram attribute rangeRestrictedInt8s default = -5;
ram attribute rangeRestrictedInt16u default = 200;
ram attribute rangeRestrictedInt16s default = -5;
callback attribute listLongOctetString;
callback attribute listFabricScoped;
ram attribute timedWriteBoolean;
callback attribute generalErrorBoolean;
callback attribute clusterErrorBoolean;
ram attribute nullableBoolean default = false;
ram attribute nullableBitmap8 default = 0;
ram attribute nullableBitmap16 default = 0;
ram attribute nullableBitmap32 default = 0;
ram attribute nullableBitmap64 default = 0;
ram attribute nullableInt8u default = 0;
ram attribute nullableInt16u default = 0;
ram attribute nullableInt24u default = 0;
ram attribute nullableInt32u default = 0;
ram attribute nullableInt40u default = 0;
ram attribute nullableInt48u default = 0;
ram attribute nullableInt56u default = 0;
ram attribute nullableInt64u default = 0;
ram attribute nullableInt8s default = 0;
ram attribute nullableInt16s default = 0;
ram attribute nullableInt24s default = 0;
ram attribute nullableInt32s default = 0;
ram attribute nullableInt40s default = 0;
ram attribute nullableInt48s default = 0;
ram attribute nullableInt56s default = 0;
ram attribute nullableInt64s default = 0;
ram attribute nullableEnum8 default = 0;
ram attribute nullableEnum16 default = 0;
ram attribute nullableFloatSingle default = 0;
ram attribute nullableFloatDouble default = 0;
ram attribute nullableOctetString;
ram attribute nullableCharString;
ram attribute nullableEnumAttr;
callback attribute nullableStruct;
ram attribute nullableRangeRestrictedInt8u default = 70;
ram attribute nullableRangeRestrictedInt8s default = -5;
ram attribute nullableRangeRestrictedInt16u default = 200;
ram attribute nullableRangeRestrictedInt16s default = -5;
ram attribute featureMap default = 0;
ram attribute clusterRevision default = 1;
}
}


Loading

0 comments on commit 1465154

Please sign in to comment.