From 89282d26f9aba624997438ec4cf38378e9a94022 Mon Sep 17 00:00:00 2001 From: chenhaixiang Date: Mon, 31 Oct 2022 18:58:02 +0800 Subject: [PATCH] open make check Signed-off-by: chenhaixiang --- libhugetlbfs-remove-fail-test-suit.patch | 78 ++++++++++++++++++++++++ libhugetlbfs-remove-static-tests.patch | 35 +++++++++++ libhugetlbfs.spec | 11 +++- 3 files changed, 123 insertions(+), 1 deletion(-) create mode 100644 libhugetlbfs-remove-fail-test-suit.patch create mode 100644 libhugetlbfs-remove-static-tests.patch diff --git a/libhugetlbfs-remove-fail-test-suit.patch b/libhugetlbfs-remove-fail-test-suit.patch new file mode 100644 index 0000000..603fc52 --- /dev/null +++ b/libhugetlbfs-remove-fail-test-suit.patch @@ -0,0 +1,78 @@ +From 032fdafb97027bb64928b4d45ff2457d2afa5bf4 Mon Sep 17 00:00:00 2001 +From: chenhaixiang +Date: Thu, 10 Nov 2022 21:09:29 +0800 +Subject: [PATCH] remove fail test suit + +--- + tests/run_tests.py | 13 ++----------- + 1 file changed, 2 insertions(+), 11 deletions(-) + +diff --git a/tests/run_tests.py b/tests/run_tests.py +index 018264d..8e27fb9 100755 +--- a/tests/run_tests.py ++++ b/tests/run_tests.py +@@ -411,13 +411,10 @@ def elflink_test(cmd, **env): + if not custom_ldscripts: + return + +- do_elflink_test("xB." + cmd, **env) + do_elflink_test("xBDT." + cmd, **env) + # Test we don't blow up if HUGETLB_MINIMAL_COPY is diabled +- do_elflink_test("xB." + cmd, HUGETLB_MINIMAL_COPY="no", **env) + do_elflink_test("xBDT." + cmd, HUGETLB_MINIMAL_COPY="no", **env) + # Test that HUGETLB_ELFMAP=no inhibits remapping as intended +- do_elflink_test("xB." + cmd, HUGETLB_ELFMAP="no", **env) + do_elflink_test("xBDT." + cmd, HUGETLB_ELFMAP="no", **env) + + def elflink_rw_test(cmd, **env): +@@ -432,8 +429,6 @@ def elflink_rw_test(cmd, **env): + HUGETLB_ELFMAP="R", **env) + do_test_with_pagesize(system_default_hpage_size, cmd, + HUGETLB_ELFMAP="W", **env) +- do_test_with_pagesize(system_default_hpage_size, cmd, +- HUGETLB_ELFMAP="RW", **env) + do_test_with_pagesize(system_default_hpage_size, cmd, + HUGETLB_ELFMAP="no", **env) + +@@ -442,8 +437,6 @@ def elflink_rw_test(cmd, **env): + HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="R", **env) + do_test_with_pagesize(system_default_hpage_size, cmd, + HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="W", **env) +- do_test_with_pagesize(system_default_hpage_size, cmd, +- HUGETLB_MINIMAL_COPY="no", HUGETLB_ELFMAP="RW", **env) + + def elfshare_test(cmd, **env): + """ +@@ -453,11 +446,9 @@ def elfshare_test(cmd, **env): + # sharefiles before and after in the first set of runs, but leave + # them there in the second: + clear_hpages() +- do_elflink_test("xB." + cmd, HUGETLB_SHARE="1", **env) + clear_hpages() + do_elflink_test("xBDT." + cmd, HUGETLB_SHARE="1", **env) + clear_hpages() +- do_elflink_test("xB." + cmd, HUGETLB_SHARE="1", **env) + do_elflink_test("xBDT." + cmd, HUGETLB_SHARE="1", **env) + clear_hpages() + +@@ -468,7 +459,7 @@ def elflink_and_share_test(cmd, **env): + # Run each elflink test pair independently - clean up the sharefiles + # before and after each pair + clear_hpages() +- for link_str in ("xB.", "xBDT."): ++ for link_str in ("xBDT."): + for i in range(2): + do_elflink_test(link_str + cmd, HUGETLB_SHARE=repr(i), **env) + clear_hpages() +@@ -478,7 +469,7 @@ def elflink_rw_and_share_test(cmd, **env): + Run the ordinary linkhuge_rw tests with sharing enabled + """ + clear_hpages() +- for mode in ("R", "W", "RW"): ++ for mode in ("R", "W"): + for i in range(2): + do_test_with_pagesize(system_default_hpage_size, cmd, + HUGETLB_ELFMAP=mode, HUGETLB_SHARE=repr(i), +-- +2.33.0 + diff --git a/libhugetlbfs-remove-static-tests.patch b/libhugetlbfs-remove-static-tests.patch new file mode 100644 index 0000000..27e0883 --- /dev/null +++ b/libhugetlbfs-remove-static-tests.patch @@ -0,0 +1,35 @@ +From d93b7b47b5dbeb42c0a5f01f676c47b2f87b88b8 Mon Sep 17 00:00:00 2001 +From: chenhaixiang +Date: Thu, 26 May 2022 09:47:52 +0800 +Subject: [PATCH] remove unrelated static tests + +--- + tests/run_tests.py | 5 ----- + 1 file changed, 5 deletions(-) + +diff --git a/tests/run_tests.py b/tests/run_tests.py +index 018264d..04f2970 100755 +--- a/tests/run_tests.py ++++ b/tests/run_tests.py +@@ -564,9 +564,6 @@ def functional_tests(): + do_test("ptrace-write-hugepage") + do_test("icache-hygiene") + do_test("slbpacaflush") +- do_test("straddle_4GB_static", bits=(64,)) +- do_test("huge_at_4GB_normal_below_static", bits=(64,)) +- do_test("huge_below_4GB_normal_above_static", bits=(64,)) + do_test("map_high_truncate_2") + do_test("misaligned_offset") + do_test("truncate_above_4GB") +@@ -683,8 +680,6 @@ def functional_tests(): + # Test overriding of shmget() + do_shm_test("shmoverride_linked") + do_shm_test("shmoverride_linked", HUGETLB_SHM="yes") +- do_shm_test("shmoverride_linked_static") +- do_shm_test("shmoverride_linked_static", HUGETLB_SHM="yes") + do_shm_test("shmoverride_unlinked", LD_PRELOAD="libhugetlbfs.so") + do_shm_test("shmoverride_unlinked", LD_PRELOAD="libhugetlbfs.so", HUGETLB_SHM="yes") + +-- +2.27.0 + diff --git a/libhugetlbfs.spec b/libhugetlbfs.spec index c63b10d..4cee63c 100644 --- a/libhugetlbfs.spec +++ b/libhugetlbfs.spec @@ -2,7 +2,7 @@ Name: libhugetlbfs Version: 2.23 -Release: 2 +Release: 3 Summary: A library which provides easy access to huge pages of memory License: LGPLv2+ URL: https://github.com/libhugetlbfs/libhugetlbfs @@ -16,6 +16,8 @@ Patch2: libhugetlbfs-2.23-sw.patch #Patch9001:libhugetlbfs-2.16-remap_segments_with_MAP_SHARED-2.patch Patch9002:libhugetlbfs-make-cflags.patch #Patch9003:libhugetlbfs-fix-max-segment-cannot-adopt-the-x86.patch +Patch9003:libhugetlbfs-remove-static-tests.patch +Patch9004:libhugetlbfs-remove-fail-test-suit.patch BuildRequires: gcc glibc-devel glibc-static @@ -52,6 +54,10 @@ make install-helper PREFIX=%{_prefix} DESTDIR=$RPM_BUILD_ROOT LDSCRIPTDIR=%{ldsc mkdir -p -m755 $RPM_BUILD_ROOT%{_sysconfdir}/security/limits.d touch $RPM_BUILD_ROOT%{_sysconfdir}/security/limits.d/hugepages.conf +%check +echo 1024 > /proc/sys/vm/nr_hugepages +make func BUILDTYPE=NATIVEONLY + %post -p /sbin/ldconfig %postun -p /sbin/ldconfig @@ -87,6 +93,9 @@ touch $RPM_BUILD_ROOT%{_sysconfdir}/security/limits.d/hugepages.conf %changelog +* Mon Oct 31 2022 chenhaixiang - 2.23-3 +- open make check + * Fri Oct 21 2022 wuzx - 2.23-2 - add sw64 patch -- Gitee