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:
parent
7a5f3ba2e2
commit
fb565af0a0
12 changed files with 19 additions and 19 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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'" {
|
||||
|
|
|
@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
|
|||
load 'libs/helpers'
|
||||
|
||||
setup() {
|
||||
check_xdg_runtime_dir
|
||||
setup_containers_store
|
||||
_setup_environment
|
||||
cleanup_containers
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
|
|||
load 'libs/helpers'
|
||||
|
||||
setup() {
|
||||
check_xdg_runtime_dir
|
||||
setup_containers_store
|
||||
_setup_environment
|
||||
cleanup_containers
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
|
|||
load 'libs/helpers'
|
||||
|
||||
setup() {
|
||||
check_xdg_runtime_dir
|
||||
setup_containers_store
|
||||
_setup_environment
|
||||
cleanup_all
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
|
|||
load 'libs/helpers'
|
||||
|
||||
setup() {
|
||||
check_xdg_runtime_dir
|
||||
setup_containers_store
|
||||
_setup_environment
|
||||
cleanup_containers
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
|
|||
load 'libs/helpers'
|
||||
|
||||
setup() {
|
||||
check_xdg_runtime_dir
|
||||
setup_containers_store
|
||||
_setup_environment
|
||||
cleanup_containers
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
|
|||
load 'libs/helpers'
|
||||
|
||||
setup() {
|
||||
check_xdg_runtime_dir
|
||||
setup_containers_store
|
||||
_setup_environment
|
||||
cleanup_containers
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
|
|||
load 'libs/helpers'
|
||||
|
||||
setup() {
|
||||
check_xdg_runtime_dir
|
||||
setup_containers_store
|
||||
_setup_environment
|
||||
cleanup_containers
|
||||
}
|
||||
|
||||
|
|
|
@ -5,8 +5,7 @@ load 'libs/bats-assert/load'
|
|||
load 'libs/helpers'
|
||||
|
||||
setup() {
|
||||
check_xdg_runtime_dir
|
||||
setup_containers_store
|
||||
_setup_environment
|
||||
cleanup_all
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue