3.21. test-server
This role is setting up a test server for running the molecule integration tests.
They are based on QEMU/KVM/Libvirt Virtual Machines.
Default values for the internal management network make sure that they also work for nested cases.
A user is created to have Libvirt 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.
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.
ts_libvirt_network_name: Name of Libvirt network managed by Vagrant. Passed to molecule test to allow nested scenarios (don’t use default values already used by host of host).
ts_libvirt_network_subnet: IP address range of Libvirt network managed by Vagrant. Reason see above.