test/system: Add function for setting up environment

Instead of typing out two function names to set up the test environment,
type out only one. We never know if a new set up function will show up.

https://github.com/containers/toolbox/pull/818
This commit is contained in:
Ondřej Míchal 2021-11-11 02:46:21 +02:00
parent 7a5f3ba2e2
commit fb565af0a0
12 changed files with 19 additions and 19 deletions

View file

@ -3,8 +3,7 @@
load 'libs/helpers'
@test "test suite: Setup" {
# Setup container storage paths
setup_containers_store
_setup_environment
# Cache the default image for the system
_pull_and_cache_distro_image $(get_system_id) $(get_system_version) || die
# Cache all images that will be needed during the tests

View file

@ -4,6 +4,10 @@ load 'libs/bats-support/load'
load 'libs/bats-assert/load'
load 'libs/helpers.bash'
setup() {
_setup_environment
}
@test "version: Check version using option --version" {
run $TOOLBOX --version

View file

@ -5,7 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers.bash'
setup() {
check_xdg_runtime_dir
_setup_environment
}
@test "help: Run command 'help'" {

View file

@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers'
setup() {
check_xdg_runtime_dir
setup_containers_store
_setup_environment
cleanup_containers
}

View file

@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers'
setup() {
check_xdg_runtime_dir
setup_containers_store
_setup_environment
cleanup_containers
}

View file

@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers'
setup() {
check_xdg_runtime_dir
setup_containers_store
_setup_environment
cleanup_all
}

View file

@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers'
setup() {
check_xdg_runtime_dir
setup_containers_store
_setup_environment
cleanup_containers
}

View file

@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers'
setup() {
check_xdg_runtime_dir
setup_containers_store
_setup_environment
cleanup_containers
}

View file

@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers'
setup() {
check_xdg_runtime_dir
setup_containers_store
_setup_environment
cleanup_containers
}

View file

@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers'
setup() {
check_xdg_runtime_dir
setup_containers_store
_setup_environment
cleanup_containers
}

View file

@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
load 'libs/helpers'
setup() {
check_xdg_runtime_dir
setup_containers_store
_setup_environment
cleanup_all
}

View file

@ -31,6 +31,11 @@ function cleanup_containers() {
}
function _setup_environment() {
_setup_containers_store
check_xdg_runtime_dir
}
function _setup_containers_store() {
mkdir -p ${TEMP_STORAGE_DIR}
# Setup a storage config file for PODMAN