diff options
author | Ed Santiago <santiago@redhat.com> | 2021-09-30 12:09:48 -0600 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-10-19 13:58:25 -0400 |
commit | 835d74ac63747e4e97b134d57a81679d41295310 (patch) | |
tree | 33d907febbb97e83b96dd5c486e5565abb9be047 /test | |
parent | 14509a92bb87bc328c67182b9e985fd81f6f7b53 (diff) | |
download | podman-835d74ac63747e4e97b134d57a81679d41295310.tar.gz podman-835d74ac63747e4e97b134d57a81679d41295310.tar.bz2 podman-835d74ac63747e4e97b134d57a81679d41295310.zip |
sdnotify test: accept MAINPID anywhere
systemd sometimes spits out lines in the wrong order. Deal with it.
This fixes an infrequent flake that I haven't filed because I
didn't understand it well enough. (Hence, this reduces BUGS
but does not reduce BUG COUNT. Sorry!)
Signed-off-by: Ed Santiago <santiago@redhat.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/system/260-sdnotify.bats | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/system/260-sdnotify.bats b/test/system/260-sdnotify.bats index 0dae569a8..395e6f94f 100644 --- a/test/system/260-sdnotify.bats +++ b/test/system/260-sdnotify.bats @@ -70,7 +70,7 @@ function _stop_socat() { # Check that MAINPID=xxxxx points to a running conmon process function _assert_mainpid_is_conmon() { - local mainpid=$(expr "$1" : "MAINPID=\([0-9]\+\)") + local mainpid=$(expr "$1" : ".*MAINPID=\([0-9]\+\)") test -n "$mainpid" || die "Could not parse '$1' as 'MAINPID=nnnn'" test -d /proc/$mainpid || die "sdnotify MAINPID=$mainpid - but /proc/$mainpid does not exist" @@ -121,7 +121,7 @@ function _assert_mainpid_is_conmon() { # we look for READY=1 _anywhere_ in the output, not just the last line. is "$output" ".*READY=1.*" "sdnotify sent READY=1" - _assert_mainpid_is_conmon "${lines[0]}" + _assert_mainpid_is_conmon "$output" # Done. Stop container, clean up. run_podman exec $cid touch /stop @@ -163,7 +163,7 @@ function _assert_mainpid_is_conmon() { is "$output" ".*READY=1" "received READY=1 through notify socket" - _assert_mainpid_is_conmon "${lines[0]}" + _assert_mainpid_is_conmon "$output" # Done. Stop container, clean up. run_podman exec $cid touch /stop |