mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
tests/int/{root,list}.bats: ALT_ROOT fixups in teardown
1. Add "unset ALT_ROOT" since it should not be used after teardown is
called.
2. Remove "rm -rf $ALT_ROOT". It is not needed, because ALT_ROOT is a
subdirectory of ROOT, which is removed in teardown_bundle.
3. Checking for ALT_ROOT being non-empty is a leftover from the era when
teardown() was called as the first step from setup(). Since commit
41670e21f0 this is no longer the case, so the condition
is no longer needed (plus, the `set -u` which is about to be added
should catch any possible use of unset ALT_ROOT).
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
@@ -9,9 +9,8 @@ function setup() {
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
if [ -n "$ALT_ROOT" ]; then
|
||||
ROOT="$ALT_ROOT" teardown_bundle
|
||||
fi
|
||||
ROOT="$ALT_ROOT" teardown_bundle
|
||||
unset ALT_ROOT
|
||||
teardown_bundle
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,8 @@ function setup() {
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
if [ -n "$ALT_ROOT" ]; then
|
||||
ROOT=$ALT_ROOT __runc delete -f test_dotbox
|
||||
rm -rf "$ALT_ROOT"
|
||||
fi
|
||||
ROOT=$ALT_ROOT __runc delete -f test_dotbox
|
||||
unset ALT_ROOT
|
||||
teardown_bundle
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user