From 1bd6cf17cea9c1efe0539a1eaad9047ff40185e4 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 16 Mar 2023 18:22:11 +0100 Subject: [PATCH] test/system: Split the tests for parsing releases This will make it easier to find out exactly which test failed. https://github.com/containers/toolbox/pull/1266 --- test/system/101-create.bats | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/system/101-create.bats b/test/system/101-create.bats index 6a29b72..d53335c 100644 --- a/test/system/101-create.bats +++ b/test/system/101-create.bats @@ -120,7 +120,7 @@ teardown() { assert_line --index 2 "Use 'toolbox --verbose ...' for further details." } -@test "create: Try to create a container based on Fedora but with wrong version" { +@test "create: Try '--distro fedora --release foobar'" { run $TOOLBOX --assumeyes create --distro fedora --release foobar assert_failure @@ -128,7 +128,9 @@ teardown() { assert_line --index 1 "The release must be a positive integer." assert_line --index 2 "Run 'toolbox --help' for usage." assert [ ${#lines[@]} -eq 3 ] +} +@test "create: Try '--distro fedora --release -3'" { run $TOOLBOX --assumeyes create --distro fedora --release -3 assert_failure @@ -138,7 +140,7 @@ teardown() { assert [ ${#lines[@]} -eq 3 ] } -@test "create: Try to create a container based on RHEL but with wrong version" { +@test "create: Try '--distro rhel --release 8'" { run $TOOLBOX --assumeyes create --distro rhel --release 8 assert_failure @@ -146,7 +148,9 @@ teardown() { assert_line --index 1 "The release must be in the '.' format." assert_line --index 2 "Run 'toolbox --help' for usage." assert [ ${#lines[@]} -eq 3 ] +} +@test "create: Try '--distro rhel --release 8.2foo'" { run $TOOLBOX --assumeyes create --distro rhel --release 8.2foo assert_failure @@ -154,7 +158,9 @@ teardown() { assert_line --index 1 "The release must be in the '.' format." assert_line --index 2 "Run 'toolbox --help' for usage." assert [ ${#lines[@]} -eq 3 ] +} +@test "create: Try '--distro rhel --release -2.1'" { run $TOOLBOX --assumeyes create --distro rhel --release -2.1 assert_failure