Skip to content

Commit

Permalink
[Test] Creating TC_CADMIN_1_3 and TC_CADMIN_1_4 python test modules (#…
Browse files Browse the repository at this point in the history
…35818)

* [Test] Creating TC_CADMIN_1_3 python test module:
- Current WIP script creation following test steps in PR: CHIP-Specifications/chip-test-plans#4689

* Restyled by autopep8

* Restyled by isort

* Update TC_CADMIN_1_3:
- Updated TC_CADMIN_1_3 to latest CI format

* Updated TC_CADMIN_1_3:
- Resolving linting errors

* Restyled by autopep8

* Renamed TC_CADMIN_1_3 to TC_CADMIN_1_3_4 test module:
- Appended WIP CADMIN_1_4 test script to TC_CADMIN_1_3 test module
- Renamed TC_CADMIN_1_3 to TC_CADMIN_1_3_4
- Added issue in a TODO comment since current workaround in place to make CADMIN_1_3 pass

* Update TC_CADMIN_1_3_4.py

- Updated test step 14 for TC_CADMIN_1_3 to contain correct information

* Updating TC_CADMIN_1_3_4 test module:
- Minor change to attempt resolving restylizer issue

* Updated TC_CADMIN_1_3_4 test module:
- Updating to resolve some linting issues

* Update src/python_testing/TC_CADMIN_1_3_4.py

Updating to reflect change in master for "factory-reset", thank you @arkq

Co-authored-by: Arkadiusz Bokowy <[email protected]>

* Updated TC_CADMIN_1_3_4 test module:
- Now using get_setup_payload_info() to gather discriminator and passcode for BCM commissioning in TC_CADMIN_1_4

* Restyled by autopep8

* Updating TC_CADMIN_1_3_4 test module:
- Resolved linting issue

* Restyled by autopep8

* Updating TC_CADMIN_1_3_4 and matter_testing modules:
- Updating TC_CADMIN_1_3_4 due to change to matter_testing_support module
- Updating matter_testing module to resolve missing dependencies not found in chip library.

* Restyled by autopep8

* Restyled by isort

* Update matter_testing.py

Reverting changes back as just needed to rebuild the python environment to get this working.

* Update matter_testing.py

Updating location of imported new modules for chip.testing to match with master

* Updated TC_CADMIN_1_3_4 test module:
- Added revoke commissioning after test step 13 to revoke commissioning window.

* Updated TC_CADMIN_1_3_4 test module:
- Enabled verbose output to identify issue noticed in CI/CD pipeline Linux REPL tests

* Updating TC_CADMIN_1_3_4 test module:
- Removed local OpenCommissiongWindow and CommissionAttempt functions
- Started using openCommissioningWindow function from matter_testing support module

* Restyled by autopep8

* Updating TC_CADMIN_1_3_4 test module:
- Resolving lint errors

* Added TC_CADMIN_1_4_nofreset test module:
- Added new test module to verify that if no factory reset occurs between TC_CADMIN_1_3_4 test modules and TC_CADMIN_1_4_nofreset, how to handle that situation for BCM.

* Restyled by autopep8

* Updated TC_CADMIN_1_4_nofreset test module:
- Resolved linting errors

* Updated TC_CADMIN_1_4_nofreset test module and manualTests.json:
- Removed TC_CADMIN_1_3 and TC_CADMIN_1_4 from manualTests.json MultipleFabrics section
- Updated TC_CADMIN_1_4_nofreset to remove commissioning attempt before start of test.

* Moved TC_CADMIN_1_4_nofreset to unit testing framework:
- Moved TC_CADMIN_1_4_nofreset to unit testing framework folder and renamed it to test_TC_CADMIN_1_4

* Updated TC_CADMIN_1_3_4 and unit test test_TC_CADMIN_1_4
- Placed assert for if get_setup_payload_info() at start of test_CADMIN_1_4 test function
- updated test_TC_CADMIN_1_4 test function name

* Restyled by autopep8

* Restyled by isort

* Updated test_TC_CADMIN_1_4:
- Resolving linting errors

* Restyled by autopep8

* Updated tests.yaml:
- Added test_CADMIN_1_4 python unit-test test module to attempt running it in CI

* Updated test_TC_CADMIN_1_4 unit-test module:

* Restyled by autopep8

* Restyled by isort

* Updated test_TC_CADMIN_1_4 test module

* Restyled by autopep8

* Restyled by isort

