daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
b9a53a
From 0bef8805c81eecfe3960bf00b6022837e4979198 Mon Sep 17 00:00:00 2001
b9a53a
From: Frantisek Sumsal <fsumsal@redhat.com>
b9a53a
Date: Tue, 3 Mar 2020 15:54:29 +0100
be3800
Subject: [PATCH] test: replace cursor file with a plain cursor
b9a53a
b9a53a
systemd in RHEL 8 doesn't support the --cursor-file option, so let's
b9a53a
fall back to a plain cursor string
b9a53a
b9a53a
Related: #1808940
b9a53a
rhel-only
b9a53a
---
b9a53a
 test/TEST-36-NUMAPOLICY/test.sh      | 2 +-
b9a53a
 test/TEST-36-NUMAPOLICY/testsuite.sh | 6 +++---
b9a53a
 2 files changed, 4 insertions(+), 4 deletions(-)
b9a53a
b9a53a
diff --git a/test/TEST-36-NUMAPOLICY/test.sh b/test/TEST-36-NUMAPOLICY/test.sh
b9a53a
index 3b3b120423..7cc909765b 100755
b9a53a
--- a/test/TEST-36-NUMAPOLICY/test.sh
b9a53a
+++ b/test/TEST-36-NUMAPOLICY/test.sh
b9a53a
@@ -17,7 +17,7 @@ test_setup() {
b9a53a
         eval $(udevadm info --export --query=env --name=${LOOPDEV}p2)
b9a53a
 
b9a53a
         setup_basic_environment
b9a53a
-        dracut_install mktemp
b9a53a
+        dracut_install mktemp awk
b9a53a
 
b9a53a
         # mask some services that we do not want to run in these tests
b9a53a
         ln -fs /dev/null $initdir/etc/systemd/system/systemd-hwdb-update.service
b9a53a
diff --git a/test/TEST-36-NUMAPOLICY/testsuite.sh b/test/TEST-36-NUMAPOLICY/testsuite.sh
b9a53a
index a5ac788178..bffac4ffe6 100755
b9a53a
--- a/test/TEST-36-NUMAPOLICY/testsuite.sh
b9a53a
+++ b/test/TEST-36-NUMAPOLICY/testsuite.sh
b9a53a
@@ -30,7 +30,7 @@ journalSleep=5
b9a53a
 sleepAfterStart=1
b9a53a
 
b9a53a
 # Journal cursor for easier navigation
b9a53a
-journalCursorFile="jounalCursorFile"
b9a53a
+journalCursor=""
b9a53a
 
b9a53a
 startStrace() {
b9a53a
     coproc strace -qq -p 1 -o $straceLog -e set_mempolicy -s 1024 $1
b9a53a
@@ -46,7 +46,7 @@ stopStrace() {
b9a53a
 
b9a53a
 startJournalctl() {
b9a53a
     # Save journal's cursor for later navigation
b9a53a
-    journalctl --no-pager --cursor-file="$journalCursorFile" -n0 -ocat
b9a53a
+    journalCursor="$(journalctl --no-pager --show-cursor -n0 -ocat | awk '{print $3}')"
b9a53a
 }
b9a53a
 
b9a53a
 stopJournalctl() {
b9a53a
@@ -55,7 +55,7 @@ stopJournalctl() {
b9a53a
     # the --sync wait until the synchronization is complete
b9a53a
     echo "Force journald to write all queued messages"
b9a53a
     journalctl --sync
b9a53a
-    journalctl -u $unit --cursor-file="$journalCursorFile" > "$journalLog"
b9a53a
+    journalctl -u $unit --after-cursor="$journalCursor" > "$journalLog"
b9a53a
 }
b9a53a
 
b9a53a
 checkNUMA() {