-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #708 from CaroMac/SBtestsonCLI
run SB tests from cli
- Loading branch information
Showing
20 changed files
with
393 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/markdown-pages/docs/cli-command-reference/cli-command-reference-about.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--- | ||
path: "/docs/cli-command-reference/cli-command-reference-about" | ||
title: "Galasa CLI commands" | ||
--- | ||
|
||
Galasa CLI commands start with `galasactl`. Example commands are provided for running on Mac or Unix, and Windows Powershell. The Windows Powershell uses the backtick (`) for line continuation characters. If you are using Windows command-shell, the line continuation character is the caret (^). | ||
|
||
You can view the Galasa CLI command syntax, including parameter descriptions, in the <a href=https://github.com/galasa-dev/cli/blob/main/docs/generated/galasactl.md target="_blank"> cli repository</a> in GitHub. | ||
|
||
|
||
## Getting help | ||
|
||
Once you have installed the Galasa CLI, you can use the following command to get more information about the command and command options, including default values. | ||
|
||
``` | ||
galasactl --help | ||
``` | ||
|
||
Use the `--log` option to send logging information to a file. Any folder that is referenced must exist. Existing files are overwritten. Specify `-` to log to `stderr`. The default is no logging. | ||
|
||
``` | ||
galasactl --log <logFilePath> | ||
``` | ||
|
||
## Errors | ||
|
||
You can view a list of error messages that can be generated by the galasactl tool in the <a href="https://github.com/galasa-dev/cli/blob/main/docs/generated/errors-list.md" target="_blank"> Galasa cli repository</a> in GitHub. | ||
|
||
|
||
## Known limitations | ||
|
||
Go programs can sometimes struggle to resolve DNS names, especially when a working over a virtual private network (VPN). In such situations, you might notice that a bootstrap file cannot be found with galasactl, but can be found by a desktop browser, or curl command. In such situations you can manually add the host detail to the `/etc/hosts` file, to avoid DNS being involved in the resolution mechanism. | ||
|
||
|
||
|
||
## Next steps | ||
|
||
To install Galasa for using in the command line, follow the instructions in the [Installing the Galasa CLI](/docs/cli-command-reference/installing-cli-tool) documentation. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/markdown-pages/docs/cli-command-reference/exploring-simbank-tests.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
path: "/docs/exploring-simbank-tests" | ||
title: "Exploring the supplied SimBank tests" | ||
--- | ||
|
||
Galasa SimBank comes with a selection of prepared Galasa tests. Explore the SimBank IVT test and the other SimBank tests in the following sections. Follow the flow of logic in these classes and understand more about the Java that is used to create them, including how to use Galasa annotations and review documented test methods. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
src/markdown-pages/docs/cli-command-reference/running-simbank-tests-cli.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
--- | ||
path: "/docs/running-simbank-tests-cli" | ||
title: "Running the SimBank tests using the CLI" | ||
--- | ||
|
||
You can explore Galasa further with Galasa Simbank. Galasa Simbank is a simulated bank application that showcases Galasa's functionality within an application. Galasa SimBank comes with a selection of prepared Galasa tests: | ||
|
||
- A basic Installation Verification Test (IVT) which logs on to SimBank - `SimBankIVT.java`. | ||
- A test that updates an account using web services and examines the changes with 3270 screens - `BasicAccountCreditTest.java`. | ||
- A test that uses a provisioned account object to perform the same test as `BasicAccountCreditTest.java` in an improved test design - `ProvisionedAccountCreditTests.java`. | ||
- A test that exercises the z/OS Batch Manager by simulating the submission of a JCL job to add a number of accounts to the SimBank system - `BatchAccountsOpenTest.java`. | ||
|
||
The following sections explain how to run the `SimBankIVT` test class by using the CLI. Make sure that you have installed the Galasa CLI tool and Java version 11 JDK, and set the JAVA_HOME environment variable, as described in the _Installing the Galasa CLI_ documentation. | ||
|
||
## Updating the overrides and credentials property files | ||
|
||
|
||
In order to run the Galasa SimBanks tests you need to add some configuration information in the `overrides.properties` and `credentials.properties` files that were created when you initialised your Galasa home folder by running the ```galasactl local init``` command. Complete the following steps to edit the files: | ||
|
||
|
||
1. Edit a file called `overrides.properties` in your `.galasa` folder so that it contains the following configuration properties. Configuration properties held in this file is used by Galasa tests at runtime. You can change the value of the properties that are set in this file to enable you to run tests against different configurations without changing the test code. The following example configuration properties enable the provided Galasa SimBank tests to run on your machine: | ||
|
||
```properties | ||
zos.dse.tag.SIMBANK.imageid=SIMBANK | ||
zos.dse.tag.SIMBANK.clusterid=SIMBANK | ||
|
||
simbank.dse.instance.name=SIMBANK | ||
simbank.instance.SIMBANK.zos.image=SIMBANK | ||
|
||
zos.image.SIMBANK.ipv4.hostname=127.0.0.1 | ||
zos.image.SIMBANK.telnet.port=2023 | ||
zos.image.SIMBANK.webnet.port=2080 | ||
zos.image.SIMBANK.telnet.tls=false | ||
zos.image.SIMBANK.credentials=SIMBANK | ||
|
||
zosmf.image.SIMBANK.servers=SIMBANK | ||
zosmf.server.SIMBANK.image=SIMBANK | ||
zosmf.server.SIMBANK.port=2040 | ||
zosmf.server.SIMBANK.https=false | ||
``` | ||
1. Edit a file called `credentials.properties` in your `.galasa` folder. Credentials that are held in this file are used by Galasa tests, for example to pass credentials to the application being tested. Storing values in this file avoids the need to hard-code credentials inside a test class, enabling the test to run in different environments without changing any test code. The following example properties enable the provided Galasa SimBank tests to run on your machine: | ||
|
||
```properties | ||
secure.credentials.SIMBANK.username=IBMUSER | ||
secure.credentials.SIMBANK.password=SYS1 | ||
``` | ||
|
||
## Running the SimBank IVT test class by using the CLI | ||
|
||
The SimBank tests are held in the <a href="https://github.com/galasa-dev/simplatform" target="_blank"> Galasa simplatform repository</a> in GitHub. To start running the tests you need to clone the repository, if you have not already done so. To find out how to clone the cli repository, follow the instruction in the `Launching SimBank` section in the [Exploring Galasa SimBank using the CLI]() documentation. | ||
|
||
After cloning the repository, complete the following steps to run the SimBankIVT test that is provided with Galasa. The following example uses SimBank OBR version `0.25.0` and Galasa uber OBR version `0.30.0`. | ||
|
||
You can find the version of the `dev.galasa.simbank.obr` that you are using by looking in the `pom.xml` file in the `dev.galasa.simbank.obr` folder. The `dev.galasa.uber.obr` is the OBR that contains all the bundles that are needed for Galasa to work (including the Managers, any required dependencies, the framework, etc). The version of the `dev.galasa.uber.obr` depends on which version of Galasa you have installed. | ||
|
||
|
||
1. Open a terminal, navigate to your `simplatform` directory and run the `./build-locally.sh` script to build the code in both the simbank-tests and the simplaform-application directories. | ||
2. In another terminal run the `./run-locally.sh --server` script to start the simbank server inside a inside a local JVM. In a few seconds, the Eclipse Console window responds with a series of initialization messages, which on Windows looks like: | ||
``` | ||
2019-10-21 14:24:35 INFO dev.galasa.simplatform.main.Simplatform main Starting Simplatform ... | ||
2019-10-21 14:24:35 INFO dev.galasa.simplatform.db.Database setDerbyHome Setting Derby home to C:\Users\<username>\AppData\Local\Temp\galasaSimplatform1440125512154994774 | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.saf.SecurityAuthorizationFacility <init> Creating SAF service | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank accountExists Checking if account: 123456789 exists | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank accountExists Account doesn't exist | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank openAccount Creating account: 123456789 | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank accountExists Checking if account: 987654321 exists | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank accountExists Account doesn't exist | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.application.Bank openAccount Creating account: 987654321 | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.saf.SecurityAuthorizationFacility addUser Added user: IBMUSER | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.main.Simplatform main Loading services... | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.listener.Listener <init> Loading service: dev.galasa.simplatform.listener.WebServiceListener listening on port: 2080 | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.listener.Listener <init> Loading service: dev.galasa.simplatform.listener.TelnetServiceListener listening on port: 2023 | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.main.Simplatform main ... services loaded | ||
2019-10-21 14:24:36 INFO dev.galasa.simplatform.main.Simplatform main Starting Derby Network server.... | ||
2019-10-21 14:24:37 INFO dev.galasa.simplatform.main.Simplatform main ... Derby Network server started on port 2027 | ||
2019-10-21 14:24:37 INFO dev.galasa.simplatform.main.Simplatform main ... Simplatform started | ||
``` | ||
If you are a Mac or Linux user, the messages will be almost identical. | ||
3. In the terminal in which you ran the `./build-locally.sh` script, run the following command to run the SimBankIVT test: | ||
On Mac or Unix: | ||
``` | ||
galasactl runs submit local --log - \ | ||
--obr mvn:dev.galasa/dev.galasa.simbank.obr/0.25.0/obr \ | ||
--obr mvn:dev.galasa/dev.galasa.uber.obr/0.30.0/obr \ | ||
--class dev.galasa.simbank.tests/dev.galasa.simbank.tests.SimBankIVT | ||
``` | ||
On Windows (Powershell): | ||
``` | ||
galasactl runs submit local --log - ` | ||
--obr mvn:dev.galasa/dev.galasa.simbank.obr/0.25.0/obr ` | ||
--obr mvn:dev.galasa/dev.galasa.uber.obr/0.30.0/obr ` | ||
--class dev.galasa.simbank.tests/dev.galasa.simbank.tests.SimBankIVT | ||
``` | ||
where: | ||
- `--log` specifies that debugging information is directed somewhere, and the `-` means that it is sent to the console (stderr). | ||
- `--obr` The `--obr` parameter specifies the Maven co-ordinates of the OBR jar file, in the format `mvn:groupId/artifactId/version/classifier`. The first instance specifies the OBR where the CLI tool can find an OBR which refers to the bundle where the tests are stored. When running locally, all tests must exist in the OBR (or OBRs) that are passed to the tool. The second instance specifies the OBR containing the bundles that are needed for Galasa to work (for example, Galasa Managers, required dependencies, and the Galasa framework). | ||
- `--class` specifies which test class to run. The string is in the format of `<osgi-bundle-id>/<fully-qualified-java-class>`. | ||
4. The `SimBankIVT` test class runs, and the terminal displays its progress through to completion, with an Exit code of `0`. | ||
5. View the results of the test runs in your terminal. You can also view results in the `run.log` file in the result archive store (RAS). 3270 terminal interactions can be viewed in the `artifacts` directory in the RAS. Find out more in the [Viewing test results locally](/docs/cli-command-reference/viewing-test-results-cli) documentation. | ||
To run other SimBank tests, for example `BasicAccountCreditTest`, replace the test class name in the `--class` parameter. For example: | ||
On Mac or Unix: | ||
``` | ||
galasactl runs submit local --log - \ | ||
--obr mvn:dev.galasa/dev.galasa.simbank.obr/0.25.0/obr \ | ||
--obr mvn:dev.galasa/dev.galasa.uber.obr/0.30.0/obr \ | ||
--class dev.galasa.simbank.tests/dev.galasa.simbank.tests.BasicAccountCreditTest | ||
``` | ||
On Windows (Powershell): | ||
``` | ||
galasactl runs submit local --log - ` | ||
--obr mvn:dev.galasa/dev.galasa.simbank.obr/0.25.0/obr ` | ||
--obr mvn:dev.galasa/dev.galasa.uber.obr/0.30.0/obr ` | ||
--class dev.galasa.simbank.tests/dev.galasa.simbank.tests.BasicAccountCreditTest | ||
``` | ||
## Next steps | ||
Explore the SimBankIVT test and the other SimBank tests in the [Exploring the supplied SimBank tests](exploring-simbank-tests) sections. Follow the flow of logic in these classes and understand more about the Java that is used to create them, including how to use Galasa annotations and review documented test methods. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.