Blame SOURCES/0016-elflink-tests-Run-tests-only-for-default-huge-page-s.patch

fc9b0e
From 4dfdd96a6b4bd019210c9a44de42369aae772b98 Mon Sep 17 00:00:00 2001
fc9b0e
Message-Id: <4dfdd96a6b4bd019210c9a44de42369aae772b98.1566225007.git.aquini@redhat.com>
fc9b0e
In-Reply-To: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
fc9b0e
References: <d42f467a923dfc09309acb7a83b42e3285fbd8f4.1566225007.git.aquini@redhat.com>
fc9b0e
From: Sandipan Das <sandipan@linux.ibm.com>
fc9b0e
Date: Wed, 12 Jun 2019 12:34:33 +0530
fc9b0e
Subject: [RHEL7 PATCH 16/31] elflink: tests: Run tests only for default huge
fc9b0e
 page size
fc9b0e
fc9b0e
The elflink tests (linkhuge, linkhuge-nofd, linkhuge-rw and
fc9b0e
linkshare) are usually linked in a way that ensures that the
fc9b0e
ELF segment boundaries are aligned to the kernel's default
fc9b0e
huge page size. Hence, run these tests only for the kernel's
fc9b0e
default huge page size as the program segments will not be
fc9b0e
remapped otherwise.
fc9b0e
fc9b0e
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
fc9b0e
Signed-off-by: Eric B Munson <emunson@mgebm.net>
fc9b0e
Signed-off-by: Rafael Aquini <aquini@redhat.com>
fc9b0e
---
fc9b0e
 tests/run_tests.py | 41 ++++++++++++++++++++++++++---------------
fc9b0e
 1 file changed, 26 insertions(+), 15 deletions(-)
fc9b0e
fc9b0e
diff --git a/tests/run_tests.py b/tests/run_tests.py
fc9b0e
index 70c5a6a..94000ea 100755
fc9b0e
--- a/tests/run_tests.py
fc9b0e
+++ b/tests/run_tests.py
fc9b0e
@@ -376,10 +376,11 @@ def do_elflink_test(cmd, **env):
fc9b0e
     """
fc9b0e
     Run an elflink test case, skipping known-bad configurations.
fc9b0e
     """
fc9b0e
-    for p in pagesizes:
fc9b0e
-        for b in wordsizes_by_pagesize[p]:
fc9b0e
-            if b in linkhuge_wordsizes: run_test(p, b, cmd, **env)
fc9b0e
-            else: skip_test(p, b, cmd, **env)
fc9b0e
+    for b in wordsizes_by_pagesize[system_default_hpage_size]:
fc9b0e
+        if b in linkhuge_wordsizes:
fc9b0e
+            run_test(system_default_hpage_size, b, cmd, **env)
fc9b0e
+        else:
fc9b0e
+            skip_test(system_default_hpage_size, b, cmd, **env)
fc9b0e
 
fc9b0e
 def elflink_test(cmd, **env):
fc9b0e
     """
fc9b0e
@@ -388,9 +389,10 @@ def elflink_test(cmd, **env):
fc9b0e
     Test various combinations of: preloading libhugetlbfs, B vs. BDT link
fc9b0e
     modes, minimal copying on or off, and disabling segment remapping.
fc9b0e
     """
fc9b0e
-    do_test(cmd, **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd, **env)
fc9b0e
     # Test we don't blow up if not linked for hugepage
fc9b0e
-    do_test(cmd, LD_PRELOAD="libhugetlbfs.so", **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                          LD_PRELOAD="libhugetlbfs.so", **env)
fc9b0e
 
fc9b0e
     # Only run custom ldscript tests when -l option is set
fc9b0e
     if not custom_ldscripts:
fc9b0e
@@ -412,16 +414,23 @@ def elflink_rw_test(cmd, **env):
fc9b0e
     Test various combinations of: remapping modes and minimal copy on or off.
fc9b0e
     """
fc9b0e
     # Basic tests: None, Read-only, Write-only, Read-Write, exlicit disable
fc9b0e
-    do_test(cmd, **env)
fc9b0e
-    do_test(cmd, HUGETLB_ELFMAP="R", **env)
fc9b0e
-    do_test(cmd, HUGETLB_ELFMAP="W", **env)
fc9b0e
-    do_test(cmd, HUGETLB_ELFMAP="RW", **env)
fc9b0e
-    do_test(cmd, HUGETLB_ELFMAP="no", **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd, **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                          HUGETLB_ELFMAP="R", **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                          HUGETLB_ELFMAP="W", **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                          HUGETLB_ELFMAP="RW", **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                          HUGETLB_ELFMAP="no", **env)
fc9b0e
 
fc9b0e
     # Test we don't blow up if HUGETLB_MINIMAL_COPY is disabled
fc9b0e
-    do_test(cmd, HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="R", **env)
fc9b0e
-    do_test(cmd, HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="W", **env)
fc9b0e
-    do_test(cmd, HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="RW", **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                          HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="R", **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                          HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="W", **env)
fc9b0e
+    do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                          HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="RW", **env)
fc9b0e
 
fc9b0e
 def elfshare_test(cmd, **env):
fc9b0e
     """
fc9b0e
@@ -458,7 +467,9 @@ def elflink_rw_and_share_test(cmd, **env):
fc9b0e
     clear_hpages()
fc9b0e
     for mode in ("R", "W", "RW"):
fc9b0e
         for i in range(2):
fc9b0e
-            do_test(cmd, HUGETLB_ELFMAP=mode, HUGETLB_SHARE=repr(i), **env)
fc9b0e
+            do_test_with_pagesize(system_default_hpage_size, cmd,
fc9b0e
+                                  HUGETLB_ELFMAP=mode, HUGETLB_SHARE=repr(i),
fc9b0e
+                                  **env)
fc9b0e
         clear_hpages()
fc9b0e
 
fc9b0e
 def setup_shm_sysctl(limit):
fc9b0e
-- 
fc9b0e
1.8.3.1
fc9b0e