diff --git a/.github/workflows/ubuntu-tests.yaml b/.github/workflows/ubuntu-tests.yaml index 53014326c..7ab2b5ed7 100644 --- a/.github/workflows/ubuntu-tests.yaml +++ b/.github/workflows/ubuntu-tests.yaml @@ -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 \ diff --git a/test/system/102-list.bats b/test/system/102-list.bats index 351477387..f2a423f76 100644 --- a/test/system/102-list.bats +++ b/test/system/102-list.bats @@ -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,8 +396,17 @@ 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 ] @@ -402,9 +414,19 @@ teardown() { 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 ] @@ -425,6 +447,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 +462,17 @@ teardown() { assert_success assert_line --index 1 --partial "" - 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 ] }