From bb4523b85ad0db6dbad34e762b93e72d816f9809 Mon Sep 17 00:00:00 2001 From: Petru Lauric Date: Thu, 5 Oct 2023 14:42:56 -0400 Subject: [PATCH] update due to TP changes --- src/python_testing/TC_RVCCLEANM_2_1.py | 6 +++++- src/python_testing/TC_RVCRUNM_2_1.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_RVCCLEANM_2_1.py b/src/python_testing/TC_RVCCLEANM_2_1.py index e082b83bb67a20..3cc58041b6ea37 100644 --- a/src/python_testing/TC_RVCCLEANM_2_1.py +++ b/src/python_testing/TC_RVCCLEANM_2_1.py @@ -88,6 +88,7 @@ class CommonCodes(Enum): SUCCESS = 0x00 UNSUPPORTED_MODE = 0x01 GENERIC_FAILURE = 0x02 + INVALID_IN_MODE = 0x03 rvcCleanCodes = [code.value for code in Clusters.RvcCleanMode.Enums.StatusCode if code is not Clusters.RvcCleanMode.Enums.StatusCode.kUnknownEnumValue] @@ -98,6 +99,8 @@ class CommonCodes(Enum): asserts.assert_true(ret.status == CommonCodes.SUCCESS.value, "Changing the mode to the current mode should be a no-op") if self.check_pics("RVCCLEANM.S.M.CAN_TEST_MODE_FAILURE"): + asserts.assert_true(self.modefail in modes, + "The MODE_CHANGE_FAIL PIXIT value (%d) is not a supported mode" % (self.modefail)) self.print_step(5, "Manually put the device in a state from which it will FAIL to transition to mode %d" % (self.modefail)) input("Press Enter when done.\n") @@ -111,7 +114,8 @@ class CommonCodes(Enum): ret = await self.send_change_to_mode_cmd(newMode=self.modefail) st = ret.status is_mfg_code = st in range(0x80, 0xC0) - is_err_code = (st == CommonCodes.GENERIC_FAILURE.value) or (st in rvcCleanCodes) or is_mfg_code + is_err_code = (st == CommonCodes.GENERIC_FAILURE.value) or ( + st == CommonCodes.INVALID_IN_MODE.value) or (st in rvcCleanCodes) or is_mfg_code asserts.assert_true( is_err_code, "Changing to mode %d must fail due to the current state of the device" % (self.modefail)) st_text_len = len(ret.statusText) diff --git a/src/python_testing/TC_RVCRUNM_2_1.py b/src/python_testing/TC_RVCRUNM_2_1.py index f6be1d2287f371..332f4e6ae7a4f4 100644 --- a/src/python_testing/TC_RVCRUNM_2_1.py +++ b/src/python_testing/TC_RVCRUNM_2_1.py @@ -88,6 +88,7 @@ class CommonCodes(Enum): SUCCESS = 0x00 UNSUPPORTED_MODE = 0x01 GENERIC_FAILURE = 0x02 + INVALID_IN_MODE = 0x03 rvcRunCodes = [code.value for code in Clusters.RvcRunMode.Enums.StatusCode if code is not Clusters.RvcRunMode.Enums.StatusCode.kUnknownEnumValue] @@ -98,6 +99,8 @@ class CommonCodes(Enum): asserts.assert_true(ret.status == CommonCodes.SUCCESS.value, "Changing the mode to the current mode should be a no-op") if self.check_pics("RVCRUNM.S.M.CAN_TEST_MODE_FAILURE"): + asserts.assert_true(self.modefail in modes, + "The MODE_CHANGE_FAIL PIXIT value (%d) is not a supported mode" % (self.modefail)) self.print_step(5, "Manually put the device in a state from which it will FAIL to transition to mode %d" % (self.modefail)) input("Press Enter when done.\n") @@ -111,7 +114,8 @@ class CommonCodes(Enum): ret = await self.send_change_to_mode_cmd(newMode=self.modefail) st = ret.status is_mfg_code = st in range(0x80, 0xC0) - is_err_code = (st == CommonCodes.GENERIC_FAILURE.value) or (st in rvcRunCodes) or is_mfg_code + is_err_code = (st == CommonCodes.GENERIC_FAILURE.value) or ( + st == CommonCodes.INVALID_IN_MODE.value) or (st in rvcRunCodes) or is_mfg_code asserts.assert_true( is_err_code, "Changing to mode %d must fail due to the current state of the device" % (self.modefail)) st_text_len = len(ret.statusText)