test/system: Ensure that error messages go to the standard error stream

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] https://github.com/bats-core/bats-assert/issues/42

https://github.com/containers/toolbox/pull/1195
This commit is contained in:
Debarshi Ray 2022-12-09 10:04:48 +01:00
parent 26ed682cd1
commit 210985ecd1
1 changed files with 3 additions and 2 deletions

View File

@ -53,10 +53,11 @@ teardown() {
create_container foo create_container foo
start_container foo start_container foo
run --keep-empty-lines $TOOLBOX rmi --all run --keep-empty-lines --separate-stderr $TOOLBOX rmi --all
assert_failure 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) new_num_of_images=$(list_images)