Skip to content

Commit

Permalink
remove pause and resume pics guard
Browse files Browse the repository at this point in the history
  • Loading branch information
duyen-tran committed Aug 10, 2023
1 parent 2563ee4 commit 43b3c0b
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 66 deletions.
111 changes: 53 additions & 58 deletions src/python_testing/TC_OPSTATE_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,23 @@ async def test_TC_OPSTATE_2_3(self):

asserts.assert_true(all(id in state_ids for id in defined_states), "OperationalStateList is missing a required entry")

if self.check_pics("OPSTATE.S.C00.Rsp"):
self.print_step(4, "Send Pause command")
ret = await self.send_pause_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OperationalState.Enums.ErrorStateEnum.kNoError,
"errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID)

if self.check_pics("OPSTATE.S.M.ST_PAUSED"):
self.print_step(5, "Read OperationalState attribute")
operational_state = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
attribute=attributes.OperationalState)
logging.info("OperationalState: %s" % (operational_state))
asserts.assert_equal(operational_state, Clusters.OperationalState.Enums.OperationalStateEnum.kPaused,
"OperationalState ID should be Paused(0x02)")
self.print_step(4, "Send Pause command")
ret = await self.send_pause_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OperationalState.Enums.ErrorStateEnum.kNoError,
"errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID)

if self.check_pics("OPSTATE.S.M.ST_PAUSED"):
self.print_step(5, "Read OperationalState attribute")
operational_state = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
attribute=attributes.OperationalState)
logging.info("OperationalState: %s" % (operational_state))
asserts.assert_equal(operational_state, Clusters.OperationalState.Enums.OperationalStateEnum.kPaused,
"OperationalState ID should be Paused(0x02)")

if self.check_pics("OPSTATE.S.A0002"):
self.print_step(6, "Read CountdownTime attribute")
initial_countdown_time = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
attribute=attributes.CountdownTime)
attribute=attributes.CountdownTime)
logging.info("CountdownTime: %s" % (initial_countdown_time))
if initial_countdown_time is not NullValue:
in_range = (1 <= initial_countdown_time <= 259200)
Expand All @@ -116,50 +115,46 @@ async def test_TC_OPSTATE_2_3(self):
asserts.assert_equal(countdown_time, initial_countdown_time, "CountdownTime(%s) does not equal to the intial CountdownTime(%s)"
% (countdown_time, initial_countdown_time))

if self.check_pics("OPSTATE.S.C00.Rsp"):
self.print_step(9, "Send Pause command")
ret = await self.send_pause_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OperationalState.Enums.ErrorStateEnum.kNoError,
"errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID)

if self.check_pics("OPSTATE.S.C03.Rsp"):
self.print_step(10, "Send Resume command")
ret = await self.send_resume_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OperationalState.Enums.ErrorStateEnum.kNoError,
"errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID)

if self.check_pics("OPSTATE.S.M.ST_RUNNING"):
self.print_step(11, "Read OperationalState attribute")
operational_state = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
attribute=attributes.OperationalState)
logging.info("OperationalState: %s" % (operational_state))
asserts.assert_equal(operational_state, Clusters.OperationalState.Enums.OperationalStateEnum.kRunning,
"OperationalState(%s) should be Running(0x01)" % operational_state)

self.print_step(12, "Send Resume command")
ret = await self.send_resume_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OperationalState.Enums.ErrorStateEnum.kNoError,
"errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID)

if self.check_pics("OPSTATE.S.C00.Rsp"):
self.print_step(13, "Manually put the device in a state where it cannot receive a Pause command")
input("Press Enter when done.\n")

self.print_step(14, "Send Pause command")
ret = await self.send_pause_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID,
Clusters.OperationalState.Enums.ErrorStateEnum.kCommandInvalidInState,
"errorStateID(%s) should be CommandInvalidInState(0x03)" % ret.commandResponseState.errorStateID)

if self.check_pics("OPSTATE.S.C03.Rsp"):
self.print_step(15, "Manually put the device in a state where it cannot receive a Resume command")
input("Press Enter when done.\n")

self.print_step(16, "Send Resume command")
ret = await self.send_resume_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID,
Clusters.OperationalState.Enums.ErrorStateEnum.kCommandInvalidInState,
"errorStateID(%s) should be CommandInvalidInState(0x03)" % ret.commandResponseState.errorStateID)
self.print_step(9, "Send Pause command")
ret = await self.send_pause_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OperationalState.Enums.ErrorStateEnum.kNoError,
"errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID)

self.print_step(10, "Send Resume command")
ret = await self.send_resume_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OperationalState.Enums.ErrorStateEnum.kNoError,
"errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID)

if self.check_pics("OPSTATE.S.M.ST_RUNNING"):
self.print_step(11, "Read OperationalState attribute")
operational_state = await self.read_mod_attribute_expect_success(endpoint=self.endpoint,
attribute=attributes.OperationalState)
logging.info("OperationalState: %s" % (operational_state))
asserts.assert_equal(operational_state, Clusters.OperationalState.Enums.OperationalStateEnum.kRunning,
"OperationalState(%s) should be Running(0x01)" % operational_state)

