neil / rpms / anaconda

Forked from rpms/anaconda a year ago
Clone
Radek Vykydal 147131
[Anaconda](https://github.com/rhinstaller/anaconda) installer gating tests.
Radek Vykydal 147131
Radek Vykydal 147131
Additionally to the tests (`tests*.yml`) contains also playbooks for runnning the tests from localhost on a remote test runner. The runner can be provisioned by `linchpin`. See [run_tests_remotely.sh](run_tests_remotely.sh) script as an example of the playbooks usage.
Radek Vykydal 147131
Radek Vykydal 147131
Running the tests remotely
Radek Vykydal 147131
--------------------------
Radek Vykydal 147131
Radek Vykydal 147131
### Test runner
Radek Vykydal 147131
Radek Vykydal 147131
The remote test runner can be provided in any way. To be used by the playbooks:
Radek Vykydal 147131
Radek Vykydal 147131
* It has to allow ssh access as a remote user which is allowed to become root, using the ssh key configured by `private_key_file` in [ansible config](remote_config/ansible.cfg). By default the `remote_user` for running the tests is `root`.
Radek Vykydal 147131
* Test runner host name / IP should be configured for the playbooks in `gating_test_runner` group of [remote_config/inventory](remote_config/inventory).
Radek Vykydal 147131
Radek Vykydal 147131
The runner can be provisioned in a cloud by linchpin as in the [script](run_tests_remotely.sh):
Radek Vykydal 147131
Radek Vykydal 147131
* The cloud credentials need to be configured in the file and profile reffered by `credentials` variable of [topology](linchpin/topologies/gating-test.yml). So the credentials file [`clouds.yml`](linchpin/credentials/clouds.yml) should contain profile `ci-rhos`. The file can be placed to `~/.config/linchpin` directory or the directory containing the file can be set by `linchpin` `--creds-path` option.
Radek Vykydal 147131
* The ssh key is set by `keypair` value of linchpin [topology](linchpin/topologies/gating-test.yml) file. It should correspond to the key defined in [ansible config](remote_config/ansible.cfg). The [topology](linchpin/topologies/gating-test.yml) file also defines image to be used for test runner.
Radek Vykydal 147131
* The script populates the [inventory](remote_config/inventory) for playbooks with [inventory](linchpin/layouts/gating-test.yml) generated by linchpin.
Radek Vykydal 147131
* The script tries to find out which remote user should be used (`root`, `fedora`, `cloud-user`) and updates [ansible config](remote_config/ansible.cfg) with the value.
Radek Vykydal 147131
Radek Vykydal 147131
### Test runner environment
Radek Vykydal 147131
Radek Vykydal 147131
Test runner environment is prepared by [`prepare-test-runner.yml`](prepare-test-runner.yml) playbook:
Radek Vykydal 147131
Radek Vykydal 147131
* It is possible to add repositories to the runner by defining [`test_runner_repos`](roles/prepare-test-runner/defaults/main.yml) variable. It can be useful for example for adding a repository with scratch build to be tested or adding repositories for test dependencies missing on remote runner.
Radek Vykydal 147131
* Empty directory for storing test artifacts is created on test runner based on the [`artifacts`](roles/prepare-test-runner/vars/main.yml) variable.
Radek Vykydal 147131
Radek Vykydal 147131
### Test playbooks configuration
Radek Vykydal 147131
Radek Vykydal 147131
#### Running on the remote runner:
Radek Vykydal 147131
Radek Vykydal 147131
Normally the testing system runs all the `tests*.yml` playbooks.
Radek Vykydal 147131
Radek Vykydal 147131
**WARNING:**
Radek Vykydal 147131
The test playbooks are run on `localhost` (test runner provided by the testing system). They change the test runner environment (eg install packages) so most probably you don't want to run them as they are - on your local host.
Radek Vykydal 147131
The [script](run_tests_remotely.sh) updates `hosts` value of the test playbooks to use remote host from [`gating_test_runner`](remote_config/inventory/hosts) group as test runner (using a [playbook](set_tests_to_run_on_remote.yml)).
Radek Vykydal 147131
If you want to run the tests playbooks separately make sure the `hosts` variable in the test playbook is set to remote test runner (eg. `gating_test_runner`).
Radek Vykydal 147131
Radek Vykydal 147131
Radek Vykydal 147131
Radek Vykydal 147131
Radek Vykydal 147131
The test playbooks need [`artifacts`](roles/prepare-test-runner/vars/main.yml) variable supplied as can be seen in the [script](run_tests_remotely.sh). (Normally testing system takes care of this.)
Radek Vykydal 147131
Radek Vykydal 147131
#### Installation repositories:
Radek Vykydal 147131
Radek Vykydal 147131
Repositories (base and additional) used for installation test are defined in [repos](roles/installation-repos/defaults/main.yml) configuration. Their URL can be either defined explicitly or looked up in specified repositories of the test runner.
Radek Vykydal 147131
Radek Vykydal 147131
#### dirinstall test
Radek Vykydal 147131
Radek Vykydal 147131
There is a text and a vnc variant of dirinstall test. Both will run all the kickstarts found in [roles/dirinstall/templates/kickstarts](roles/dirinstall/templates/kickstarts).
Radek Vykydal 147131
Radek Vykydal 147131
Radek Vykydal 147131
### The results
Radek Vykydal 147131
Radek Vykydal 147131
The results and logs are fetched from remote host into local host directory defined by `artifacts` variable passed to the playbooks. This value can be passed also to the [script](run_tests_remotely.sh) with `-a` option.