From 10476104710d51219b45a8e00ee420cdb126b650 Mon Sep 17 00:00:00 2001 From: Petru Lauric <81822411+plauric@users.noreply.github.com> Date: Mon, 9 Oct 2023 06:35:34 -0400 Subject: [PATCH] update due to TP changes (#29606) --- 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)