Skip to content

Commit 1e90c72

Browse files
committed
test/system: Unbreak the downstream Fedora CI
The working directory from which bats(1) is invoked might not be part of the Toolbx container. eg., the downstream Fedora CI invokes the tests as: $ cd /path/to/toolbox/test/system $ bats . ... and it led to: not ok 8 help: Try unknown command (forwarded to host) # tags: commands-options # (from function `assert_line' in file ./libs/bats-assert/src/assert.bash, line 488, # in test file ./002-help.bats, line 135) # `assert_line --index 0 "Error: unknown command \"foo\" for \"toolbox\""' failed # # -- line differs -- # index : 0 # expected : Error: unknown command "foo" for "toolbox" # actual : Error: crun: chdir to `/usr/share/toolbox/test/system`: No such file or directory: OCI runtime attempted to invoke a command that was not found # -- # #1560
1 parent 57a4b49 commit 1e90c72

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

test/system/002-help.bats

+2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ setup() {
2525
bats_require_minimum_version 1.10.0
2626
_setup_environment
2727
cleanup_all
28+
pushd "$HOME" || return 1
2829
}
2930

3031
teardown() {
32+
popd || return 1
3133
cleanup_all
3234
}
3335

test/system/501-create.bats

+2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ setup() {
2525
bats_require_minimum_version 1.8.0
2626
_setup_environment
2727
cleanup_all
28+
pushd "$HOME" || return 1
2829
}
2930

3031
teardown() {
32+
popd || return 1
3133
cleanup_all
3234
}
3335

test/system/504-run.bats

+2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ setup() {
2525
bats_require_minimum_version 1.8.0
2626
_setup_environment
2727
cleanup_all
28+
pushd "$HOME" || return 1
2829
}
2930

3031
teardown() {
32+
popd || return 1
3133
cleanup_all
3234
}
3335

test/system/505-enter.bats

+2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ setup() {
2525
bats_require_minimum_version 1.8.0
2626
_setup_environment
2727
cleanup_all
28+
pushd "$HOME" || return 1
2829
}
2930

3031
teardown() {
32+
popd || return 1
3133
cleanup_all
3234
}
3335

0 commit comments

Comments
 (0)