Skip to content

Commit

Permalink
tests/int/debug.bats: fixups
Browse files Browse the repository at this point in the history
1. Remove the check that `log.out` file exists. This check is redundant,
   since right after it we do `cat log.out` and check its exit code.

2. Show the contents of log.out to stderr, so it case of error we can
   see what is going on.

Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
kolyshkin committed Jul 13, 2020
1 parent 56d633d commit 526a862
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions tests/integration/debug.bats
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ function teardown() {
# check output does not include debug info
[[ "${output}" != *"level=debug"* ]]

# check log.out was generated
[ -e log.out ]

# check expected debug output was sent to log.out
run cat log.out
[ "$status" -eq 0 ]
Expand All @@ -50,11 +47,9 @@ function teardown() {
# check output does not include debug info
[[ "${output}" != *"level=debug"* ]]

# check log.out was generated
[ -e log.out ]

# check expected debug output was sent to log.out
run cat log.out
echo "$output" >&2
[ "$status" -eq 0 ]
[[ "${output}" == *"level=debug"* ]]
[[ "${output}" == *"nsexec container setup"* ]]
Expand All @@ -69,11 +64,9 @@ function teardown() {
# check output does not include debug info
[[ "${output}" != *"level=debug"* ]]

# check log.out was generated
[ -e log.out ]

# check expected debug output was sent to log.out
run cat log.out
echo "$output" >&2
[ "$status" -eq 0 ]
[[ "${output}" == *'"level":"debug"'* ]]
[[ "${output}" == *"nsexec container setup"* ]]
Expand Down

0 comments on commit 526a862

Please sign in to comment.