-
-e|--engine Engine for running test(s). Possible values:
llvm,mc7porplcsim -
--ignore-scripts Do not run pretest and posttest scripts.
-
-t|--target Target IP address of the PLC. Required when target is
mc7porplcsim. -
--targetIP Parameter
targetIPis deprecated and will soon be removed. Use parameter--targetinstead. Target IP address of the PLC. Required when target ismc7porplcsim. -
u|--username Parameter is optional. The username is required for PLCs with enabled user management and access control (UMAC). For all PLCs with legacy access control, the username must not be used! Add a legitimation username for the PLC (e.g.
-u "My_UserName"). The legitimation with username requires a password provided via option--password. The username may only contain ASCII7 characters. Be aware that non-ASCII characters in the username will be removed, so the username will be invalid and access to the PLC will be denied! -
--password The password for access to the PLC (e.g.
--password ""). If you use the flag with an empty string, a secure prompt will appear, and you can enter the password safely. Otherwise, this password can also be submitted in clear text (e.g.--password "MY_PASSWORD"). But that way is not recommended. -
-C|--certificate The file containing the public key for communicating with the PLC. The certificate can be either extracted from TIA Portal or from the SIMATIC S7-1500 PLC via certificate management.
-
--playlist Specifies the playlist file path.
-
-l Specifies log level. Possible values:
info(default) ordebug -
--filter Runs specific tests with a filter.
-
-f Parameter
fis deprecated and will soon be removed, since its reserved for "forcing". Use parameter--filterinstead. Runs specific tests with a filter. -
-c|--coverage Runs tests with user code coverage. Read here for further information.
-
--no-build Uses the last test artifact again for the test. The test will ignore the code changes you made since the last test run. If the last run used a restricted test set, e.g. the filter option or a playlist, the same restricted test set will be used again. You must perform the tests without this parameter at least once for a test artifact to be available.
Note: Currently, this parameter only works with the contributed test command: Useapax run-command test --no-buildinstead ofapax test --no-build.
The APAX_TEST_ARGS environment variable can be used to pass additional arguments to the axunitst runner call that is made by this command. The variable must be a valid JSON array containing the additional argument strings. The easiest way to set the environment variable is to use the variables section in the apax.yml file, which provides convenient support for arrays.
For example, you can add following lines in the apax.yml file to run the tests with user code coverage:
variables:
APAX_TEST_ARGS:
- "-c" # generate coverage information in test run
The priority of the set arguments is as follows:
| Priority | Where |
|---|---|
| Low | Environment variables and workspace settings |
| Medium | APAX_TEST_ARGS variables in apax.xml file |
| High | Command line argument |
Example of how to run tests on targets:
apax test
apax test -e mc7p -t "192.168.10.1"
apax test -e plcsim -t "192.168.10.1"
apax test -e plcsim -t "192.168.10.1" -u "MyUsername" --password "" -C "./pathToCertificateFile"
Note
The IP address in the -t parameter in the apax test command will be overridden if the AXUNIT_TARGET_IP variable is provided under the variables section in the apax.yml file.
It is recommended that the password parameter is passed as an empty string to get a secure password prompt. This allows the user to enter the password safely.