daandemeyer / rpms / systemd

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