Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RVC device Python TC 2.1 - update due to TP change #29606

Merged
merged 1 commit into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading