diff --git a/tests/Makefile b/tests/Makefile index 2e0785d..f922d17 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -10,18 +10,14 @@ check: check-local: ansible-playbook -i inventory-localhost -v -e artifacts=$(CURDIR) -c local ./hydrant.yml -build: - sudo podman run \ - --name $(WORKING_CONT) \ - $(BASE_IMAGE) \ - dnf install -y standard-test-roles make - sudo podman commit $(WORKING_CONT) $(TESTS_IMAGE) - sudo podman rm $(WORKING_CONT) +build: recipe.yml + ansible-bender --debug build ./recipe.yml $(BASE_IMAGE) $(TESTS_IMAGE) check-in-container: - sudo podman run --rm \ + podman run --rm -ti \ -v $(CURDIR):/src \ --net host \ + -e ANSIBLE_PYTHON_INTERPRETER=/usr/bin/python3 \ -w /src \ -v /var/run/docker.sock:/var/run/docker.sock \ $(TESTS_IMAGE) \ diff --git a/tests/integration/runtest.sh b/tests/integration/runtest.sh old mode 100644 new mode 100755 diff --git a/tests/inventory-localhost b/tests/inventory-localhost index 2302eda..c1a345d 100644 --- a/tests/inventory-localhost +++ b/tests/inventory-localhost @@ -1 +1 @@ -localhost ansible_connection=local +localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3 diff --git a/tests/recipe.yml b/tests/recipe.yml new file mode 100644 index 0000000..11280e6 --- /dev/null +++ b/tests/recipe.yml @@ -0,0 +1,13 @@ +--- +- name: Ansible recipe for a container image where the tests will run + hosts: all + tasks: + - dnf: + name: + - standard-test-roles + - make + state: installed + - file: + src: /usr/bin/python3 + dest: /usr/bin/python + state: link