5d2ee9
From 60813b55f9b5b44b14f38bbc1b8c0d2b30e3f6c7 Mon Sep 17 00:00:00 2001
5d2ee9
From: Frantisek Sumsal <frantisek@sumsal.cz>
5d2ee9
Date: Mon, 1 Jul 2019 19:53:45 +0200
4cad4c
Subject: [PATCH] test: make sure the strace process is indeed dead
5d2ee9
5d2ee9
It may take a few moments for the strace process to properly terminate
5d2ee9
and write all logs to the backing storage
5d2ee9
5d2ee9
(cherry picked from commit 56425e54a2140f47b4560b51c5db08aa2de199a6)
5d2ee9
5d2ee9
Related: #1808940
5d2ee9
---
5d2ee9
 test/TEST-36-NUMAPOLICY/test.sh      | 2 +-
5d2ee9
 test/TEST-36-NUMAPOLICY/testsuite.sh | 3 +++
5d2ee9
 2 files changed, 4 insertions(+), 1 deletion(-)
5d2ee9
5d2ee9
diff --git a/test/TEST-36-NUMAPOLICY/test.sh b/test/TEST-36-NUMAPOLICY/test.sh
5d2ee9
index a0d8623e8e..f0a321e7a1 100755
5d2ee9
--- a/test/TEST-36-NUMAPOLICY/test.sh
5d2ee9
+++ b/test/TEST-36-NUMAPOLICY/test.sh
5d2ee9
@@ -16,7 +16,7 @@ test_setup() {
5d2ee9
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
5d2ee9
 
5d2ee9
         setup_basic_environment
5d2ee9
-        inst_binary mktemp
5d2ee9
+        dracut_install mktemp
5d2ee9
 
5d2ee9
         # mask some services that we do not want to run in these tests
5d2ee9
         ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
5d2ee9
diff --git a/test/TEST-36-NUMAPOLICY/testsuite.sh b/test/TEST-36-NUMAPOLICY/testsuite.sh
5d2ee9
index a4134bdeca..daed8fcc1c 100755
5d2ee9
--- a/test/TEST-36-NUMAPOLICY/testsuite.sh
5d2ee9
+++ b/test/TEST-36-NUMAPOLICY/testsuite.sh
5d2ee9
@@ -38,6 +38,8 @@ startStrace() {
5d2ee9
 
5d2ee9
 stopStrace() {
5d2ee9
     kill -s TERM $COPROC_PID
5d2ee9
+    # Make sure the strace process is indeed dead
5d2ee9
+    while kill -0 $COPROC_PID 2>/dev/null; do sleep 0.1; done
5d2ee9
 }
5d2ee9
 
5d2ee9
 startJournalctl() {
5d2ee9
@@ -80,6 +82,7 @@ writeTestUnitNUMAPolicy() {
5d2ee9
 pid1ReloadWithStrace() {
5d2ee9
     startStrace
5d2ee9
     systemctl daemon-reload
5d2ee9
+    sleep $sleepAfterStart
5d2ee9
     stopStrace
5d2ee9
 }
5d2ee9