From a384d5bb503c65bb42a3754e16e67cac66372633 Mon Sep 17 00:00:00 2001 From: Wen Liang Date: Sun, 6 Jul 2025 21:40:24 -0400 Subject: [PATCH] docs(contributing): Add guide for running CI tests locally with tox-lsr Signed-off-by: Wen Liang --- contributing.md | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/contributing.md b/contributing.md index 3866c92..379582b 100644 --- a/contributing.md +++ b/contributing.md @@ -118,3 +118,50 @@ explanation about the NetworkManager API. podman stop lsr-ci-c7 podman rm lsr-ci-c7 ``` + +## Running CI Tests Locally + +### Use tox-lsr with qemu + +The latest version of tox-lsr supports qemu testing. + + +**Steps:** + +1. If you are using RHEL or CentOS, enable the EPEL repository for your + platform - + +2. Use yum or dnf to install `standard-test-roles-inventory-qemu` + * If for some reason dnf/yum do not work, just download the script from + + * copy to your `$PATH`, and make sure it is executable + +3. Install tox + * Use yum/dnf to install `python3-tox` - if that does not work, then use + `pip install --user tox`, then make sure `~/.local/bin` is in your `$PATH` + +4. Install tox-lsr + + ```bash + pip install --user git+https://github.com/linux-system-roles/tox-lsr@main + ``` + +5. Download the config file to `~/.config/linux-system-roles.json` from + + +6. Assuming you are in a git clone of a role repo which has a tox.ini file - + you can use e.g. + + ```bash + tox -e qemu-ansible-core-2.14 -- --image-name centos-9 tests/tests_default.yml + ``` + +There are many command line options and environment variables which can be used +to control the behavior, and you can customize the testenv in tox.ini. See + + +This method supports RHEL also - will download the latest image for a compose, +and will set up the yum repos to point to internal composes. + +See for general +development guidelines.