mirror of
https://github.com/containers/podman.git
synced 2026-03-19 07:08:38 -04:00
BATS tests: more resilient remove_same_dev_warning
Some CI tests are flaking in the SELinux test, possibly because there's a new variation of the "multiple devices" warning I hadn't seen before: WARNING: Creating device "/dev/null" with same type, major and minor as existing "/dev/foodevdir/null". Solution: in remove_same_dev_warning(), remove "multiple" from the match string. Also: fix a Go test that wasn't cleaning up after itself. And add an actual test to it, not just check-exit-status. Signed-off-by: Ed Santiago <santiago@redhat.com>
This commit is contained in:
@@ -404,7 +404,13 @@ function find_exec_pid_files() {
|
||||
#
|
||||
# This obviously screws us up when we look at output results.
|
||||
#
|
||||
# This function removes the warning from $output and $lines
|
||||
# This function removes the warning from $output and $lines. We don't
|
||||
# do a full string match because there's another variant of that message:
|
||||
#
|
||||
# WARNING: Creating device "/dev/null" with same type, major and minor as existing "/dev/foodevdir/null".
|
||||
#
|
||||
# (We should never again see that precise error ever again, but we could
|
||||
# see variants of it).
|
||||
#
|
||||
function remove_same_dev_warning() {
|
||||
# No input arguments. We operate in-place on $output and $lines
|
||||
@@ -412,7 +418,7 @@ function remove_same_dev_warning() {
|
||||
local i=0
|
||||
local -a new_lines=()
|
||||
while [[ $i -lt ${#lines[@]} ]]; do
|
||||
if expr "${lines[$i]}" : 'WARNING: .* same type, major.* multiple' >/dev/null; then
|
||||
if expr "${lines[$i]}" : 'WARNING: .* same type, major' >/dev/null; then
|
||||
:
|
||||
else
|
||||
new_lines+=("${lines[$i]}")
|
||||
|
||||
Reference in New Issue
Block a user