ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
b9a53a
From d6d43b81df76d571d57f83ceb050c8b4ac4701b8 Mon Sep 17 00:00:00 2001
b9a53a
From: Frantisek Sumsal <frantisek@sumsal.cz>
b9a53a
Date: Mon, 1 Jul 2019 13:08:26 +0200
be3800
Subject: [PATCH] test: support MPOL_LOCAL matching in unpatched strace
b9a53a
 versions
b9a53a
b9a53a
The MPOL_LOCAL constant is not recognized in current strace versions.
b9a53a
Let's match at least the numerical value of this constant until the
b9a53a
strace patch is approved & merged.
b9a53a
b9a53a
(cherry picked from commit ac14396d027023e1be910327989cb422cb2f6724)
b9a53a
b9a53a
Related: #1808940
b9a53a
---
b9a53a
 test/TEST-36-NUMAPOLICY/testsuite.sh | 12 ++++++++----
b9a53a
 1 file changed, 8 insertions(+), 4 deletions(-)
b9a53a
b9a53a
diff --git a/test/TEST-36-NUMAPOLICY/testsuite.sh b/test/TEST-36-NUMAPOLICY/testsuite.sh
b9a53a
index 306a96b517..a4134bdeca 100755
b9a53a
--- a/test/TEST-36-NUMAPOLICY/testsuite.sh
b9a53a
+++ b/test/TEST-36-NUMAPOLICY/testsuite.sh
b9a53a
@@ -173,12 +173,16 @@ echo "PID1 NUMAPolicy support - Local policy w/o mask"
b9a53a
 writePID1NUMAPolicy "local"
b9a53a
 pid1ReloadWithStrace
b9a53a
 # Kernel requires that nodemask argument is set to NULL when setting default policy
b9a53a
-grep "set_mempolicy(MPOL_LOCAL, NULL" $straceLog
b9a53a
+# The unpatched versions of strace don't recognize the MPOL_LOCAL constant and
b9a53a
+# return a numerical constant instead (with a comment):
b9a53a
+#   set_mempolicy(0x4 /* MPOL_??? */, NULL, 0) = 0
b9a53a
+# Let's cover this scenario as well
b9a53a
+grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
b9a53a
 
b9a53a
 echo "PID1 NUMAPolicy support - Local policy w/ mask"
b9a53a
 writePID1NUMAPolicy "local" "0"
b9a53a
 pid1ReloadWithStrace
b9a53a
-grep "set_mempolicy(MPOL_LOCAL, NULL" $straceLog
b9a53a
+grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
b9a53a
 
b9a53a
 echo "Unit file NUMAPolicy support - Default policy w/o mask"
b9a53a
 writeTestUnitNUMAPolicy "default"
b9a53a
@@ -240,7 +244,7 @@ writeTestUnitNUMAPolicy "local"
b9a53a
 pid1StartUnitWithStrace $testUnit
b9a53a
 systemctlCheckNUMAProperties $testUnit "local"
b9a53a
 pid1StopUnit $testUnit
b9a53a
-grep "set_mempolicy(MPOL_LOCAL, NULL" $straceLog
b9a53a
+grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
b9a53a
 
b9a53a
 echo "Unit file NUMAPolicy support - Local policy w/ mask"
b9a53a
 writeTestUnitNUMAPolicy "local" "0"
b9a53a
@@ -248,7 +252,7 @@ pid1StartUnitWithStrace $testUnit
b9a53a
 systemctlCheckNUMAProperties $testUnit "local" "0"
b9a53a
 pid1StopUnit $testUnit
b9a53a
 # Maks must be ignored
b9a53a
-grep "set_mempolicy(MPOL_LOCAL, NULL" $straceLog
b9a53a
+grep -E "set_mempolicy\((MPOL_LOCAL|0x4 [^,]*), NULL" $straceLog
b9a53a
 
b9a53a
 echo "systemd-run NUMAPolicy support"
b9a53a
 runUnit='numa-systemd-run-test.service'