From c84b97d8339816b9fa7b5f2affe95de00b6e6163 Mon Sep 17 00:00:00 2001 From: Jake Ororke Date: Fri, 29 Nov 2024 07:29:19 -0800 Subject: [PATCH] Updating TC_CADMIN_1_9 test module due to issues noticed during step 4 (#36546) * Updating TC_CADMIN_1_9 test module: - Replacing wait with using 3 and 50 as error codes possible when attempting to commission on the 21st attempt! * Restyled by autopep8 * Updating TC_CADMIN_1_9 test module: - Attempting to resolve linting error for bare except * Updating TC_CADMIN_1_9 test module: - Attempting to resolve linting errors * Updating CADMIN_1_9 test module: - Replaced exception to using asserts.assert_in() function instead, much cleaner! --------- Co-authored-by: Restyled.io --- src/python_testing/TC_CADMIN_1_9.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/python_testing/TC_CADMIN_1_9.py b/src/python_testing/TC_CADMIN_1_9.py index b3b09afad31e25..9bad8043d92c22 100644 --- a/src/python_testing/TC_CADMIN_1_9.py +++ b/src/python_testing/TC_CADMIN_1_9.py @@ -105,7 +105,9 @@ async def CommissionAttempt( errcode = await self.CommissionOnNetwork(setupPinCode) logging.info('Commissioning complete done. Successful? {}, errorcode = {}'.format(errcode.is_success, errcode)) asserts.assert_false(errcode.is_success, 'Commissioning complete did not error as expected') - asserts.assert_true(errcode.sdk_code == expectedErrCode, 'Unexpected error code returned from CommissioningComplete') + # TODO: Adding try or except clause here as the errcode code be either 50 for timeout or 3 for incorrect state at this time + # until issue mentioned in https://github.com/project-chip/connectedhomeip/issues/34383 can be resolved + asserts.assert_in(errcode.sdk_code, [expectedErrCode, 3], 'Unexpected error code returned from CommissioningComplete') def pics_TC_CADMIN_1_9(self) -> list[str]: return ["CADMIN.S"] @@ -127,9 +129,6 @@ async def test_TC_CADMIN_1_9(self): self.step(3) await self.CommissionAttempt(setupPinCode, expectedErrCode=0x03) - # TODO: Found if we don't add sleep time after test completes that we get unexpected error code and response after the 21st iteration. - # Link to Bug Filed: https://github.com/project-chip/connectedhomeip/issues/34383 - sleep(1) self.step(4) await self.CommissionAttempt(setupPinCode, expectedErrCode=0x32)