From 53225ef3e235b93a7d4ff5747a320b7a433be317 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Mon, 19 Aug 2024 12:02:46 +0000 Subject: [PATCH] Restyled by prettier-markdown --- docs/testing/python.md | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/docs/testing/python.md b/docs/testing/python.md index 0dbac9ba4766f4..5271d4ca4d6097 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -499,17 +499,28 @@ Fabric admin for default controller: ## Automating manual steps -Some test plans have manual steps that require the tester to manually change the state of the DUT. To run these tests in a CI environment, specific example apps can be built such that these manual steps can be achieved by matter or named-pipe commands. +Some test plans have manual steps that require the tester to manually change the +state of the DUT. To run these tests in a CI environment, specific example apps +can be built such that these manual steps can be achieved by matter or +named-pipe commands. -In the case that all the manual steps in a test scricpt can be achieved just using matter commands, you can check if the `PICS_SDK_CI_ONLY` PICS is set to decide if the test script should send the required matter commands to perform the manual step. +In the case that all the manual steps in a test scricpt can be achieved just +using matter commands, you can check if the `PICS_SDK_CI_ONLY` PICS is set to +decide if the test script should send the required matter commands to perform +the manual step. ```python self.is_ci = self.check_pics("PICS_SDK_CI_ONLY") ``` -In the case that a test script requires the use of name-pipe commands to achieve the manual steps, you can use the `write_to_app_pipe(command)` to send these commands. This command requires the test class to define a `self.app_pipe` string value with the name of the pipe. This depends on how the app is set up. +In the case that a test script requires the use of name-pipe commands to achieve +the manual steps, you can use the `write_to_app_pipe(command)` to send these +commands. This command requires the test class to define a `self.app_pipe` +string value with the name of the pipe. This depends on how the app is set up. -If the name of the pipe is dynamic and based on the app's PID, the following snippet can be added to the start of tests that use the `write_to_app_pipe` method. +If the name of the pipe is dynamic and based on the app's PID, the following +snippet can be added to the start of tests that use the `write_to_app_pipe` +method. ```python app_pid = self.matter_test_config.app_pid @@ -518,17 +529,27 @@ if app_pid != 0: self.app_pipe = "/tmp/chip__fifo_" + str(app_pid) ``` -This requires the test to be executed with the `--app-pid` flag set if the manual steps should be executed by the script. This flag sets the process ID of the DUT's matter application. +This requires the test to be executed with the `--app-pid` flag set if the +manual steps should be executed by the script. This flag sets the process ID of +the DUT's matter application. ### Running on a separate machines -If the DUT and test script are running on different machines, the `write_to_app_pipe` method can send named-pipe commands to the DUT via ssh. This requires two additional environment variables: -- `LINUX_DUT_IP` sets the DUT's IP address -- `LINUX_DUT_UNAME` sets the DUT's ssh username. If not set, this is assumed to be `root`. +If the DUT and test script are running on different machines, the +`write_to_app_pipe` method can send named-pipe commands to the DUT via ssh. This +requires two additional environment variables: + +- `LINUX_DUT_IP` sets the DUT's IP address +- `LINUX_DUT_UNAME` sets the DUT's ssh username. If not set, this is assumed + to be `root`. + +The `write_to_app_pipe` also requires that ssh-keys are set up to access the DUT +from the machine running the test script without a password. You can follow +these steps to set this up: -The `write_to_app_pipe` also requires that ssh-keys are set up to access the DUT from the machine running the test script without a password. You can follow these steps to set this up: 1. If you do not have a key, create one using `ssh-keygen`. -2. Authorise this key on the remote host: run `ssh-copy-id user@ip` once, using your password. +2. Authorise this key on the remote host: run `ssh-copy-id user@ip` once, using + your password. 3. From now on `ssh user@ip` will no longer ask for your password. ## Other support utilities