Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/system: Test a container with an old forward incompatible runtime #1187

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 7 additions & 0 deletions test/system/103-container.bats
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ teardown() {
assert_success
}

@test "container: Start with an old forward incompatible runtime" {
create_distro_container fedora 34 fedora-toolbox-34

run container_started fedora-toolbox-34
assert_success
}

@test "container(Fedora Rawhide): Containers with supported versions start without issues" {
local os_release="$(find_os_release)"
local system_id="$(get_system_id)"
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