acc-tests-config-maker
Last updated: 2025-06-24 01:07:30.288672 File source: link on GitLab
incus-acc-tests-config-maker
This project reads client certs and server certs and outputs a file compatible with the acceptance tests.
For more details please refer to the Acceptance tests architecture documentation
Pre-requisites
Python >3.9
uv
Usage
First you should create the tokens from the remote. Log into each server and
execute incus config trust add {name}
. The name should be descriptive of its
use and is for reference when managing the target server.
Then you should create the certificates. To do so, first build the provided docker image:
docker build -t incus-acc-tests-config-maker .
Then open a shell in a container using that image
docker run -it --rm -v $PWD:/app -v ./incus:/root/.config/incus incus-acc-tests-config-maker bash
Inside that shell, you can issue the certificates for each server. You can also
change -v ./incus:/root/.config/incus
to a different folder map if issuing
server certificates for different clients, i.e. -v ./incus-new-user:/root/.config/incus
To generate the cerfificates:
incus remote add {remote-name-1} remote-url.example.com:8443 --accept-certificate --token {generated-token-1}
incus remote add {remote-name-2} remote-url.example.com:8443 --accept-certificate --token {generated-token-2}
#...
Now make sure you fix the permissions before running this tool:
sudo chown -R $USER: .
Then you can generate the config file using this tool:
uv run main.py --remotes {remote-name-1} {remote-name-2}
This will generate a new config file with the required certificates. If you want to amend an existing config file for instance to add new remotes to a pre-existing config, you can pass the existing config file to the tool:
uv run main.py --remotes {remote-name} --config-file /path/to/existing/cfg.yml
Also, when managing multiple users, you can specify the incus config folder as well as the existing config file:
uv run main.py --remotes {remote-name} --config-file /path/to/existing/cfg.yml --incus-conifg-folder $PWD/incus-new-user
The output file is called config_out.yml
and is deployed in the current
working directory from which this tool is being executed.
Last updated