Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: containers/toolbox
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1e9c1b67468733672edf379f47f2dada35248f0c
Choose a base ref
..
head repository: containers/toolbox
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 95be6f7b3238dc0f2bc94c979576e97df854c806
Choose a head ref
Showing with 132 additions and 68 deletions.
  1. +1 −0 .github/workflows/ubuntu-tests.yaml
  2. +79 −15 test/system/102-list.bats
  3. +4 −4 test/system/103-container.bats
  4. +2 −2 test/system/104-run.bats
  5. +42 −42 test/system/206-user.bats
  6. +4 −5 test/system/libs/helpers.bash
1 change: 1 addition & 0 deletions .github/workflows/ubuntu-tests.yaml
Original file line number Diff line number Diff line change
@@ -150,6 +150,7 @@ jobs:
test/system/001-version.bats \
test/system/002-help.bats \
test/system/101-create.bats \
test/system/102-list.bats \
test/system/103-container.bats \
test/system/105-enter.bats \
test/system/106-rm.bats \
94 changes: 79 additions & 15 deletions test/system/102-list.bats
Original file line number Diff line number Diff line change
@@ -373,8 +373,11 @@ teardown() {
local default_image
default_image="$(get_default_image)"

local system_id
system_id="$(get_system_id)"

local default_container
default_container="$(get_system_id)-toolbox-$(get_system_version)"
default_container="$system_id-toolbox-$(get_system_version)"

# Pull the two images
pull_default_image
@@ -393,30 +396,67 @@ teardown() {
run --keep-empty-lines --separate-stderr "$TOOLBX" list --images

assert_success
assert_line --index 1 --partial "registry.fedoraproject.org/fedora-toolbox:34"
assert_line --index 2 --partial "$default_image"

if [ "$system_id" = "fedora" ]; then
assert_line --index 1 --partial "registry.fedoraproject.org/fedora-toolbox:34"
assert_line --index 2 --partial "$default_image"
elif [ "$system_id" = "ubuntu" ]; then
assert_line --index 1 --partial "$default_image"
assert_line --index 2 --partial "registry.fedoraproject.org/fedora-toolbox:34"
else
fail "Define output for $system_id"
fi

assert [ ${#lines[@]} -eq 3 ]
assert [ ${#stderr_lines[@]} -eq 0 ]

# Check containers
run --keep-empty-lines --separate-stderr "$TOOLBX" list --containers

assert_success
assert_line --index 1 --partial "$default_container"
assert_line --index 2 --partial "non-default-one"
assert_line --index 3 --partial "non-default-two"

if [ "$system_id" = "fedora" ]; then
assert_line --index 1 --partial "$default_container"
assert_line --index 2 --partial "non-default-one"
assert_line --index 3 --partial "non-default-two"
elif [ "$system_id" = "ubuntu" ]; then
assert_line --index 1 --partial "non-default-one"
assert_line --index 2 --partial "non-default-two"
assert_line --index 3 --partial "$default_container"
else
fail "Define output for $system_id"
fi

assert [ ${#lines[@]} -eq 4 ]
assert [ ${#stderr_lines[@]} -eq 0 ]

# Check all together
run --keep-empty-lines --separate-stderr "$TOOLBX" list

assert_success
assert_line --index 1 --partial "registry.fedoraproject.org/fedora-toolbox:34"
assert_line --index 2 --partial "$default_image"
assert_line --index 5 --partial "$default_container"
assert_line --index 6 --partial "non-default-one"
assert_line --index 7 --partial "non-default-two"

if [ "$system_id" = "fedora" ]; then
assert_line --index 1 --partial "registry.fedoraproject.org/fedora-toolbox:34"
assert_line --index 2 --partial "$default_image"
elif [ "$system_id" = "ubuntu" ]; then
assert_line --index 1 --partial "$default_image"
assert_line --index 2 --partial "registry.fedoraproject.org/fedora-toolbox:34"
else
fail "Define output for $system_id"
fi

if [ "$system_id" = "fedora" ]; then
assert_line --index 5 --partial "$default_container"
assert_line --index 6 --partial "non-default-one"
assert_line --index 7 --partial "non-default-two"
elif [ "$system_id" = "ubuntu" ]; then
assert_line --index 5 --partial "non-default-one"
assert_line --index 6 --partial "non-default-two"
assert_line --index 7 --partial "$default_container"
else
fail "Define output for $system_id"
fi

assert [ ${#lines[@]} -eq 8 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
@@ -425,6 +465,9 @@ teardown() {
local default_image
default_image="$(get_default_image)"

local system_id
system_id="$(get_system_id)"

pull_default_image
pull_distro_image fedora 34
build_image_without_name >/dev/null
@@ -437,8 +480,17 @@ teardown() {

assert_success
assert_line --index 1 --partial "<none>"
assert_line --index 2 --partial "registry.fedoraproject.org/fedora-toolbox:34"
assert_line --index 3 --partial "$default_image"

if [ "$system_id" = "fedora" ]; then
assert_line --index 2 --partial "registry.fedoraproject.org/fedora-toolbox:34"
assert_line --index 3 --partial "$default_image"
elif [ "$system_id" = "ubuntu" ]; then
assert_line --index 2 --partial "$default_image"
assert_line --index 3 --partial "registry.fedoraproject.org/fedora-toolbox:34"
else
fail "Define output for $system_id"
fi

assert [ ${#lines[@]} -eq 4 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
@@ -447,6 +499,9 @@ teardown() {
local default_image
default_image="$(get_default_image)"

local system_id
system_id="$(get_system_id)"

pull_default_image
pull_distro_image fedora 34
build_image_without_name >/dev/null
@@ -455,8 +510,17 @@ teardown() {

assert_success
assert_line --index 1 --partial "<none>"
assert_line --index 2 --partial "registry.fedoraproject.org/fedora-toolbox:34"
assert_line --index 3 --partial "$default_image"

if [ "$system_id" = "fedora" ]; then
assert_line --index 2 --partial "registry.fedoraproject.org/fedora-toolbox:34"
assert_line --index 3 --partial "$default_image"
elif [ "$system_id" = "ubuntu" ]; then
assert_line --index 2 --partial "$default_image"
assert_line --index 3 --partial "registry.fedoraproject.org/fedora-toolbox:34"
else
fail "Define output for $system_id"
fi

assert [ ${#lines[@]} -eq 4 ]
assert [ ${#stderr_lines[@]} -eq 0 ]
}
8 changes: 4 additions & 4 deletions test/system/103-container.bats
Original file line number Diff line number Diff line change
@@ -50,16 +50,16 @@ teardown() {
}

@test "container(Fedora Rawhide): Containers with supported versions start without issues" {
if ! is_fedora_rawhide; then
skip "This test is only for Fedora Rawhide"
fi

local system_id
system_id="$(get_system_id)"

local system_version
system_version="$(get_system_version)"

if ! is_fedora_rawhide; then
skip "This test is only for Fedora Rawhide"
fi

create_distro_container "$system_id" "$system_version" latest
run container_started latest
assert_success
4 changes: 2 additions & 2 deletions test/system/104-run.bats
Original file line number Diff line number Diff line change
@@ -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"
Loading