On 02.03.2007 [17:14:14 -0800], Nishanth Aravamudan wrote:
<snip>
> Independent of this patch, I'm starting to feel like we could maybe do a
> better job of abstracting out the arch-specific bits of the library
> (including some tests which only really have meaning (or even run!) on
> power, for instance). Would people be opposed to perhaps a little bit of
> a reorg, where we have arch-specific hooks for some things, which maybe
> default defined to no-ops. And then a bit of a reoorg of run_tests.sh to
> have a base set of tests run on all archs, and then add to those, the
> arch-specific tests?
So, one approach in what I mean would be the following:
run_tests.sh: run only arch-appropriate tests
Group the tests in run_tests.sh so that only test which have
significance for the architecture (specified by ARCH, so as to be
overridable at the command-line) are run. Uses bash arrays to store the
pools of valid tests. This does result in the order of test execution
changing, so may be it's not worth it, I'm honestly not sure. I do find
it useful to see which tests were skipped (all of them) at the bottom.
Signed-off-by: Nishanth Aravamudan <[EMAIL PROTECTED]>
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 6b6f1bb..bed3714 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -7,6 +7,8 @@ unset HUGETLB_MORECORE
ENV=/usr/bin/env
+[[ -z "${ARCH}" ]] && ARCH=`uname -m`
+
function free_hpages() {
H=$(grep 'HugePages_Free:' /proc/meminfo | cut -f2 -d:)
[ -z "$H" ] && H=0
@@ -126,61 +128,87 @@ restore_shm_sysctl() {
functional_tests () {
# Kernel background tests not requiring hugepage support
- run_test zero_filesize_segment
+ FUNC_TESTS+=(zero_filesize_segment)
# Library background tests not requiring hugepage support
- run_test test_root
- run_test meminfo_nohuge
+ FUNC_TESTS+=(test_root meminfo_nohuge)
# Library tests requiring kernel hugepage support
- run_test gethugepagesize
- run_test HUGETLB_VERBOSE=1 empty_mounts
+ FUNC_TESTS+=(gethugepagesize "HUGETLB_VERBOSE=1 empty_mounts")
# Tests requiring an active and usable hugepage mount
- run_test find_path
- run_test unlinked_fd
- run_test readback
- run_test truncate
- run_test shared
- run_test mprotect
- run_test mlock
+ FUNC_TESTS+=(find_path unlinked_fd readback truncate shared mprotect mlock)
# Specific kernel bug tests
- run_test ptrace-write-hugepage
- run_test icache-hygeine
- run_test slbpacaflush
- run_test_bits 64 straddle_4GB
- run_test_bits 64 huge_at_4GB_normal_below
- run_test_bits 64 huge_below_4GB_normal_above
- run_test map_high_truncate_2
- run_test misaligned_offset
- run_test truncate_above_4GB
- run_test brk_near_huge
- run_test task-size-overrun
- skip_test stack_grow_into_huge
+ FUNC_TESTS+=(ptrace-write-hugepage)
+ case "${ARCH}" in
+ "ppc"|"i386"|"i686")
+ FUNC_TESTS+=(map_high_truncate_2 misaligned_offset
truncate_above_4GB)
+ SKIP_TESTS+=(icache-hygience slbpacaflush straddle_4GB
huge_at_4GB_normal_below huge_below_4GB_normal_above)
+ ;;
+ "ppc64")
+ FUNC_TESTS+=(icache-hygeine slbpacaflush)
+ FUNC_TESTS_BITS_64+=(straddle_4GB huge_at_4GB_normal_below
huge_below_4GB_normal_above)
+ ;;
+ "x86_64")
+ FUNC_TESTS_BITS_64+=(straddle_4GB huge_at_4GB_normal_below
huge_below_4GB_normal_above)
+ SKIP_TESTS+=(icache-hygience slbpacaflush)
+ ;;
+ esac
+
+ FUNC_TESTS+=(brk_near_huge task-size-overrun)
+ SKIP_TESTS+=(stack_grow_into_huge)
# Tests requiring an active mount and hugepage COW
- run_test private
- run_test direct
- run_test malloc
- preload_test HUGETLB_MORECORE=yes malloc
- run_test malloc_manysmall
- preload_test HUGETLB_MORECORE=yes malloc_manysmall
- elflink_test HUGETLB_VERBOSE=0 linkhuge_nofd # Lib error msgs expected
- elflink_test linkhuge
-
-# Sharing tests
- elfshare_test linkshare
- elflink_and_share_test linkhuge
+ FUNC_TESTS+=(private direct)
+ case "${ARCH}" in
+ "ppc"|"ppc64"|"x86_64"|"i386"|"i686")
+ FUNC_TESTS+=(malloc malloc_manysmall)
+ PRELOAD_TESTS+=(malloc malloc_manysmall)
+ # lib error messages expected for the first
+ ELFLINK_VERBOSE_0_TESTS=(linkhuge_nofd)
+ ELFLINK_TESTS+=(linkhuge)
+ # sharing tests
+ ELFSHARE_TESTS+=(linkshare)
+ ELFLINK_AND_SHARE_TESTS+=(linkhuge)
+ ;;
+ *)
+ SKIP_TESTS+=(malloc malloc_manysmall linkhuge linkshare)
+ ;;
+ esac
# Accounting bug tests
# reset free hpages because sharing will have held some
-# alternatively, use
- run_test chunk-overcommit `free_hpages`
- run_test alloc-instantiate-race `free_hpages` shared
- run_test alloc-instantiate-race `free_hpages` private
- run_test truncate_reserve_wraparound
- run_test truncate_sigbus_versus_oom `free_hpages`
+ FUNC_TESTS+=("chunk-overcommit `free_hpages`")
+ FUNC_TESTS+=("alloc-instantiate-race `free_hpages` shared")
+ FUNC_TESTS+=("alloc-instantiate-race `free_hpages` private")
+ FUNC_TESTS+=("truncate_reserve_wraparound")
+ FUNC_TESTS+=("truncate_sigbus_versus_oom `free_hpages`")
+
+ for func_test in "[EMAIL PROTECTED]"; do
+ run_test ${func_test}
+ done
+ TESTS="[EMAIL PROTECTED]" && [[ -n ${TESTS} ]] && for func_test in
${TESTS}; do
+ run_test_bits 64 ${func_test}
+ done
+ TESTS="[EMAIL PROTECTED]" && [[ -n ${TESTS} ]] && for func_test in
${TESTS}; do
+ preload_test ${func_test}
+ done
+ TESTS="[EMAIL PROTECTED]" && [[ -n ${TESTS} ]] && for func_test in
${TESTS}; do
+ elflink_test HUGETLB_VERBOSE=0 ${func_test}
+ done
+ TESTS="[EMAIL PROTECTED]" && [[ -n ${TESTS} ]] && for func_test in
${TESTS}; do
+ elflink_test ${func_test}
+ done
+ TESTS="[EMAIL PROTECTED]" && [[ -n ${TESTS} ]] && for func_test in
${TESTS}; do
+ elfshare_test ${func_test}
+ done
+ TESTS="[EMAIL PROTECTED]" && [[ -n ${TESTS} ]] && for func_test in
${TESTS}; do
+ elflink_and_share_test ${func_test}
+ done
+ TESTS="[EMAIL PROTECTED]" && [[ -n ${TESTS} ]] && for func_test in
${TESTS}; do
+ skip_test ${func_test}
+ done
}
stress_tests () {
--
Nishanth Aravamudan <[EMAIL PROTECTED]>
IBM Linux Technology Center
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Libhugetlbfs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel