4.2.4. Test Server

The test server is created because this repositories tests are oversized for regular CI/CD jobs. Besides those usually run inside Docker containers and this tests can’t.

Thus we have a large test suite running weekly and a smaller one daily - each for the main and latest develop branch.

This is mainly based on tests by Molecule and virtualization by Incus:

../../_images/test_server.png

One big Incus VM continuously spawns shortliving Incus containers

It is roughly created with the following steps:

  • Create the VM itself. This was tested with the following command and hardware resources:

$  incus launch images:debian/bookworm/cloud test-server --vm -d root,size=100GiB -c limits.cpu=8 -c limits.memory=8GiB -d eth0,ipv4.address=10.42.42.42
  • Inside test-server install Ansible and get this repository as in previous examples

  • Set connection information for postfix mailgate or ssmtp dummy email address inside inventories/test/test_server/group_vars/test/vars.yml

  • Run the playbook locally:

$ ansible-playbook -i inventories/test/test_server/ -c local playbooks/test_server.yml
  • Verify it is working:

$ sudo su tester -s /bin/bash
$ crontab -l
$ cd /opt/git_repos/
$ bash large_on_develop.sh