test/system: Replace fedora-toolbox:32 with fedora-toolbox:34

Fedora 32 reached End of Life on 25th May 2021:
https://docs.fedoraproject.org/en-US/releases/eol/

That's quite old because right now Fedora 35 is nearing its End of Life.

Since the tests are intended for Toolbx, not the Fedora infrastructure,
it will be better to use a newer image, because images that are too old
can get lost from registry.fedoraproject.org.  The fedora-toolbox:34
image can be a drop-in replacement for the fedora-toolbox:32 image for
the purposes of this test suite, and has the advantage of being newer.

Note that fedora-toolbox:34 is also old enough to test that the toolbox
binary runs against it's build-time ABI from the host, and not the
Toolbx container's ABI, when it's invoked as the entry point of the
container [1,2].  This is important because the subsequent commit will
add a test to ensure that.

[1] Commit 6063eb27b9
    https://github.com/containers/toolbox/issues/821

[2] Commit 6ad9c63180
    https://github.com/containers/toolbox/issues/529

https://github.com/containers/toolbox/pull/1187
This commit is contained in:
Debarshi Ray 2022-12-05 20:54:51 +01:00
parent 67e210378e
commit 7ab2f9b866
5 changed files with 26 additions and 26 deletions

View file

@ -26,7 +26,7 @@ load 'libs/helpers'
# Cache the default image for the system
_pull_and_cache_distro_image "$system_id" "$system_version" || false
# Cache all images that will be needed during the tests
_pull_and_cache_distro_image fedora 32 || false
_pull_and_cache_distro_image fedora 34 || false
_pull_and_cache_distro_image busybox || false
# If run on Fedora Rawhide, cache 2 extra images (previous Fedora versions)
local rawhide_res="$(awk '/rawhide/' $os_release)"

View file

@ -45,10 +45,10 @@ teardown() {
assert_success
}
@test "create: Create a container with a custom image and name ('fedora32'; f32)" {
pull_distro_image fedora 32
@test "create: Create a container with a custom image and name ('fedora34'; f34)" {
pull_distro_image fedora 34
run $TOOLBOX -y create -c "fedora32" -i fedora-toolbox:32
run $TOOLBOX -y create -c "fedora34" -i fedora-toolbox:34
assert_success
}
@ -84,19 +84,19 @@ teardown() {
assert [ ${#lines[@]} -eq 4 ]
}
@test "create: Create a container with a distro and release options ('fedora'; f32)" {
pull_distro_image fedora 32
@test "create: Create a container with a distro and release options ('fedora'; f34)" {
pull_distro_image fedora 34
run $TOOLBOX -y create -d "fedora" -r f32
run $TOOLBOX -y create -d "fedora" -r f34
assert_success
assert_output --partial "Created container: fedora-toolbox-32"
assert_output --partial "Enter with: toolbox enter fedora-toolbox-32"
assert_output --partial "Created container: fedora-toolbox-34"
assert_output --partial "Enter with: toolbox enter fedora-toolbox-34"
# Make sure the container has actually been created
run podman ps -a
assert_output --regexp "Created[[:blank:]]+fedora-toolbox-32"
assert_output --regexp "Created[[:blank:]]+fedora-toolbox-34"
}
@test "create: Try to create a container based on unsupported distribution" {
@ -182,9 +182,9 @@ teardown() {
}
@test "create: Try to create a container using both --distro and --image" {
pull_distro_image fedora 32
pull_distro_image fedora 34
run $TOOLBOX --assumeyes create --distro "fedora" --image fedora-toolbox:32
run $TOOLBOX --assumeyes create --distro "fedora" --image fedora-toolbox:34
assert_failure
assert_line --index 0 "Error: options --distro and --image cannot be used together"
@ -193,9 +193,9 @@ teardown() {
}
@test "create: Try to create a container using both --image and --release" {
pull_distro_image fedora 32
pull_distro_image fedora 34
run $TOOLBOX --assumeyes create --image fedora-toolbox:32 --release 32
run $TOOLBOX --assumeyes create --image fedora-toolbox:34 --release 34
assert_failure
assert_line --index 0 "Error: options --image and --release cannot be used together"
@ -217,7 +217,7 @@ teardown() {
@test "create: Create a container based on an image from locked registry using an authentication file" {
local authfile="$BATS_RUN_TMPDIR/authfile"
local image="fedora-toolbox:32"
local image="fedora-toolbox:34"
run $PODMAN login --authfile "$authfile" --username user --password user "$DOCKER_REG_URI"
assert_success
@ -235,7 +235,7 @@ teardown() {
rm "$authfile"
assert_success
assert_line --index 0 "Created container: fedora-toolbox-32"
assert_line --index 1 "Enter with: toolbox enter fedora-toolbox-32"
assert_line --index 0 "Created container: fedora-toolbox-34"
assert_line --index 1 "Enter with: toolbox enter fedora-toolbox-34"
assert [ ${#lines[@]} -eq 2 ]
}

View file

@ -66,7 +66,7 @@ teardown() {
@test "list: Try to list images and containers (no flag) with 3 containers and 2 images (the list should have 3 images and 2 containers)" {
# Pull the two images
pull_default_image
pull_distro_image fedora 32
pull_distro_image fedora 34
# Create three containers
create_default_container
@ -78,7 +78,7 @@ teardown() {
assert_success
assert_output --partial "$(get_system_id)-toolbox:$(get_system_version)"
assert_output --partial "fedora-toolbox:32"
assert_output --partial "fedora-toolbox:34"
# Check containers
run $TOOLBOX list --containers
@ -93,7 +93,7 @@ teardown() {
assert_success
assert_output --partial "$(get_system_id)-toolbox:$(get_system_version)"
assert_output --partial "fedora-toolbox:32"
assert_output --partial "fedora-toolbox:34"
assert_output --partial "$(get_system_id)-toolbox-$(get_system_version)"
assert_output --partial "non-default-one"
assert_output --partial "non-default-two"

View file

@ -78,11 +78,11 @@ Examples:
`localhost:50000`. The registry requires authentication. There is one account
present: `user` (password: `user`)
- The registry contains by default only one image: `fedora-toolbox:32`
- The registry contains by default only one image: `fedora-toolbox:34`
Example pull of the `fedora-toolbox:32` image:
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:32"
$PODMAN pull "$DOCKER_REG_URI/fedora-toolbox:34"
```

View file

@ -199,10 +199,10 @@ function _setup_docker_registry() {
"${DOCKER_REG_URI}"
assert_success
# Add fedora-toolbox:32 image to the registry
# Add fedora-toolbox:34 image to the registry
run $SKOPEO copy --dest-authfile ${TEMP_BASE_DIR}/authfile.json \
dir:"${IMAGE_CACHE_DIR}"/fedora-toolbox-32 \
docker://"${DOCKER_REG_URI}"/fedora-toolbox:32
dir:"${IMAGE_CACHE_DIR}"/fedora-toolbox-34 \
docker://"${DOCKER_REG_URI}"/fedora-toolbox:34
assert_success
run rm ${TEMP_BASE_DIR}/authfile.json