diff options
author | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> | 2013-12-18 03:24:14 -0500 |
---|---|---|
committer | Chen, Gong <gong.chen@linux.intel.com> | 2015-01-21 21:24:00 -0500 |
commit | 87b2683b0f8460003d07941c004530e226834d69 (patch) | |
tree | 653624875d811de18f8b0319d4516ba717299004 | |
parent | 564197d3bea7aa5f9748791fb37d640ac35a84b0 (diff) | |
download | mce-test-87b2683b0f8460003d07941c004530e226834d69.tar.gz |
Add hwpoison-inject load check
Add load checker of hwpoison-inject module for test case
run_hugepage_overcommit.sh.
NOTE: Gong revisits this patch a little bit.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Signed-off-by: Chen, Gong <gong.chen@linux.intel.com>
-rw-r--r-- | cases/function/hwpoison/helpers.sh | 16 | ||||
-rwxr-xr-x | cases/function/hwpoison/run_hugepage_overcommit.sh | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/cases/function/hwpoison/helpers.sh b/cases/function/hwpoison/helpers.sh index b9ddcbe..1c41912 100644 --- a/cases/function/hwpoison/helpers.sh +++ b/cases/function/hwpoison/helpers.sh @@ -3,6 +3,7 @@ export ROOT=`(cd ../../../; pwd)` . $ROOT/lib/functions.sh setup_path +. $ROOT/lib/mce.sh TMP="../../../work" TMP_DIR=${TMP_DIR:-$TMP} @@ -74,3 +75,18 @@ unmount_hugetlbfs() { done umount $HT } + +load_hwpoison_inject() { + local path + + check_debugfs + path=`cat /proc/mounts | grep debugfs | cut -d ' ' -f2 | head -1`/hwpoison + if [ ! -d $path ] ; then + modprobe hwpoison-inject + if [ $? -ne 0 ] ; then + die "Failed to load hwpoison-inject module. Abort." + else + echo "hwpoison-inject module is loaded." + fi + fi +} diff --git a/cases/function/hwpoison/run_hugepage_overcommit.sh b/cases/function/hwpoison/run_hugepage_overcommit.sh index 51f393e..f01c219 100755 --- a/cases/function/hwpoison/run_hugepage_overcommit.sh +++ b/cases/function/hwpoison/run_hugepage_overcommit.sh @@ -4,6 +4,8 @@ pushd `dirname $0` > /dev/null . ./helpers.sh +load_hwpoison_inject + # make sure we have no hwpoisoned hugepage before starting this test. free_resources > /dev/null |