Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TC-VALCC-4.2: unconditionally write open duration #35852

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/python_testing/TC_VALCC_4_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
# test-runner-run/run1/script-args: --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto
# === END CI TEST ARGUMENTS ===

import logging
import time

import chip.clusters as Clusters
Expand Down Expand Up @@ -55,6 +54,7 @@ def steps_TC_VALCC_4_2(self) -> list[TestStep]:
TestStep(8, "Send Close command"),
TestStep(9, "Read OpenDuration attribute"),
TestStep(10, "Read RemainingDuration attribute"),
TestStep(11, "Write DefaultOpenDuration back to original value")
]
return steps

Expand All @@ -73,16 +73,11 @@ async def test_TC_VALCC_4_2(self):
attributes = Clusters.ValveConfigurationAndControl.Attributes

self.step("2a")
defaultOpenDuration = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration)
originalDefaultOpenDuration = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.DefaultOpenDuration)

self.step("2b")
if defaultOpenDuration is NullValue:
defaultOpenDuration = 60

result = await self.default_controller.WriteAttribute(self.dut_node_id, [(endpoint, attributes.DefaultOpenDuration(defaultOpenDuration))])
asserts.assert_equal(result[0].Status, Status.Success, "DefaultOpenDuration write failed")
else:
logging.info("Test step skipped")
defaultOpenDuration = 60
await self.write_single_attribute(attributes.DefaultOpenDuration(defaultOpenDuration), endpoint_id=endpoint)

self.step(3)
try:
Expand Down Expand Up @@ -129,6 +124,9 @@ async def test_TC_VALCC_4_2(self):
remaining_duration_dut = await self.read_valcc_attribute_expect_success(endpoint=endpoint, attribute=attributes.RemainingDuration)
asserts.assert_true(remaining_duration_dut is NullValue, "RemainingDuration is not null")

self.step(11)
await self.write_single_attribute(attributes.DefaultOpenDuration(originalDefaultOpenDuration), endpoint_id=endpoint)


if __name__ == "__main__":
default_matter_test_main()
Loading