Skip to content

Commit

Permalink
test/system: Replace fedora-toolbox:32 with fedora-toolbox:34
Browse files Browse the repository at this point in the history
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 something newer, 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 (ie., the host's ABI), and not
the Toolbx container's ABI, when it's invoked as the entry point of the
container [1].  This is important because the subsequent commit will add
a test to ensure that.

[1] Commit 6063eb2
    containers#821
  • Loading branch information
debarshiray committed Dec 5, 2022
1 parent 9e1cc2a commit 5b66aa2
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion test/system/000-setup.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down
32 changes: 16 additions & 16 deletions test/system/101-create.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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" {
Expand Down Expand Up @@ -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"
Expand All @@ -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"
Expand All @@ -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
Expand All @@ -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 ]
}
6 changes: 3 additions & 3 deletions test/system/102-list.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions test/system/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
```
6 changes: 3 additions & 3 deletions test/system/libs/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5b66aa2

Please sign in to comment.