From f3e435ec35755af32915684c75868caab400b7c9 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Wed, 24 May 2017 16:31:03 +0200 Subject: [PATCH] tests: check for up to 20s if postgresql is running Grep for the whole path of the binary because its basename is the same as the name of the user all this is running under. --- tests/config.yaml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/config.yaml b/tests/config.yaml index 463f924..1cbd39a 100644 --- a/tests/config.yaml +++ b/tests/config.yaml @@ -7,6 +7,8 @@ service: packages: rpms: - postgresql-server + # seq + - coreutils testdependecies: rpms: - postgresql @@ -26,8 +28,20 @@ module: repos: - https://kojipkgs.fedoraproject.org/repos/module-d87b0b15567e47f3-build/latest/x86_64/ test: - processrunning: - - 'ls /proc/*/exe -alh | grep postgres' + process_running: + - | + up=0 + for i in `seq 20`; do + echo "Checking for /usr/bin/postgres process... ($i)" + if ls /proc/*/exe -alh 2>/dev/null | grep /usr/bin/postgres; then + echo "Found." + up=1 + break + else + sleep 1 + fi + done + test "$up" -ne 0 testhost: selfcheck: - 'env PGPASSWORD=mtftest psql -h localhost -U mtftest -f test.sql | egrep "anything|something"'