3.21. test-server
This role is setting up a test server for running the molecule integration tests.
Virtualization is provided by Incus.
A user is created to have Incus access without having root access for running the tests.
From the git repository the main and latest develop branch is cloned.
Both have a small and a large test suite.
A shell script wraps the tests delivered by the repo in order to write emails using the result and execution time.
Finally Cron jobs are created out of those tests.
See also Examples -> Production -> Test Server
.
Parameters:
ts_git_folder: Global folder to put cloned repositories and shell scripts inside.
ts_target_mail: Email target for results of tests.
ts_clone: Dictionary for cloning main and develop branch. Subdictionaries require URL, branch and file path for the target system.
ts_tests: List of dictionaries to define different tests. Runs
bash_script
insidepath
. Expects to getfail_log
andtest_log
created. Usesname
andperiod
for the cron job.
Defaults:
ts_load_proxy_envs: Load proxy environment variables if true
ts_http_proxy: Address of HTTP proxy
ts_https_proxy: Address of HTTPS proxy
ts_no_proxy: Exceptions where not to use proxies
Variables:
ts_system_packages: Packages to be installed using apt.
ts_pypi_packages: Packages to be installed using pip.
ts_venv: Virtual environment for pip installation, created using “python3 -m venv” approach.
ts_user: Newly created user for running tests.
ts_groups: Groups the user needs to be part of for creating VMs or containers.
ts_incus_preseed: Command for initializing Incus after installation using the –preseed option, includes the whole configuration.