If we list the git repo installing a wheel of this package fails. We have some silly work-arounds for LISA not being on PyPI (but really really need to go chase that down). Signed-off-by: Jeremy Cline <jeremycline@microsoft.com> |
||
|---|---|---|
| .. | ||
| fedora_image_tester | ||
| tests | ||
| LICENSE | ||
| pyproject.toml | ||
| README.md | ||
| tox.ini | ||
fedora-image-tester
An AMQP consumer that runs the LISA test suite against cloud images uploaded by fedora-image-uploader.
Configuring
The fedora-messaging service is the container entrypoint and is also used to provide most of the configuration. An example configuration file, fedora-messaging-fit.toml.example is included in the repository root and the full list of options are in fedora-messaging's configuration documentation. The FEDORA_MESSAGING_CONF environment variable should be set to the configuration file's location.
Run Locally
First, build the container from the repository root:
$ podman build -t fedora-image-tester:latest -f Containerfile.fit .
Copy fedora-messaging-fit.toml.example to fit.toml and edit it to fit your needs.
Next, set up any credentials. For example, to authenticate to Azure using a client certificate:
$ openssl req -x509 -new -nodes -sha256 -days 365 \
-addext "extendedKeyUsage = clientAuth" \
-subj "/CN=fedora-image-tester" \
-newkey rsa:4096 \
-keyout fedora-image-tester.key.pem \
-out fedora-image-tester.cert.pem
# Make note of the 'Id' and 'AppId' fields in the output as you'll need these later.
$ az ad app create --display-name fedora-image-tester-dev
# Add our certificate to use when authenticating
$ az ad app credential reset --id $APP_ID --append \
--display-name "Fedora Image Tester Certificate" \
--cert "@./fedora-image-tester.cert.pem"
$ az ad sp create --id $APP_ID
# Note that this is an absurdly broad permission set; don't do this for production
$ az role assignment create --assignee $APP_ID --role "Contributor" --scope "/subscriptions/<your sub>"
$ cat fedora-image-tester.key.pem fedora-image-tester.cert.pem > azure-creds
$ podman secret create fedora-image-tester-cert azure-creds
Finally, run the consumer:
podman run --rm -it -v "$(pwd)"/fit.toml:/etc/fedora-messaging/config.toml:ro,Z --secret source=fedora-image-tester-cert,type=mount --env 'AZURE_CLIENT_CERTIFICATE_PATH=/run/secrets/fedora-image-tester-cert' --env 'AZURE_TENANT_ID=<your tenant id>' --env 'AZURE_CLIENT_ID=<your client id>' --env 'AZURE_SUBSCRIPTION_ID=<your subscription id>' fedora-image-tester:latest
To test the consumer against an already-published image, pick a message and use the reconsume subcommand of fedora-messaging with the message's id:
podman run --rm -it -v "$(pwd)"/fit.toml:/etc/fedora-messaging/config.toml:ro,Z --secret source=fedora-image-tester-cert,type=mount --env 'AZURE_CLIENT_CERTIFICATE_PATH=/run/secrets/fedora-image-tester-cert' --env 'AZURE_TENANT_ID=<your tenant id>' --env 'AZURE_CLIENT_ID=<your client id>' --env 'AZURE_SUBSCRIPTION_ID=<your subscription id>' fedora-image-tester:latest reconsume <fedora-message-id>