* Updating test_TC_CADMIN_1_4 unit-test module

* Restyled by autopep8

* Restyled by isort

* Updated test_TC_CADMIN_1_4 unit-test module:
- Attempting to get import to be imported so test runs without restyler changing it back

* Updating test_TC_CADMIN_1_4 unit-test module:
- Resolving lint error

* Updating TC_CADMIN_1_3_4 test module:
- Updating CI argument to turn on quiet mode for this test module

* Updated test_TC_CADMIN_1_4:
- Updated to using isort off to avoid CI re-sorting the dependencies during this test run

* Restyled by autopep8

* Restyled by isort

* Updating test_TC_CADMIN_1_4 unit-test module:
- Updating to get isort to not sort dependicies for this test

* Restyled by autopep8

* Restyled by isort

* Updating test_TC_CADMIN_1_4 unit-test module:
- Reverting back to setting dependency in test function as not able to get isort to not sort it out of position

* Restyled by isort

* Added TC_CADMIN_1_4_noreset test module and updated test_TC_CADMIN_1_4:
- Added TC_CADMIN_1_4_noreset test module to attempt validation of script with no factory reset between tests
- Updated test_TC_CADMIN_1_4 unit-test module to exit if credentials not found.

* Restyled by autopep8

* Restyled by isort

* Updated TC_CADMIN_1_4_noreset test module:
- Resolving lint issues

* Updated TC_CADMIN_1_4_noreset test module:
- reorganizing CI args to attempt testing with factory-reset disabled

* Updating TC_CADMIN_1_4_noreset, tests.yaml, and execute_python_test:
- Updating to attempt to get TC_CADMIN_1_4_noreset to get it to run in CI

* Restyled by autopep8

* Updated TC_CADMIN_1_4_noreset test module:
- Removed commissioning-method CI argument to not run commissioning before start of this test

* Delete src/python_testing/test_testing/test_TC_CADMIN_1_4.py

Removing unneeded small unit-test due to not needed

* Update tests.yaml

Removed prior unit-test test_TC_CADMIN_1_4.py as it was deleted

* Removed Test_TC_CADMIN_1_3 and Test_TC_CADMIN_1_4 yaml's:
- These 2 yaml scripts are no longer needed as they are being replaced by the python test modules.

* Updated TC_CADMIN_1_3_4 and TC_CADMIN_1_4_noreset:
- Disabled verbose output in CI arguments (quiet mode)

* Updating TC_CADMIN_1_3_4 and tests.yaml:
- Removed calls in tests.yaml for TC_CADMIN_1_3_4 as not needed individual calls for tests now that we have changed the CI arguments
- Removed TC_CADMIN_1_4_noreset standalone test module as we are now using the CI arguments
- Removed the line from execute_python_tests test runner module to remove not call for TC_CADMIN_1_4_noreset test module, as no longer needed
- Renamed class for tests to TC_CADMIN from TC_CADMIN_1_3_4 to possibly encompaculate all CADMIN tests eventually.
- Changed method to get th2_fabric_info to match with the method used to get th1_fabric_info in TC_CADMIN_1_3_4 test module

* Restyled by autopep8

* Updated TC_CADMIN_1_3_4 test module:
- Updated method to cross verify root public key, now using self.certificate_authority_manager.activeCaList

* Restyled by autopep8

* Restyled by isort

* Updating TC_CADMIN_1_3_4 test module:
- Disabling quiet mode in CI arguments

* Updating TC_CADMIN_1_3_4 test module:
- Resolving linting errors with unused imports

* Updating TC_CADMIN_1_3_4 test module:
- Updating to resolve linting issue

* RCAC data callback implementation during commeissioning:
- Updated OpCredsBinding C++ module to include callback functionality to gather RCAC in chip cert format during kGenerateNOCChain commissioning stage
- Updated ChipDeviceCtrl python module to include new functions to establish callback during OnNetworkCommissioning and added a new arg "" for this functionality to trigger the callback when wanted to gather rcac data, also passing that data into tests based off new arg value
- Updated TC_CADMIN_1_3_4 test module to implement gathering and using the RCAC data to validate the rootpublickey matches during testing.

* Restyled by whitespace

* Restyled by clang-format

* Restyled by autopep8

* Updated OpCredsBinding C++ module:
- Removed some unneccessary dependencies that had been used during debugging

* Updating OpsCredsBinding.cpp and ChipDeviceCtrl.py:
- Some further cleanup performed.

