Skip to content

Commit

Permalink
Occupancy Sensing cluster Python test scripts (project-chip#34572)
Browse files Browse the repository at this point in the history
* Occupancy Sensing cluster Python test scripts

Consolidate previous TC-OCC-xx test script PRs (PR 34490, PR 34491, PR 34492, PR 34523) into this one upload.

* Update TC_OCC_2_1.py

* Update TC_OCC_2_2.py

syntax error

* Update TC_OCC_2_3.py

* Update TC_OCC_3_1.py

* Update TC_OCC_3_2.py

* Update TC_OCC_2_1.py

Accommodated recent test plan attribute conformance and Cecille comments

* Update TC_OCC_2_2.py

Reflected table 2.7.6.2

* Update TC_OCC_2_3.py

Modified according to comments

* Update TC_OCC_3_1.py

Add CLI

* Update TC_OCC_3_2.py

Fixed some errors and added some random values for subscription testing

* Update TC_OCC_2_1.py

Updated more detail test step failure description.

* Update TC_OCC_3_1.py

Updating some of user input call according to comments.

* Update TC_OCC_2_1.py

python code bug fixing

* Update TC_OCC_2_2.py

python bug fixing

* Update TC_OCC_2_3.py

python bug fix

* Update TC_OCC_3_2.py

* Update TC_OCC_3_2.py

step numbering fix

* Update TC_OCC_3_2.py

* Update TC_OCC_3_2.py

* Update TC_OCC_3_1.py

* Update TC_OCC_2_3.py

* Update TC_OCC_2_2.py

* Update TC_OCC_2_1.py

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update src/python_testing/TC_OCC_2_1.py

Co-authored-by: C Freeman <[email protected]>

* Update TC_OCC_2_2.py

Fixed bitmap conditional statement

* Update TC_OCC_3_1.py

* Update TC_OCC_2_1.py

Add additional changes according to comments received.

* Update TC_OCC_3_1.py

* Update TC_OCC_3_2.py

test step change

* Update TC_OCC_2_1.py

* Update TC_OCC_2_1.py

* Update TC_OCC_2_1.py

* Update TC_OCC_2_1.py

* Update TC_OCC_2_1.py

* Update TC_OCC_2_1.py

update on PIR

* Update TC_OCC_2_2.py

* Update TC_OCC_2_1.py

restyled

* Update TC_OCC_2_2.py

restyled

* Update TC_OCC_2_3.py

restyled

* Update TC_OCC_3_1.py

restyled

* Update TC_OCC_3_2.py

restyled

* Update TC_OCC_2_1.py

* Update TC_OCC_2_1.py

* Update TC_OCC_2_1.py

* Restyle

* Update TC_OCC_2_2.py

bitmap conditional statement revised

* Update TC_OCC_2_2.py

Bitmap matching statement update

* Update TC_OCC_3_1.py

* Update src/python_testing/TC_OCC_2_2.py

typo

Co-authored-by: Andrei Litvin <[email protected]>

* Update src/python_testing/TC_OCC_2_2.py

Co-authored-by: Andrei Litvin <[email protected]>

* Update TC_OCC_2_2.py

* Update TC_OCC_2_2.py

* Update TC_OCC_2_2.py

rewriting sensor type check

* Update TC_OCC_2_2.py

* Update TC_OCC_2_2.py

* Update TC_OCC_2_2.py

* Restyle

* Proposal for TC_OCC bitmap compares

* Fix typo

* Fix map

* Update TC_OCC_3_2.py

added else on conditional statement.

* Update TC_OCC_3_2.py

put skip back

* Restyle

* Typo fixes and enable some tests in CI

* Fix OCC_2_1 to run in CI

* Fix all clusters for TC_OCC_2_2 and some logging

* make all TC_OCC_2_* pass

* Restyle

* Enable tests in ci

---------

Co-authored-by: C Freeman <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
4 people authored Aug 1, 2024
1 parent 7dd6b4b commit d0d9127
Show file tree
Hide file tree
Showing 9 changed files with 959 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,9 @@ jobs:
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_TestEventTrigger.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TestBatchInvoke.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TestGroupTableReports.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_1.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_2.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OCC_2_3.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPCREDS_3_1.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPCREDS_3_2.py'
scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_OPSTATE_2_1.py'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9025,10 +9025,11 @@ endpoint 1 {
server cluster OccupancySensing {
ram attribute occupancy;
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute occupancySensorTypeBitmap default = 1;
ram attribute holdTime default = 10;
callback attribute holdTimeLimits;
ram attribute featureMap default = 0x01;
ram attribute PIROccupiedToUnoccupiedDelay default = 10;
ram attribute featureMap default = 0x02;
ram attribute clusterRevision default = 5;
}

Expand Down Expand Up @@ -9502,10 +9503,11 @@ endpoint 2 {
server cluster OccupancySensing {
ram attribute occupancy;
ram attribute occupancySensorType;
ram attribute occupancySensorTypeBitmap;
ram attribute occupancySensorTypeBitmap default = 1;
ram attribute holdTime default = 20;
callback attribute holdTimeLimits;
ram attribute featureMap default = 0x01;
ram attribute PIROccupiedToUnoccupiedDelay default = 10;
ram attribute featureMap default = 0x02;
ram attribute clusterRevision default = 5;
}
}
Expand Down
44 changes: 38 additions & 6 deletions examples/all-clusters-app/all-clusters-common/all-clusters-app.zap
Original file line number Diff line number Diff line change
Expand Up @@ -16678,7 +16678,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -16726,7 +16726,7 @@
"storageOption": "External",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": null,
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -19103,7 +19103,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "1",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -19141,6 +19141,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "PIROccupiedToUnoccupiedDelay",
"code": 16,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "10",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
Expand All @@ -19151,7 +19167,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x01",
"defaultValue": "0x02",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down Expand Up @@ -25244,7 +25260,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "",
"defaultValue": "1",
"reportable": 1,
"minInterval": 0,
"maxInterval": 65344,
Expand Down Expand Up @@ -25282,6 +25298,22 @@
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "PIROccupiedToUnoccupiedDelay",
"code": 16,
"mfgCode": null,
"side": "server",
"type": "int16u",
"included": 1,
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "10",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
"reportableChange": 0
},
{
"name": "FeatureMap",
"code": 65532,
Expand All @@ -25292,7 +25324,7 @@
"storageOption": "RAM",
"singleton": 0,
"bounded": 0,
"defaultValue": "0x01",
"defaultValue": "0x02",
"reportable": 1,
"minInterval": 1,
"maxInterval": 65534,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void emberAfOccupancySensingClusterInitCallback(EndpointId endpointId)
VerifyOrDie(!gAttrAccess[endpointId]);

gAttrAccess[endpointId] = std::make_unique<OccupancySensingAttrAccess>(
BitMask<OccupancySensing::Feature, uint32_t>(OccupancySensing::Feature::kOther));
BitMask<OccupancySensing::Feature, uint32_t>(OccupancySensing::Feature::kPassiveInfrared));

OccupancySensing::Structs::HoldTimeLimitsStruct::Type holdTimeLimits = {
.holdTimeMin = 1,
Expand Down
Loading

0 comments on commit d0d9127

Please sign in to comment.