From 8eac0d08fd2a80344f3986aa5267a18b9aa45db4 Mon Sep 17 00:00:00 2001 From: Oliver Gutierrez Date: Tue, 14 Sep 2021 10:19:51 +0100 Subject: [PATCH] Added new role to setup default container image Related: rhbz#2000051 --- tests/roles/set_image/files/toolbox.conf | 17 +++++++++++++++++ tests/roles/set_image/tasks/main.yml | 4 ++++ tests/tests.yml | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/roles/set_image/files/toolbox.conf create mode 100644 tests/roles/set_image/tasks/main.yml diff --git a/tests/roles/set_image/files/toolbox.conf b/tests/roles/set_image/files/toolbox.conf new file mode 100644 index 0000000..05f8268 --- /dev/null +++ b/tests/roles/set_image/files/toolbox.conf @@ -0,0 +1,17 @@ +[general] +# Create a toolbox container for a different operating system distro than the +# host. Cannot be used with 'image'. +## distro = "fedora" + +# Create a toolbox container for a different operating system release than the +# host. Cannot be used with 'image'. +## release = "33" + +# Change the name of the image used to create the toolbox container. This is +# useful for creating containers from custom-built images. Cannot be used with +# 'distro' or 'release'. +# +# If the name does not contain a registry, the local image storage will be +# consulted, and if it's not present there then it will be pulled from a +# suitable remote registry. +image = "registry.stage.redhat.io/ubi9/toolbox:latest" diff --git a/tests/roles/set_image/tasks/main.yml b/tests/roles/set_image/tasks/main.yml new file mode 100644 index 0000000..97702b8 --- /dev/null +++ b/tests/roles/set_image/tasks/main.yml @@ -0,0 +1,4 @@ +--- +# Copy the toolbox.conf file +- name: Copy toolbox.conf file to set default image + copy: src={{ role_path }}/files/toolbox.conf dest=/etc/containers/toolbox.conf force=yes mode=0666 diff --git a/tests/tests.yml b/tests/tests.yml index 91c9b65..3d0a659 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -4,7 +4,8 @@ vars: - artifacts: ./artifacts roles: - - role: bats_installed + #- role: bats_installed + - role: set_image - role: nonroot_user - role: run_bats_tests tests: