From 7c3bce3a4f5c06c795763f5e0d7cb779052d5163 Mon Sep 17 00:00:00 2001 From: Abtin Keshavarzian Date: Thu, 4 Apr 2019 17:48:44 -0700 Subject: [PATCH] [toranj] verify "RCPVersion" is gettable on posix-app mode (#3735) This commit updates the `test-001` to allow extra properties to be verified when running under posix-app model. The new test ensures "POSIXApp:RCPVersion" is gettable. --- tests/toranj/test-001-get-set.py | 8 ++++++++ tests/toranj/wpan.py | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/toranj/test-001-get-set.py b/tests/toranj/test-001-get-set.py index f14c61d38..2c9a6e1f4 100644 --- a/tests/toranj/test-001-get-set.py +++ b/tests/toranj/test-001-get-set.py @@ -174,11 +174,19 @@ all_gettable_props = [ wpan.WPAN_THREAD_STABLE_LEADER_NETWORK_DATA ] +all_posix_app_gettable_props = [ + wpan.WPAN_RCP_VERSION +] + node.form('get-set') for prop in all_gettable_props: node.get(prop) +if node.using_posix_app_with_rcp: + for prop in all_posix_app_gettable_props: + node.get(prop) + #----------------------------------------------------------------------------------------------------------------------- # Test finished diff --git a/tests/toranj/wpan.py b/tests/toranj/wpan.py index 0b9243631..90e1cb2cf 100644 --- a/tests/toranj/wpan.py +++ b/tests/toranj/wpan.py @@ -58,6 +58,7 @@ WPAN_NCP_VERSION = 'NCP:Version' WPAN_NCP_MCU_POWER_STATE = "NCP:MCUPowerState" WPAN_NETWORK_ALLOW_JOIN = 'com.nestlabs.internal:Network:AllowingJoin' WPAN_NETWORK_PASSTHRU_PORT = 'com.nestlabs.internal:Network:PassthruPort' +WPAN_RCP_VERSION = "POSIXApp:RCPVersion" WPAN_IP6_LINK_LOCAL_ADDRESS = "IPv6:LinkLocalAddress" WPAN_IP6_MESH_LOCAL_ADDRESS = "IPv6:MeshLocalAddress" @@ -298,11 +299,11 @@ class Node(object): # Check if env variable `TORANJ_POSIX_APP_RCP_MODEL` is defined # and use it to determine if to use operate in "posix-ncp-app". if self._POSIX_APP_ENV_VAR in os.environ: - use_posix_app_with_rcp = (os.environ[self._POSIX_APP_ENV_VAR] in ['1', 'yes']) + self._use_posix_app_with_rcp = (os.environ[self._POSIX_APP_ENV_VAR] in ['1', 'yes']) else: - use_posix_app_with_rcp = False + self._use_posix_app_with_rcp = False - if use_posix_app_with_rcp: + if self._use_posix_app_with_rcp: ncp_socket_path = 'system:{} -s {} {} {}'.format(self._OT_NCP_FTD_POSIX_APP, self._SPEED_UP_FACTOR, self._OT_NCP_RADIO, index) else: @@ -350,6 +351,10 @@ class Node(object): def tund_log_file(self): return self._tund_log_file + @property + def using_posix_app_with_rcp(self): + return self._use_posix_app_with_rcp + #------------------------------------------------------------------------------------------------------------------ # Executing a `wpanctl` command