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: Update Ubuntu versions used for tests (16.04, 18.04, 20.04 -> 20.04, 22.04, 24.04) #1535

Merged
merged 2 commits into from
Nov 17, 2024
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
33 changes: 30 additions & 3 deletions test/system/101-create.bats
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,22 @@ teardown() {
}

@test "create: Arch Linux" {
local system_id
system_id="$(get_system_id)"

pull_distro_image arch latest

run --separate-stderr "$TOOLBX" create --distro arch

assert_success
assert_line --index 0 "Created container: arch-toolbox-latest"
assert_line --index 1 "Enter with: toolbox enter arch-toolbox-latest"

if [ "$system_id" = "arch" ]; then
assert_line --index 1 "Enter with: toolbox enter"
else
assert_line --index 1 "Enter with: toolbox enter arch-toolbox-latest"
fi

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

Expand All @@ -155,13 +164,22 @@ teardown() {
}

@test "create: Arch Linux ('--release latest')" {
local system_id
system_id="$(get_system_id)"

pull_distro_image arch latest

run --separate-stderr "$TOOLBX" create --distro arch --release latest

assert_success
assert_line --index 0 "Created container: arch-toolbox-latest"
assert_line --index 1 "Enter with: toolbox enter arch-toolbox-latest"

if [ "$system_id" = "arch" ]; then
assert_line --index 1 "Enter with: toolbox enter"
else
assert_line --index 1 "Enter with: toolbox enter arch-toolbox-latest"
fi

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

Expand All @@ -171,13 +189,22 @@ teardown() {
}

@test "create: Arch Linux ('--release rolling')" {
local system_id
system_id="$(get_system_id)"

pull_distro_image arch latest

run --separate-stderr "$TOOLBX" create --distro arch --release rolling

assert_success
assert_line --index 0 "Created container: arch-toolbox-latest"
assert_line --index 1 "Enter with: toolbox enter arch-toolbox-latest"

if [ "$system_id" = "arch" ]; then
assert_line --index 1 "Enter with: toolbox enter"
else
assert_line --index 1 "Enter with: toolbox enter arch-toolbox-latest"
fi

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

Expand Down
5 changes: 4 additions & 1 deletion test/system/libs/helpers.bash
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,10 @@ function get_system_version() (
# shellcheck disable=SC1090
. "$os_release"

echo "$VERSION_ID"
local system_version="$VERSION_ID"
[ "$ID" = "arch" ] && system_version="latest"

echo "$system_version"
)


Expand Down