diff --git a/test/system/002-help.bats b/test/system/002-help.bats index 4ff02c6..cca3da4 100644 --- a/test/system/002-help.bats +++ b/test/system/002-help.bats @@ -4,6 +4,10 @@ load 'libs/bats-support/load' load 'libs/bats-assert/load' load 'libs/helpers.bash' +setup() { + check_xdg_runtime_dir +} + @test "help: Run command 'help'" { run $TOOLBOX help diff --git a/test/system/101-create.bats b/test/system/101-create.bats index fc8d415..43c84ef 100644 --- a/test/system/101-create.bats +++ b/test/system/101-create.bats @@ -5,6 +5,7 @@ load 'libs/bats-assert/load' load 'libs/helpers' setup() { + check_xdg_runtime_dir cleanup_containers } diff --git a/test/system/102-list.bats b/test/system/102-list.bats index 184ad6c..770e8d2 100644 --- a/test/system/102-list.bats +++ b/test/system/102-list.bats @@ -5,6 +5,7 @@ load 'libs/bats-assert/load' load 'libs/helpers' setup() { + check_xdg_runtime_dir cleanup_all } diff --git a/test/system/103-container.bats b/test/system/103-container.bats index 01b61e5..e442db1 100644 --- a/test/system/103-container.bats +++ b/test/system/103-container.bats @@ -5,6 +5,7 @@ load 'libs/bats-assert/load' load 'libs/helpers' setup() { + check_xdg_runtime_dir cleanup_containers } diff --git a/test/system/104-run.bats b/test/system/104-run.bats index 026126b..03cf291 100644 --- a/test/system/104-run.bats +++ b/test/system/104-run.bats @@ -5,6 +5,7 @@ load 'libs/bats-assert/load' load 'libs/helpers' setup() { + check_xdg_runtime_dir cleanup_containers } diff --git a/test/system/105-rm.bats b/test/system/105-rm.bats index 9f1435b..68e3c03 100644 --- a/test/system/105-rm.bats +++ b/test/system/105-rm.bats @@ -5,6 +5,7 @@ load 'libs/bats-assert/load' load 'libs/helpers' setup() { + check_xdg_runtime_dir cleanup_containers } diff --git a/test/system/106-rmi.bats b/test/system/106-rmi.bats index 0ef0ebe..b48f802 100644 --- a/test/system/106-rmi.bats +++ b/test/system/106-rmi.bats @@ -5,6 +5,7 @@ load 'libs/bats-assert/load' load 'libs/helpers' setup() { + check_xdg_runtime_dir cleanup_all } diff --git a/test/system/libs/helpers.bash b/test/system/libs/helpers.bash index f2d239a..883d80e 100644 --- a/test/system/libs/helpers.bash +++ b/test/system/libs/helpers.bash @@ -270,3 +270,11 @@ function get_system_version() { echo $(awk -F= '/VERSION_ID/ {print $2}' $os_release | head -n 1) } + + +# Setup the XDG_RUNTIME_DIR variable if not set +function check_xdg_runtime_dir() { + if [[ -z "${XDG_RUNTIME_DIR}" ]]; then + export XDG_RUNTIME_DIR="/run/user/${UID}" + fi +}