Skip to content

Commit

Permalink
update due to TP changes (#29606)
Browse files Browse the repository at this point in the history
  • Loading branch information
plauric authored and pull[bot] committed Feb 2, 2024
1 parent 9d2262f commit 2050648
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/python_testing/TC_RVCCLEANM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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")

Expand All @@ -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)
Expand Down
6 changes: 5 additions & 1 deletion src/python_testing/TC_RVCRUNM_2_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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")

Expand All @@ -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)
Expand Down

0 comments on commit 2050648

Please sign in to comment.