diff --git a/playbooks/system-test-commands-options.yaml b/playbooks/system-test-commands-options.yaml index 7613f4b29..2c9fd4de6 100644 --- a/playbooks/system-test-commands-options.yaml +++ b/playbooks/system-test-commands-options.yaml @@ -22,7 +22,6 @@ - name: Run the commands-options system tests command: bats --filter-tags commands-options ./test/system environment: - PODMAN: '/usr/bin/podman' TMPDIR: '/var/tmp' TOOLBX: '/usr/local/bin/toolbox' TOOLBX_TEST_SYSTEM_TAGS: 'arch-fedora,commands-options,custom-image,ubuntu' diff --git a/playbooks/system-test-runtime-environment-arch-fedora.yaml b/playbooks/system-test-runtime-environment-arch-fedora.yaml index 608b86f76..159356330 100644 --- a/playbooks/system-test-runtime-environment-arch-fedora.yaml +++ b/playbooks/system-test-runtime-environment-arch-fedora.yaml @@ -22,7 +22,6 @@ - name: Run the (arch-fedora,runtime-environment) system tests command: bats --filter-tags arch-fedora,runtime-environment ./test/system environment: - PODMAN: '/usr/bin/podman' TMPDIR: '/var/tmp' TOOLBX: '/usr/local/bin/toolbox' TOOLBX_TEST_SYSTEM_TAGS: 'arch-fedora,runtime-environment' diff --git a/playbooks/system-test-runtime-environment-ubuntu.yaml b/playbooks/system-test-runtime-environment-ubuntu.yaml index 7257d0009..30fb7ad69 100644 --- a/playbooks/system-test-runtime-environment-ubuntu.yaml +++ b/playbooks/system-test-runtime-environment-ubuntu.yaml @@ -22,7 +22,6 @@ - name: Run the (runtime-environment,ubuntu) system tests command: bats --filter-tags runtime-environment,ubuntu ./test/system environment: - PODMAN: '/usr/bin/podman' TMPDIR: '/var/tmp' TOOLBX: '/usr/local/bin/toolbox' TOOLBX_TEST_SYSTEM_TAGS: 'runtime-environment,ubuntu' diff --git a/test/system/101-create.bats b/test/system/101-create.bats index 14054c150..fb0e92d65 100644 --- a/test/system/101-create.bats +++ b/test/system/101-create.bats @@ -204,7 +204,7 @@ teardown() { assert_output --partial "Created container: ubuntu-toolbox-16.04" assert_output --partial "Enter with: toolbox enter ubuntu-toolbox-16.04" - run $PODMAN ps --all + run podman ps --all assert_success assert_output --regexp "Created[[:blank:]]+ubuntu-toolbox-16.04" @@ -219,7 +219,7 @@ teardown() { assert_output --partial "Created container: ubuntu-toolbox-18.04" assert_output --partial "Enter with: toolbox enter ubuntu-toolbox-18.04" - run $PODMAN ps --all + run podman ps --all assert_success assert_output --regexp "Created[[:blank:]]+ubuntu-toolbox-18.04" @@ -234,7 +234,7 @@ teardown() { assert_output --partial "Created container: ubuntu-toolbox-20.04" assert_output --partial "Enter with: toolbox enter ubuntu-toolbox-20.04" - run $PODMAN ps --all + run podman ps --all assert_success assert_output --regexp "Created[[:blank:]]+ubuntu-toolbox-20.04" @@ -251,7 +251,7 @@ teardown() { assert [ ${#lines[@]} -eq 2 ] assert [ ${#stderr_lines[@]} -eq 0 ] - run $PODMAN ps --all + run podman ps --all assert_success assert_output --regexp "Created[[:blank:]]+$image" @@ -268,7 +268,7 @@ teardown() { assert [ ${#lines[@]} -eq 2 ] assert [ ${#stderr_lines[@]} -eq 0 ] - run $PODMAN ps --all + run podman ps --all assert_success assert_output --regexp "Created[[:blank:]]+non-default" @@ -285,7 +285,7 @@ teardown() { assert [ ${#lines[@]} -eq 2 ] assert [ ${#stderr_lines[@]} -eq 0 ] - run $PODMAN ps --all + run podman ps --all assert_success assert_output --regexp "Created[[:blank:]]+non-default" @@ -842,7 +842,7 @@ teardown() { local authfile="$BATS_TEST_TMPDIR/authfile" local image="fedora-toolbox:34" - run $PODMAN login --authfile "$authfile" --username user --password user "$DOCKER_REG_URI" + run podman login --authfile "$authfile" --username user --password user "$DOCKER_REG_URI" assert_success run "$TOOLBX" --assumeyes create --image "$DOCKER_REG_URI/$image" diff --git a/test/system/102-list.bats b/test/system/102-list.bats index e2fcd7821..9876c3dd8 100644 --- a/test/system/102-list.bats +++ b/test/system/102-list.bats @@ -535,7 +535,7 @@ teardown() { num_of_images="$(list_images)" assert_equal "$num_of_images" 1 - $PODMAN create --name busybox-container "$busybox_image" + podman create --name busybox-container "$busybox_image" local num_of_containers num_of_containers="$(list_containers)" @@ -558,7 +558,7 @@ teardown() { num_of_images="$(list_images)" assert_equal "$num_of_images" 1 - $PODMAN create --name busybox-container "$busybox_image" + podman create --name busybox-container "$busybox_image" local num_of_containers num_of_containers="$(list_containers)" @@ -581,7 +581,7 @@ teardown() { num_of_images="$(list_images)" assert_equal "$num_of_images" 1 - $PODMAN create --name busybox-container "$busybox_image" + podman create --name busybox-container "$busybox_image" local num_of_containers num_of_containers="$(list_containers)" diff --git a/test/system/104-run.bats b/test/system/104-run.bats index 46054cb90..36b0792ce 100644 --- a/test/system/104-run.bats +++ b/test/system/104-run.bats @@ -842,11 +842,11 @@ teardown() { local container="ancient" - run "$PODMAN" create --name "$container" "$default_image" true + run podman create --name "$container" "$default_image" true assert_success - run $PODMAN ps --all + run podman ps --all assert_success assert_output --regexp "Created[[:blank:]]+$container" diff --git a/test/system/206-user.bats b/test/system/206-user.bats index a30128e9a..ffefb68e6 100644 --- a/test/system/206-user.bats +++ b/test/system/206-user.bats @@ -57,12 +57,12 @@ teardown() { default_container="$(get_system_id)-toolbox-$(get_system_version)" create_default_container - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount "$default_container")" + container_root_file_system="$(podman unshare podman mount "$default_container")" "$TOOLBX" run true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount "$default_container" + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount "$default_container" assert_success assert_line --regexp '^root::.+$' @@ -75,12 +75,12 @@ teardown() { # bats test_tags=arch-fedora @test "user: root in shadow(5) inside Arch Linux" { create_distro_container arch latest arch-toolbox-latest - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount arch-toolbox-latest)" + container_root_file_system="$(podman unshare podman mount arch-toolbox-latest)" "$TOOLBX" run --distro arch true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount arch-toolbox-latest + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount arch-toolbox-latest assert_success assert_line --regexp '^root::.+$' @@ -93,12 +93,12 @@ teardown() { # bats test_tags=arch-fedora @test "user: root in shadow(5) inside Fedora 34" { create_distro_container fedora 34 fedora-toolbox-34 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount fedora-toolbox-34)" + container_root_file_system="$(podman unshare podman mount fedora-toolbox-34)" "$TOOLBX" run --distro fedora --release 34 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount fedora-toolbox-34 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount fedora-toolbox-34 assert_success assert_line --regexp '^root::.+$' @@ -111,12 +111,12 @@ teardown() { # bats test_tags=arch-fedora @test "user: root in shadow(5) inside RHEL 8.10" { create_distro_container rhel 8.10 rhel-toolbox-8.10 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount rhel-toolbox-8.10)" + container_root_file_system="$(podman unshare podman mount rhel-toolbox-8.10)" "$TOOLBX" run --distro rhel --release 8.10 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount rhel-toolbox-8.10 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount rhel-toolbox-8.10 assert_success assert_line --regexp '^root::.+$' @@ -129,12 +129,12 @@ teardown() { # bats test_tags=ubuntu @test "user: root in shadow(5) inside Ubuntu 16.04" { create_distro_container ubuntu 16.04 ubuntu-toolbox-16.04 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-16.04)" + container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-16.04)" "$TOOLBX" run --distro ubuntu --release 16.04 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-16.04 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount ubuntu-toolbox-16.04 assert_success assert_line --regexp '^root::.+$' @@ -147,12 +147,12 @@ teardown() { # bats test_tags=ubuntu @test "user: root in shadow(5) inside Ubuntu 18.04" { create_distro_container ubuntu 18.04 ubuntu-toolbox-18.04 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-18.04)" + container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-18.04)" "$TOOLBX" run --distro ubuntu --release 18.04 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-18.04 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount ubuntu-toolbox-18.04 assert_success assert_line --regexp '^root::.+$' @@ -165,12 +165,12 @@ teardown() { # bats test_tags=ubuntu @test "user: root in shadow(5) inside Ubuntu 20.04" { create_distro_container ubuntu 20.04 ubuntu-toolbox-20.04 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-20.04)" + container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-20.04)" "$TOOLBX" run --distro ubuntu --release 20.04 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-20.04 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount ubuntu-toolbox-20.04 assert_success assert_line --regexp '^root::.+$' @@ -326,12 +326,12 @@ teardown() { default_container="$(get_system_id)-toolbox-$(get_system_version)" create_default_container - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount "$default_container")" + container_root_file_system="$(podman unshare podman mount "$default_container")" "$TOOLBX" run true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount "$default_container" + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount "$default_container" assert_success refute_line --regexp "^$USER:.*$" @@ -344,12 +344,12 @@ teardown() { # bats test_tags=arch-fedora @test "user: $USER in shadow(5) inside Arch Linux" { create_distro_container arch latest arch-toolbox-latest - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount arch-toolbox-latest)" + container_root_file_system="$(podman unshare podman mount arch-toolbox-latest)" "$TOOLBX" run --distro arch true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount arch-toolbox-latest + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount arch-toolbox-latest assert_success refute_line --regexp "^$USER:.*$" @@ -362,12 +362,12 @@ teardown() { # bats test_tags=arch-fedora @test "user: $USER in shadow(5) inside Fedora 34" { create_distro_container fedora 34 fedora-toolbox-34 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount fedora-toolbox-34)" + container_root_file_system="$(podman unshare podman mount fedora-toolbox-34)" "$TOOLBX" run --distro fedora --release 34 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount fedora-toolbox-34 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount fedora-toolbox-34 assert_success refute_line --regexp "^$USER:.*$" @@ -380,12 +380,12 @@ teardown() { # bats test_tags=arch-fedora @test "user: $USER in shadow(5) inside RHEL 8.10" { create_distro_container rhel 8.10 rhel-toolbox-8.10 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount rhel-toolbox-8.10)" + container_root_file_system="$(podman unshare podman mount rhel-toolbox-8.10)" "$TOOLBX" run --distro rhel --release 8.10 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount rhel-toolbox-8.10 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount rhel-toolbox-8.10 assert_success refute_line --regexp "^$USER:.*$" @@ -398,12 +398,12 @@ teardown() { # bats test_tags=ubuntu @test "user: $USER in shadow(5) inside Ubuntu 16.04" { create_distro_container ubuntu 16.04 ubuntu-toolbox-16.04 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-16.04)" + container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-16.04)" "$TOOLBX" run --distro ubuntu --release 16.04 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-16.04 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount ubuntu-toolbox-16.04 assert_success refute_line --regexp "^$USER:.*$" @@ -416,12 +416,12 @@ teardown() { # bats test_tags=ubuntu @test "user: $USER in shadow(5) inside Ubuntu 18.04" { create_distro_container ubuntu 18.04 ubuntu-toolbox-18.04 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-18.04)" + container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-18.04)" "$TOOLBX" run --distro ubuntu --release 18.04 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-18.04 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount ubuntu-toolbox-18.04 assert_success refute_line --regexp "^$USER:.*$" @@ -434,12 +434,12 @@ teardown() { # bats test_tags=ubuntu @test "user: $USER in shadow(5) inside Ubuntu 20.04" { create_distro_container ubuntu 20.04 ubuntu-toolbox-20.04 - container_root_file_system="$("$PODMAN" unshare "$PODMAN" mount ubuntu-toolbox-20.04)" + container_root_file_system="$(podman unshare podman mount ubuntu-toolbox-20.04)" "$TOOLBX" run --distro ubuntu --release 20.04 true - run --keep-empty-lines --separate-stderr "$PODMAN" unshare cat "$container_root_file_system/etc/shadow" - "$PODMAN" unshare "$PODMAN" unmount ubuntu-toolbox-20.04 + run --keep-empty-lines --separate-stderr podman unshare cat "$container_root_file_system/etc/shadow" + podman unshare podman unmount ubuntu-toolbox-20.04 assert_success refute_line --regexp "^$USER:.*$" diff --git a/test/system/README.md b/test/system/README.md index 469422280..b71349df7 100644 --- a/test/system/README.md +++ b/test/system/README.md @@ -38,10 +38,10 @@ and to speed up the cases. By default the test suite uses the system versions of `podman`, `skopeo` and `toolbox`. -If you have a `podman`, `skopeo` or `toolbox` installed in a nonstandard -location then you can use the `PODMAN`, `SKOPEO` and `TOOLBX` environmental -variables to set the path to the binaries. So the command to invoke the test -suite could look something like this: `PODMAN=/usr/libexec/podman TOOLBX=./toolbox bats ./test/system/`. +If you have `toolbox` installed in a nonstandard location then you can use the +`TOOLBX` environmental variable to set the path to the binary. So the command +to invoke the test suite could look something like this: +`TOOLBX=./toolbox bats ./test/system/`. It's recommended to set the [TMPDIR](https://systemd.io/TEMPORARY_DIRECTORIES/) environment variable to `/var/tmp` when running the tests. Otherwise, the @@ -90,6 +90,6 @@ Examples: Example pull of the `fedora-toolbox:34` image: ```bash -$PODMAN login --username user --password user "$DOCKER_REG_URI" -$PODMAN pull "$DOCKER_REG_URI/fedora-toolbox:34" +podman login --username user --password user "$DOCKER_REG_URI" +podman pull "$DOCKER_REG_URI/fedora-toolbox:34" ``` diff --git a/test/system/libs/helpers.bash b/test/system/libs/helpers.bash index 2d05641f5..1608fccb3 100644 --- a/test/system/libs/helpers.bash +++ b/test/system/libs/helpers.bash @@ -22,7 +22,6 @@ readonly PODMAN="${PODMAN:-$(command -v podman)}" readonly TOOLBX="${TOOLBX:-$(command -v toolbox)}" readonly TOOLBX_TEST_SYSTEM_TAGS_ALL="arch-fedora,commands-options,custom-image,runtime-environment,ubuntu" readonly TOOLBX_TEST_SYSTEM_TAGS="${TOOLBX_TEST_SYSTEM_TAGS:-$TOOLBX_TEST_SYSTEM_TAGS_ALL}" -readonly SKOPEO="${SKOPEO:-$(command -v skopeo)}" # Images declare -Ag IMAGES=([arch]="quay.io/toolbx/arch-toolbox" \ @@ -110,7 +109,7 @@ function _pull_and_cache_distro_image() { local -i ret_val for ((j = 0; j < num_of_retries; j++)); do - error_message="$( ("$SKOPEO" copy --dest-compress \ + error_message="$( (skopeo copy --dest-compress \ "docker://${image}" \ "dir:${IMAGE_CACHE_DIR}/${image_archive}" >/dev/null) 2>&1)" ret_val="$?" @@ -211,7 +210,7 @@ function _setup_docker_registry() { assert_success # Add fedora-toolbox:34 image to the registry - run "$SKOPEO" copy --dest-authfile "${TEMP_BASE_DIR}/authfile.json" \ + run skopeo copy --dest-authfile "${TEMP_BASE_DIR}/authfile.json" \ dir:"${IMAGE_CACHE_DIR}"/fedora-toolbox-34 \ docker://"${DOCKER_REG_URI}"/fedora-toolbox:34 assert_success @@ -336,7 +335,7 @@ function pull_distro_image() { fi # https://github.com/containers/skopeo/issues/547 for the options for containers-storage - run "$SKOPEO" copy "dir:${IMAGE_CACHE_DIR}/${image_archive}" "containers-storage:[overlay@$ROOTLESS_PODMAN_STORE_DIR+$ROOTLESS_PODMAN_STORE_DIR]${image}" + run skopeo copy "dir:${IMAGE_CACHE_DIR}/${image_archive}" "containers-storage:[overlay@$ROOTLESS_PODMAN_STORE_DIR+$ROOTLESS_PODMAN_STORE_DIR]${image}" # shellcheck disable=SC2154 if [ "$status" -ne 0 ]; then @@ -368,7 +367,7 @@ function pull_default_image_and_copy() { image="${IMAGES[$distro]}:$version" # https://github.com/containers/skopeo/issues/547 for the options for containers-storage - run "$SKOPEO" copy \ + run skopeo copy \ "containers-storage:[overlay@$ROOTLESS_PODMAN_STORE_DIR+$ROOTLESS_PODMAN_STORE_DIR]$image" \ "containers-storage:[overlay@$ROOTLESS_PODMAN_STORE_DIR+$ROOTLESS_PODMAN_STORE_DIR]$image-copy"