21 Using the Command-Line Interface

This chapter describes how to use Command-Line Interface (CLI) to perform actions in Oracle Communications Solution Test Automation Platform.

Publishing Data using Command Line Interface

Solution Test Automation Platform utilizes the command-line interface to perform various actions. The help command provides a comprehensive list of all commands within STAP. Running the help displays each command's name alongside a brief description of its function

To retrieve information on how to run actions in STAP, run the help command:
$ ./stap --help
The following is the syntax of the output received after running the help command:
$ ./stap --help
=============================================================
Solution Test Automation Platform CLI
Version : 1.25.0
=============================================================
Usage: stap --<service> -<command> [<parameters>]
 
Global Options:
 
--version                                          Shows the STAP CLI version
 
--help                                             Shows the STAP CLI command documentation
                        [<service> [<command>]]    Print help for module or command in module
 
--automation                                       automation client operations
 
        -compile                                   Compiles the automation scenarios
                        workspace                  STAP workspace location
                                                   Valid folder path
                                                   Default Value: Current Directory
                        scenarios                  one or more scenarios to compile
                                                   List of values
                                                   Default Value:
                        generate                   Generate the result files from compile
                                                   One of the values : [NO, YES, MERGE]
                        config                     compile configuration
                                                   Valid file path
 
        -run                                       Run the automation scenarios
                        workspace                  STAP workspace location
                                                   Valid folder path
                                                   Default Value: Current Directory
                        scenarios                  one or more scenarios to run
                                                   List of values
                                                   Default Value: Selects scenarios as per configuration or tags
                                                   Optional Group : Scenario Selection
                        tags                       Select scenarios matching the tags
                                                   List of values
                                                   Optional Group : Scenario Selection
                        caseTags                   Select cases matching the tags
                                                   List of values
                                                   Depends on : tags
                        config                     compile configuration
                                                   Valid file path
                                                   Optional Group : Scenario Selection
                        mode                       Execution mode
                                                   One of the values : [trail, execute]
 
--publish                                          publish action
 
        -action                                    publish
                        workspace                  STAP workspace location
                                                   Valid folder path
                                                   Default Value: Current Directory
 
        -environment                               publish
                        workspace                  STAP workspace location
                                                   Valid folder path
                                                   Default Value: Current Directory
 
        -scenario                                  publish
                        workspace                  STAP workspace location
                                                   Valid folder path
                                                   Default Value: Current Directory
 
--simulation                                       Run simulation
 
        -run                                       publish
                        workspace                  STAP workspace location
                                                   Valid folder path
                                                   Default Value: Current Directory
 
        -compile                                   publish
                        workspace                  STAP workspace location
                                                   Valid folder path
                                                   Default Value: Current Directory
 
--secure                                           environment simulation
 
        -environment                               publish
                        filepath                   path to the JCEKS file
                                                   Valid folder path
                                                   Mandatory: Yes
                        keyfilepath                Provide the path to your .properties file containing the data to be encrypted.
                                                   Valid folder path
                                                   Mandatory: Yes
                        keystorepass               keystore password.
                                                   Valid folder path
                                                   Mandatory: Yes
                        aliasname                  alias name identifying the secret key
                                                   Valid folder path
                                                   Mandatory: Yes
The help command provides all the information required to perform various actions in STAP. For example, to retrieve information about your current STAP version, run the following command:
$ ./stap --version
=============================================================
Solution Test Automation Platform CLI
Version : 1.25.0
Run the following command to run scenarios:
./stap --automation -run "workspace=<path>"
Alternatively, you can also run the help command to specifically search for command lines for a particular type of action. For example, to retrieve all commands related to running STAP run the following command:
$ ./stap --help secure
The following is the example output upon running this command: $ ./stap --help secure:

Solution Test Automation Platform CLI
Version : 1.25.0.0
=============================================================
config/cli/secure.service.properties
Usage: stap --<service> -<command> [<parameters>]
 
Global Options:
 
--secure                                environment simulation
 
        -environment                    publish
                        filepath        path to the JCEKS file
                                        Valid folder path
                                        Mandatory: Yes
                        keyfilepath     Provide the path to your .properties file containing the data to be encrypted.  
                                        Valid folder path
                                        Mandatory: Yes
                        keystorepass    keystore password.
                                        Valid folder path
                                        Mandatory: Yes
                        aliasname       alias name identifying the secret key
                                        Valid folder path
                                        Mandatory: Yes
You can use this syntax to run the secure command in your STAP environment. On the basis of the above response, secure your STAP environment using the following command:
./stap --secure -environment filepath=<path> keyfilepath=<path> keystorepass=<keystorepass> aliasname=<name>
Upon running this command, you will receive a response similar to the following:
./stap --secure -environment filepath=<path> keyfilepath=<path> keystorepass=<keystorepass> aliasnam=<name>
[hostname STAP]$ ./stap --secure -environment keyfilepath=encrypt/env.jceks filepath=sampleWorkSpace/config/environments/tdaasEnvironment.properties keystorepass=Welcome@1 aliasname=password
=============================================================
STAP Automation Platform CLI
Version : 1.25.1.0.0
=============================================================
sampleWorkSpace/config/environments/tdaasEnvironment.properties
basic.password=${SECURE_PWD}
Enter new password for "basic.password":
password
Password updated successfully.
[hostname STAP]$

To publish automation reports to third-party web servers, see "Publishing Reports Using Third-Party Web Servers".