self.print_step(12, "Send Resume command")
ret = await self.send_resume_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID, Clusters.OperationalState.Enums.ErrorStateEnum.kNoError,
"errorStateID(%s) should be NoError(0x00)" % ret.commandResponseState.errorStateID)

self.print_step(13, "Manually put the device in a state where it cannot receive a Pause command")
input("Press Enter when done.\n")

self.print_step(14, "Send Pause command")
ret = await self.send_pause_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID,
Clusters.OperationalState.Enums.ErrorStateEnum.kCommandInvalidInState,
"errorStateID(%s) should be CommandInvalidInState(0x03)" % ret.commandResponseState.errorStateID)

self.print_step(15, "Manually put the device in a state where it cannot receive a Resume command")
input("Press Enter when done.\n")

self.print_step(16, "Send Resume command")
ret = await self.send_resume_cmd()
asserts.assert_equal(ret.commandResponseState.errorStateID,
Clusters.OperationalState.Enums.ErrorStateEnum.kCommandInvalidInState,
"errorStateID(%s) should be CommandInvalidInState(0x03)" % ret.commandResponseState.errorStateID)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion third_party/mbedtls/repo
Submodule repo updated from f97832 to 4e73af
2 changes: 1 addition & 1 deletion third_party/nanopb/repo
Submodule repo updated 119 files
2 changes: 1 addition & 1 deletion third_party/openthread/repo
Submodule repo updated 73 files
+0 −22 .clang-tidy
+14 −14 .github/workflows/build.yml
+1 −1 .github/workflows/codeql.yml
+1 −1 .github/workflows/docker.yml
+1 −1 .github/workflows/fuzz.yml
+1 −1 .github/workflows/makefile-check.yml
+1 −1 .github/workflows/otci.yml
+3 −3 .github/workflows/otns.yml
+7 −7 .github/workflows/posix.yml
+9 −9 .github/workflows/simulation-1.1.yml
+7 −7 .github/workflows/simulation-1.2.yml
+1 −1 .github/workflows/size.yml
+5 −5 .github/workflows/toranj.yml
+4 −4 .github/workflows/unit.yml
+1 −1 .github/workflows/version.yml
+7 −16 CMakeLists.txt
+2 −2 examples/platforms/simulation/CMakeLists.txt
+161 −12 examples/platforms/simulation/openthread-core-simulation-config.h
+1 −4 include/openthread/border_routing.h
+1 −1 include/openthread/instance.h
+11 −22 include/openthread/link.h
+1 −1 include/openthread/platform/radio.h
+0 −10 include/openthread/thread_ftd.h
+35 −5 script/make-pretty
+3 −27 src/cli/README.md
+0 −12 src/cli/README_BR.md
+29 −71 src/cli/cli.cpp
+9 −23 src/core/api/link_api.cpp
+3 −8 src/core/api/thread_ftd_api.cpp
+0 −8 src/core/border_router/infra_if.hpp
+7 −15 src/core/border_router/routing_manager.cpp
+0 −1 src/core/common/time.hpp
+0 −153 src/core/common/trickle_timer.cpp
+1 −42 src/core/common/trickle_timer.hpp
+2 −2 src/core/mac/data_poll_sender.cpp
+0 −10 src/core/mac/mac.cpp
+3 −15 src/core/mac/mac.hpp
+0 −2 src/core/mac/mac_frame.cpp
+1 −1 src/core/mac/sub_mac.hpp
+2 −3 src/core/net/ip6_mpl.cpp
+31 −33 src/core/net/srp_server.cpp
+23 −21 src/core/net/srp_server.hpp
+0 −13 src/core/openthread-core-config.h
+58 −36 src/core/thread/mle.cpp
+1,132 −364 src/core/thread/mle.hpp
+42 −65 src/core/thread/mle_router.cpp
+7 −36 src/core/thread/mle_router.hpp
+0 −32 src/core/thread/mle_types.cpp
+12 −100 src/core/thread/mle_types.hpp
+0 −7 src/core/thread/neighbor_table.cpp
+2 −4 src/core/thread/router_table.cpp
+3 −5 src/core/thread/router_table.hpp
+11 −0 src/core/thread/topology.cpp
+23 −7 src/core/thread/topology.hpp
+2 −5 src/lib/spinel/spinel.h
+8 −8 src/ncp/ncp_base_mtd.cpp
+2 −2 src/posix/platform/CMakeLists.txt
+170 −5 src/posix/platform/openthread-core-posix-config.h
+1 −1 tests/scripts/expect/cli-discover.exp
+1 −1 tests/scripts/thread-cert/pktverify/consts.py
+1 −1 tests/scripts/thread-cert/v1_2_test_single_probe.py
+14 −14 tests/toranj/build.sh
+0 −6 tests/toranj/cli/cli.py
+0 −162 tests/toranj/cli/test-024-mle-adv-imax-change.py
+0 −2 tests/toranj/openthread-core-toranj-config-simulation.h
+0 −1 tests/toranj/start.sh
+0 −21 tests/unit/CMakeLists.txt
+0 −118 tests/unit/test_srp_server.cpp
+0 −516 tests/unit/test_trickle_timer.cpp
+14 −14 third_party/tcplp/tcplp.h
+4 −1 tools/harness-thci/OpenThread.py
+2 −2 tools/otci/otci/otci.py
+1 −1 tools/otci/tests/test_otci.py
2 changes: 1 addition & 1 deletion third_party/pigweed/repo
Submodule repo updated 56 files
+0 −1 PIGWEED_MODULES
+21 −27 WORKSPACE
+0 −1 docs/BUILD.gn
+0 −1 pw_allocator/docs.rst
+12 −20 pw_allocator/public/pw_allocator/freelist.h
+0 −1 pw_base64/docs.rst
+4 −11 pw_base64/public/pw_base64/base64.h
+99 −184 pw_bluetooth/public/pw_bluetooth/hci.emb
+0 −18 pw_build/bazel_internal/BUILD.bazel
+0 −4 pw_build/generated_pigweed_modules_lists.gni
+0 −6 pw_build_info/BUILD.bazel
+0 −28 pw_docgen/docs.rst
+3 −0 pw_env_setup/bazel/cipd_setup/cipd_rules.bzl
+2 −0 pw_env_setup/bazel/cipd_setup/internal/cipd_internal.bzl
+0 −27 pw_env_setup/py/BUILD.gn
+0 −4 pw_env_setup/py/cipd_setup_update_test.py
+1 −1 pw_env_setup/py/pw_env_setup/cipd_setup/go.json
+14 −2 pw_env_setup/py/pw_env_setup/cipd_setup/msrv_python.json
+15 −2 pw_env_setup/py/pw_env_setup/cipd_setup/python.json
+0 −17 pw_env_setup/py/pw_env_setup/cipd_setup/python310.json
+0 −18 pw_env_setup/py/pw_env_setup/cipd_setup/python311.json
+0 −17 pw_env_setup/py/pw_env_setup/cipd_setup/python38.json
+0 −17 pw_env_setup/py/pw_env_setup/cipd_setup/python39.json
+0 −15 pw_env_setup/py/pw_env_setup/cipd_setup/update.py
+0 −15 pw_env_setup/py/pw_env_setup/env_setup.py
+0 −1 pw_env_setup/py/pw_env_setup/virtualenv_setup/constraint.list
+111 −111 pw_env_setup/py/pw_env_setup/virtualenv_setup/constraint_hashes.list
+0 −1,214 pw_env_setup/py/pw_env_setup/virtualenv_setup/constraint_hashes_darwin.list
+0 −1,212 pw_env_setup/py/pw_env_setup/virtualenv_setup/constraint_hashes_windows.list
+0 −1,297 pw_env_setup/py/pw_env_setup/virtualenv_setup/upstream_requirements_darwin_lock.txt
+125 −125 pw_env_setup/py/pw_env_setup/virtualenv_setup/upstream_requirements_lock.txt
+0 −1,295 pw_env_setup/py/pw_env_setup/virtualenv_setup/upstream_requirements_windows_lock.txt
+8 −4 pw_env_setup/py/setup.cfg
+0 −8 pw_fuzzer/fuzzer.bzl
+3 −3 pw_i2c/docs.rst
+4 −4 pw_i2c/i2c.proto
+2 −14 pw_i2c_mcuxpresso/docs.rst
+7 −18 pw_i2c_mcuxpresso/initiator.cc
+2 −11 pw_i2c_mcuxpresso/initiator_test.cc
+6 −19 pw_i2c_mcuxpresso/public/pw_i2c_mcuxpresso/initiator.h
+3 −19 pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
+20 −29 pw_presubmit/py/pw_presubmit/python_checks.py
+0 −3 pw_spi/BUILD.bazel
+16 −16 pw_spi/docs.rst
+1 −1 pw_spi/public/pw_spi/chip_selector.h
+6 −6 pw_spi/public/pw_spi/device.h
+1 −1 pw_spi/public/pw_spi/initiator.h
+1 −1 pw_stream/public/pw_stream/stream.h
+0 −49 pw_stream_uart_linux/Android.bp
+0 −49 pw_stream_uart_linux/BUILD.bazel
+0 −45 pw_stream_uart_linux/BUILD.gn
+0 −1 pw_stream_uart_linux/OWNERS
+0 −37 pw_stream_uart_linux/docs.rst
+0 −65 pw_stream_uart_linux/public/pw_stream_uart_linux/stream.h
+0 −111 pw_stream_uart_linux/stream.cc
+0 −39 pw_stream_uart_linux/stream_test.cc

0 comments on commit 43b3c0b

Please sign in to comment.