* Restyled by clang-format

* Updated OpCredsBinding C++ module:
- Removed some unneccessary code for cleanup of debugging session
- Removed else statement from pychip_SetCommissioningRCACCallback void function

* Updated OpCredsBinding C++ module:
- Changed from using ScopedMemoryBuffer to establishing pointer in vector to avoid leaks

* Updating OpCredsBinding C++ module and ChipDeviceCtrl python module:
- Removed prior callbacks and replaced with function to remove additional complexity that could cause issues, making it simple

* Update manualTests.json

Removing files TC_CADMIN_1_21 and TC_CADMIN_1_22 as latest merge from TC_CADMIN_1_22 and TC_CADMIN_1_24 should have removed those files from this file.

* Restyled by whitespace

* Restyled by clang-format

* Restyled by autopep8

* Restyled by isort

* Updating ChipDeviceCtrl and TC_CADMIN_1_3_4 modules:
- Removed additional commented out line of code in TC_CADMIN_1_3_4 test module.
- Updated ChipDeviceCtrl module to move rcac_bytes var setting to a new function, removed additional print line.
- Updated ChipDeviceCtrl module to await before setting the rcac_bytes var.

* Updating OpCredsBinding C++ module:
- Removed rcacByteSpan var as not needed in order to convert data before passing data to python3

* Restyled by autopep8

* Updating ChipDeviceCtrl module:
- Resolving linting error

* Updating TC_CADMIN_1_3_4 test module:
- Changing to using self.th1.OpenCommissioningWindow() in place of self.openCommissioningWindow() to resolve issue noticed in CI.

* Restyled by autopep8

* Updating ChipDeviceCtrl and TC_CADMIN_1_3_4 modules:
- Moved get_rcac() to a standalone function that can be called after commissioning is completed in ChipDeviceCtrl module
- Updated TC_CADMIN_1_3_4 test module to using the new standalone function self.th.get_rcac()

* Updating OpCredsBinding C++ and ChipDeviceCtrl python modules:
- Changing to allocating memory from python to store RCAC data captured from C++ module

* Updated ChipDeviceCtrl python module:
- Changed buffer size for storing RCAC to 650 from 1024

* Restyled by clang-format

* Restyled by autopep8

* Updated ChipDeviceCtrl and TC_CADMIN_1_3_4 python modules:
- Removed unneeded get_commissioning_rcac_data_async()
- Removed commented out python bindings
- Removed fail safes as no longer needed with new method of gathering RCAC in place

* Restyled by autopep8

* Updated TC_CADMIN_1_3_4 test module:
- Created combined_commission_val_steps function in order to combine test steps 1-7 to be used for both CADMIN_1_3 and CADMIN_1_4 tests.

* Restyled by autopep8

* Restyled by clang-format

* Updating OpCredsBinding and ChipDeviceCtrl modules:
- Update to OpCredsBinding C++ module was to add a missing bracket
- Update ChipDeviceCtrl python module was to change to using 400 instead of 650 for buffer size to store RCAC data

* Updating OpCredsBinding and ChipDeviceCtrl modules:
- Including change to pass in set buffer size for allocation check before passing RCAC data back to python3 from C++ module

* Restyled by autopep8

* Update ChipDeviceCtrl.py

Updated to include reference to key sizes in spec 6.1.5

* Updating OpCredsBinding and ChipDeviceCtrl modules:
- Removed try and except block from get_rcac()
- Changed method to make sure that we aren't getting returned a partial cert

* Updating ChipDeviceCtrl python module:
- Updating to include better logger message when RCAC returns 0 sized data
- Updating to remove prior commented out no longer needed code block

* Update OpCredsBinding C++ module

- Moved comment into correct indent area

* Restyled by clang-format

* Updating OpCredsBinding C++ module:
- Resolving linting errors for log message if RCAC data size greater than allocated buffer size

* Updating OpCredsBinding C++ module:
- Updating Logging message for allocated buffer being too small to house RCAC data size, this should hopefully not happen.

---------

Co-authored-by: Restyled.io <[email protected]>
Co-authored-by: Arkadiusz Bokowy <[email protected]>
  • Loading branch information
3 people authored Feb 26, 2025
1 parent 6947f9b commit 3c9c7e6
Show file tree
Hide file tree
Showing 6 changed files with 428 additions and 923 deletions.
Loading

0 comments on commit 3c9c7e6

Please sign in to comment.