Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Run containers on ubuntu #1260

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

rjeffman
Copy link
Member

This is a WIP to fix Azure tests.

@rjeffman rjeffman force-pushed the run_containers_ubuntu branch 2 times, most recently from 0adc59f to 95d9e03 Compare June 29, 2024 19:31
@rjeffman rjeffman changed the title WIT: Run containers on ubuntu WIP: Run containers on ubuntu Jun 29, 2024
@rjeffman rjeffman force-pushed the run_containers_ubuntu branch 21 times, most recently from f5579e2 to 1fde877 Compare July 4, 2024 20:34
@rjeffman rjeffman force-pushed the run_containers_ubuntu branch 4 times, most recently from 0b5418f to 86ee000 Compare July 15, 2024 14:01
@rjeffman rjeffman force-pushed the run_containers_ubuntu branch 5 times, most recently from 4d4a62e to 58e338e Compare July 20, 2024 14:54
@rjeffman
Copy link
Member Author

/azp run CheckPR

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

To modify Azure tests and depend on shell scripts and pytest instead
of molecule, the run-tests.sh script has been rewritten to depend on
bash functions and on a bash script that prepare and start a testing
container.

This patch adds a new script, 'utils/setup_test_container.sh' that
can be used to start a new container, using either podman or docker,
based on the available ansible-freeipa images. The new container can
then be used to run ansible-freeipa tests against it.

Also the following files with bash functions were added, and are
used by both scripts:

    utils/shansible: Functions to run playbooks in the container
    utils/shcontainer: Functions to setup/run a container
    utils/shfun: Generic shell helper functions (e.g.: log)
On some systems it is required or desired to run Ansible with a specific
Python interpreter. This patch allows the selection of the Python binary
to use for the pytest playbook tests by setting the environment variable
IPA_PYTHON_PATH. Set it the the full path of the Python interpreter.
This patch removes 'molecule' as a dependency for tests, by using the
scripts under `utils` to setup the environment.

By not using molecule, we have more flexibility on using either docker
or podman as the container engine, and makes it easy to reproduce the
environment on different distros, allowing for a more consistent error
reproduction off Azure.
As the scripts 'utils/run-tests.sh' and 'utils/setup_test_container.sh'
use some scripts as function libraries, this change forces shellcheck to
also verify those scripts.
@rjeffman rjeffman force-pushed the run_containers_ubuntu branch 2 times, most recently from 1943e65 to b2826dc Compare July 22, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant