From 2a1f0f0f3439904fe6e85af2d4a19eddc6492915 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 1 Aug 2024 14:11:55 -0400 Subject: [PATCH] Fix all clusters for TC_OCC_2_2 and some logging --- .../src/occupancy-sensing-stub.cpp | 2 +- src/python_testing/TC_OCC_2_2.py | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp b/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp index dcbb90ff659bcb..776e108911aaef 100644 --- a/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp +++ b/examples/all-clusters-app/all-clusters-common/src/occupancy-sensing-stub.cpp @@ -36,7 +36,7 @@ void emberAfOccupancySensingClusterInitCallback(EndpointId endpointId) VerifyOrDie(!gAttrAccess[endpointId]); gAttrAccess[endpointId] = std::make_unique( - BitMask(OccupancySensing::Feature::kOther)); + BitMask(OccupancySensing::Feature::kPassiveInfrared)); OccupancySensing::Structs::HoldTimeLimitsStruct::Type holdTimeLimits = { .holdTimeMin = 1, diff --git a/src/python_testing/TC_OCC_2_2.py b/src/python_testing/TC_OCC_2_2.py index 44989fa6faf02a..e27bbf30ebcade 100644 --- a/src/python_testing/TC_OCC_2_2.py +++ b/src/python_testing/TC_OCC_2_2.py @@ -27,20 +27,11 @@ # test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --PICS src/app/tests/suites/certification/ci-pics-values --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # === END CI TEST ARGUMENTS === -from dataclasses import dataclass - import chip.clusters as Clusters from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts -@dataclass -class FeatureMapping: - """Maps feature flags to a specific bitmap and sensor type""" - feature_map: int - sensor_type: Clusters.OccupancySensing.Enums.OccupancySensorTypeEnum - - class TC_OCC_2_2(MatterBaseTest): async def read_occ_attribute_expect_success(self, endpoint, attribute): cluster = Clusters.Objects.OccupancySensing @@ -133,7 +124,7 @@ async def test_TC_OCC_2_2(self): asserts.assert_equal( (occupancy_sensor_type_bitmap_dut & sensor_bit) != 0, (feature_map & feature_bit) != 0, - f"Feature bit and sensor bitmap must be equal for {name}" + f"Feature bit and sensor bitmap must be equal for {name} (BITMAP: 0x{occupancy_sensor_type_bitmap_dut:02X}, FEATUREMAP: 0x{feature_map:02X})" )