Skip to content

Commit

Permalink
test/system: Ensure that error messages go to the standard error stream
Browse files Browse the repository at this point in the history
Currently, there's no way to get assert_line to use the stderr_lines
array [1].  This is worked around by assigning stderr_lines to the
'lines' array.

[1] bats-core/bats-assert#42

containers#1195
  • Loading branch information
debarshiray committed Dec 9, 2022
1 parent 92676f6 commit 250001d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/system/107-rmi.bats
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,11 @@ teardown() {
create_container foo
start_container foo

run --keep-empty-lines $TOOLBOX rmi --all
run --keep-empty-lines --separate-stderr $TOOLBOX rmi --all

assert_failure
assert_output --regexp "Error: image .* has dependent children"
lines=("${stderr_lines[@]}")
assert_line --index 0 --regexp "Error: image .* has dependent children"

new_num_of_images=$(list_images)

Expand Down

0 comments on commit 250001d

Please sign in to comment.