summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2009-11-04 04:08:49 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2009-11-04 04:08:49 +0000
commitcd29ad132cc7fd3660c7fd57b3518d4b2ef0d882 (patch)
tree45eb891139fce100425eb73604f191ed88754589 /sys-libs
parentUpdate the libusb dep to point to virtual/libusb:0 as this should work fine w... (diff)
downloadhistorical-cd29ad132cc7fd3660c7fd57b3518d4b2ef0d882.tar.gz
historical-cd29ad132cc7fd3660c7fd57b3518d4b2ef0d882.tar.bz2
historical-cd29ad132cc7fd3660c7fd57b3518d4b2ef0d882.zip
Fully wire up the upstream testsuite.
Package-Manager: portage-2.2_rc48/cvs/Linux x86_64
Diffstat (limited to 'sys-libs')
-rw-r--r--sys-libs/libhugetlbfs/ChangeLog6
-rw-r--r--sys-libs/libhugetlbfs/Manifest5
-rw-r--r--sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch49
-rw-r--r--sys-libs/libhugetlbfs/libhugetlbfs-2.6.ebuild127
4 files changed, 154 insertions, 33 deletions
diff --git a/sys-libs/libhugetlbfs/ChangeLog b/sys-libs/libhugetlbfs/ChangeLog
index 08dc2b69f7b9..dd51d8435301 100644
--- a/sys-libs/libhugetlbfs/ChangeLog
+++ b/sys-libs/libhugetlbfs/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-libs/libhugetlbfs
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v 1.3 2009/10/31 07:59:56 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/ChangeLog,v 1.4 2009/11/04 04:08:48 robbat2 Exp $
+
+ 04 Nov 2009; Robin H. Johnson <robbat2@gentoo.org>
+ libhugetlbfs-2.6.ebuild, +files/libhugetlbfs-2.6-fixup-testsuite.patch:
+ Fully wire up the upstream testsuite.
*libhugetlbfs-2.6 (31 Oct 2009)
diff --git a/sys-libs/libhugetlbfs/Manifest b/sys-libs/libhugetlbfs/Manifest
index 88ecdc203909..d1c517ce6641 100644
--- a/sys-libs/libhugetlbfs/Manifest
+++ b/sys-libs/libhugetlbfs/Manifest
@@ -1,10 +1,11 @@
AUX libhugetlbfs-1.1-build.patch 1275 RMD160 840cc7e91291b61b6fee47feb429b87b5727be97 SHA1 0758877ee54637718fc3d9fbf9cf05bb7287c0cb SHA256 69cc6d33e8a6cac6d5ae3ee96b9192b342e60e6953d48c145706a1963d88e6c3
+AUX libhugetlbfs-2.6-fixup-testsuite.patch 2037 RMD160 806a8eac01e1036c0afcdb1b4e6ebc3a12649d49 SHA1 af9363416844c7d2020b4c255346538d3d2fadc6 SHA256 9538deef3733c483cfcb78beb2e690a33096f951407cf4d987ef94ed72c99877
AUX libhugetlbfs-2.6-noexec-stack.patch 1497 RMD160 1e776f4fda19798084dd5bcc6872a15fd543b1d5 SHA1 cff4e5a2dbabe1b3fde7c73cb663ae87ef70362d SHA256 24de0b668c25568b70c705dbd3e1533c6358ad774ee96720b963ab7cd5226f2f
DIST libhugetlbfs-1.1.tar.gz 66438 RMD160 10a95c9e10e99c0b85a57db10da8dbfd6d41e1c9 SHA1 aa36f828d914b0af5ec047b4101c2e67777b46c7 SHA256 dc349626b79762987a7fe98c75914f7af2c9ce314dc395944cdc5d477992547e
DIST libhugetlbfs-1.2.tar.gz 71275 RMD160 73ebdafead3196f00f1685e2e420a314c7523d7a SHA1 d01dcc3f517824b3a4b21bb1405907379528b6b8 SHA256 c47a553ef1affb5a773df0e50ef4fbb399541e0e9274459b0d3225e12d149649
DIST libhugetlbfs-2.6.tar.gz 148202 RMD160 541d98c6c5828ec57dc374657596ea1cac8b141e SHA1 eec97b9ae34bce559f7eaf977eeb215359cca141 SHA256 6195fdecee0b370d8a82c76a6c2a5b9892e547de319d8a7f52138a796505e890
EBUILD libhugetlbfs-1.1.ebuild 882 RMD160 39a7ef709a76dd54b26868eace3af30938e5fef4 SHA1 7b67b66454a3718833c93ad5477fa870d1547ac6 SHA256 33469abd1afacc34ff79ad139ebab0f0bc2e8ba6b521800450d70f3ee4f10b20
EBUILD libhugetlbfs-1.2.ebuild 850 RMD160 e97b8c78e2a2abfc0a79e0731fbf1218ccb8a644 SHA1 038a7aa318bc74c684d331a7b2c37c34ae671440 SHA256 21c95cbc203f12b1dc020a651d9c94b0ad9551fa5708b840e445972579d1c561
-EBUILD libhugetlbfs-2.6.ebuild 1892 RMD160 3f170891cd59db6097e9c6dc461095ea1b85ad67 SHA1 26572c1d25b9c64e0c270df86dfc5e44bfa0d0b3 SHA256 3be0edec635a84cfe6286b42e9a5ad80e9ee18c7bbd387ca9ec440368dd64da0
-MISC ChangeLog 721 RMD160 dbb7b182dbf5820800af08499e072063b21a8a66 SHA1 e2760eacac1c60e349cdb51a279a7aefefc45cc0 SHA256 1c840babebae8675740870a1290bb9ffc532a35aaffd5924a6b5f23ad20f9406
+EBUILD libhugetlbfs-2.6.ebuild 3886 RMD160 215d2cea89715230aaa2273423566bd97805382d SHA1 ab6cdd1607a1cdad5958a449d1c2e5fa5e8d109b SHA256 72a6c6a3ba6193cfd56ec5065f9ba223a0802182a259e7a74fa65cc5ca567c7f
+MISC ChangeLog 889 RMD160 e6980b88eb7d3b2aeb2ad5d3afc5c057e13c9d7e SHA1 88316f3cf53fefbb26cf2fcf71181d1c63b4255c SHA256 e50a3925872bd019853132e756b6befdcf268aa3ab9e36d57efd3cd23a782f6c
MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92
diff --git a/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch
new file mode 100644
index 000000000000..de8fed17c475
--- /dev/null
+++ b/sys-libs/libhugetlbfs/files/libhugetlbfs-2.6-fixup-testsuite.patch
@@ -0,0 +1,49 @@
+diff -Nuar --exclude '*.S' --exclude Makefile libhugetlbfs-2.6.orig/tests/run_tests.py libhugetlbfs-2.6/tests/run_tests.py
+--- libhugetlbfs-2.6.orig/tests/run_tests.py 2009-08-24 05:56:07.000000000 -0700
++++ libhugetlbfs-2.6/tests/run_tests.py 2009-10-31 00:40:28.520387427 -0700
+@@ -56,6 +56,11 @@
+ local_env["LD_LIBRARY_PATH"] = "../obj%d:obj%d:%s" \
+ % (bits, bits, local_env.get("LD_LIBRARY_PATH", ""))
+ local_env["HUGETLB_DEFAULT_PAGE_SIZE"] = repr(pagesize)
++ if isinstance(cmd, types.StringType):
++ cmd = 'obj%d/%s' % (bits, cmd)
++ else:
++ s = 'obj%d/%s' % (bits, cmd[0])
++ cmd = (s,)+(cmd[1:])
+
+ p = subprocess.Popen(cmd, env=local_env, stdout=subprocess.PIPE)
+ try:
+@@ -523,10 +528,11 @@
+ elfshare_test("linkshare")
+ elflink_and_share_test("linkhuge")
+
+- # elflink_rw tests
+- elflink_rw_test("linkhuge_rw")
+- # elflink_rw sharing tests
+- elflink_rw_and_share_test("linkhuge_rw")
++ if 32 in wordsizes:
++ # elflink_rw tests
++ elflink_rw_test("linkhuge_rw")
++ # elflink_rw sharing tests
++ elflink_rw_and_share_test("linkhuge_rw")
+
+ # Accounting bug tests
+ # reset free hpages because sharing will have held some
+@@ -555,7 +561,7 @@
+ """
+ Run the set of stress tests.
+ """
+- iterations = 10 # Number of iterations for looping tests
++ iterations = 10 # Number of iterations for looping tests
+
+ # Don't update NRPAGES every time like above because we want to catch the
+ # failures that happen when the kernel doesn't release all of the huge pages
+@@ -570,7 +576,7 @@
+ (rc, tot_pages) = total_hpages()
+ (rc, size) = hpage_size()
+ sysctls = setup_shm_sysctl(tot_pages * size)
+- threads = 10 # Number of threads for shm-fork
++ threads = 10 # Number of threads for shm-fork
+ # Run shm-fork once using half available hugepages, then once using all
+ # This is to catch off-by-ones or races in the kernel allocated that
+ # can make allocating all hugepages a problem
diff --git a/sys-libs/libhugetlbfs/libhugetlbfs-2.6.ebuild b/sys-libs/libhugetlbfs/libhugetlbfs-2.6.ebuild
index c2e93af3b2de..f2bbe6ca177d 100644
--- a/sys-libs/libhugetlbfs/libhugetlbfs-2.6.ebuild
+++ b/sys-libs/libhugetlbfs/libhugetlbfs-2.6.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.6.ebuild,v 1.2 2009/11/01 01:24:51 mr_bones_ Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/libhugetlbfs/libhugetlbfs-2.6.ebuild,v 1.3 2009/11/04 04:08:48 robbat2 Exp $
EAPI=2
inherit eutils multilib toolchain-funcs
@@ -16,12 +16,9 @@ IUSE=""
DEPEND=""
-# testsuite requires specific kernel options, and LOTS of free memory.
-# with 16GiB of RAM available, I hit swap :-) - robbat2
-RESTRICT=test
-
src_prepare() {
epatch "${FILESDIR}"/${PN}-2.6-noexec-stack.patch
+ epatch "${FILESDIR}"/${PN}-2.6-fixup-testsuite.patch
sed -i \
-e '/^PREFIX/s:/local::' \
-e '1iBUILDTYPE = NATIVEONLY' \
@@ -51,34 +48,104 @@ src_install() {
rm "${D}"/usr/bin/oprofile*
}
+src_test_alloc_one() {
+ hugeadm="$1"
+ sign="$2"
+ pagesize="$3"
+ pagecount="$4"
+ ${hugeadm} \
+ --pool-pages-max ${pagesize}:${sign}${pagecount} \
+ && \
+ ${hugeadm} \
+ --pool-pages-min ${pagesize}:${sign}${pagecount}
+ return $?
+}
+
+# die is NOT allowed in this src_test block after the marked point, so that we
+# can clean up memory allocation. You'll leak at LEAST 64MiB per run otherwise.
src_test() {
- emake tests || die "Failed to build tests"
+ [[ $UID -eq 0 ]] || die "Need FEATURES=-userpriv to run this testsuite"
+ einfo "Building testsuite"
+ emake -j1 tests || die "Failed to build tests"
+
hugeadm='obj/hugeadm'
- ${hugeadm} --create-mounts
- PAGESIZES="$(${hugeadm} --page-sizes-all)"
+ allocated=''
+ rc=0
+ # the testcases need 64MiB per pagesize.
MIN_HUGEPAGE_RAM=$((64*1024*1024))
- ALLOCATED=''
- for p in ${PAGESIZES} ; do
- pagecount=$((${MIN_HUGEPAGE_RAM}/${p}))
- ${hugeadm} \
- --pool-pages-min ${p}:+${pagecount} \
- --pool-pages-max ${p}:+${pagecount} \
- && ALLOCATED="${ALLOCATED} ${p}:${pagecount}" \
- || die "Failed to set pages"
+
+ einfo "Planning allocation"
+ PAGESIZES="$(${hugeadm} --page-sizes-all)"
+
+ # Need to do this before we can create the mountpoints.
+ for pagesize in ${PAGESIZES} ; do
+ # The kernel depends on the location :-(
+ mkdir -p /var/lib/hugetlbfs/pagesize-${pagesize}
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ done
+ addwrite /proc/sys/vm/
+ addwrite /proc/sys/kernel/shmall
+ addwrite /proc/sys/kernel/shmmax
+ addwrite /proc/sys/kernel/shmmni
+
+ einfo "Checking HugeTLB mountpoints"
+ ${hugeadm} --create-mounts || die "Failed to set up hugetlb mountpoints."
+
+ # -----------------------------------------------------
+ # --------- die is unsafe after this point. -----------
+ # -----------------------------------------------------
+
+ einfo "Starting allocation"
+ for pagesize in ${PAGESIZES} ; do
+ pagecount=$((${MIN_HUGEPAGE_RAM}/${pagesize}))
+ einfo " ${pagecount} @ ${pagesize}"
+ addwrite /var/lib/hugetlbfs/pagesize-${pagesize}
+ src_test_alloc_one "$hugeadm" "+" "${pagesize}" "${pagecount}"
+ rc=$?
+ if [[ $rc -eq 0 ]]; then
+ allocated="${allocated} ${pagesize}:${pagecount}"
+ else
+ eerror "Failed to add ${pagecount} pages of size ${pagesize}"
+ fi
done
- cd "${S}"/tests
- TESTOPTS="-t func"
- case $ARCH in
- amd64|ppc64)
- TESTOPTS="${TESTOPTS} -b 64"
- ;;
- x86)
- TESTOPTS="${TESTOPTS} -b 32"
- ;;
- esac
- ./run_tests.py ${TESTOPTS}
- # TODO: undo the allocation here.
- for p in ${ALLOCATED} ; do
- :
+
+ einfo "Allocation status"
+ ${hugeadm} --pool-list
+
+ if [[ -n "${allocated}" ]]; then
+ # All our allocations worked, so time to run.
+ einfo "Starting tests"
+ cd "${S}"/tests
+ TESTOPTS="-t func"
+ case $ARCH in
+ amd64|ppc64)
+ TESTOPTS="${TESTOPTS} -b 64"
+ ;;
+ x86)
+ TESTOPTS="${TESTOPTS} -b 32"
+ ;;
+ esac
+ # This needs a bit of work to give a nice exit code still.
+ ./run_tests.py ${TESTOPTS}
+ rc=$?
+ else
+ eerror "Failed to make HugeTLB allocations."
+ rc=1
+ fi
+
+ einfo "Cleaning up memory"
+ cd "${S}"
+ # Cleanup memory allocation
+ for alloc in ${allocated} ; do
+ pagesize="${alloc/:*}"
+ pagecount="${alloc/*:}"
+ einfo " ${pagecount} @ ${pagesize}"
+ src_test_alloc_one "$hugeadm" "-" "${pagesize}" "${pagecount}"
done
+
+ # ---------------------------------------------------------
+ # --------- die is safe again after this point. -----------
+ # ---------------------------------------------------------
+
+ return $rc
}