Skip to content

Commit af5be5e

Browse files
committed
Remove warning BW01 and use run -127 for tests with bats
1 parent 2d71cd9 commit af5be5e

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/test.bats

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ run_test() {
2727
run ./wrapper_test.sh "${LOG}" "$1" "${@:2}"
2828
}
2929

30+
run_test_failure() {
31+
bats_require_minimum_version 1.5.0
32+
failure_code=$1
33+
run -$1 ./wrapper_test.sh "${LOG}" "$2" "${@:3}"
34+
}
35+
3036
# SETUP AND TEARDOWN
3137

3238
setup() {
@@ -125,7 +131,8 @@ teardown() {
125131

126132
@test "Test SSH connection with false command" {
127133
./kinit_test.sh keytab
128-
run_test ./ssh_test.sh bob krb5-service-example-com.example.com '-o PreferredAuthentications=gssapi-with-mic' '' 'unknown'
134+
# shellcheck disable=SC2086
135+
run_test_failure 127 ./ssh_test.sh bob krb5-service-example-com.example.com '-o PreferredAuthentications=gssapi-with-mic' '' 'unknown'
129136
# Unknown command
130137
[[ "$status" -eq 127 ]] || failure
131138
./kdestroy_test.sh

0 commit comments

Comments
 (0)