aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen, Gong <gong.chen@linux.intel.com>2014-04-09 03:00:32 -0400
committerChen, Gong <gong.chen@linux.intel.com>2014-04-09 03:22:20 -0400
commit9ef2993bc14c9417d3cf32659dc1671b2f1a13fb (patch)
treec4b30ce121bd20e37d29bc4352061506ff0a4936
parentdd6081af9e22fd489f24eb3435a56fa4275e60ee (diff)
downloadmce-test-9ef2993bc14c9417d3cf32659dc1671b2f1a13fb.tar.gz
Fix the bugs in hwpoison related test cases
Fix two bugs in two test cases. 1) In the test for disk file soft off-line, it often fails because it is mmaped via shared mode. Now chaning it to private mode to fix wider test environment. 2) in run_soft.sh there is one spell mistake so that some test case will fail. Signed-off-by: Chen, Gong <gong.chen@linux.intel.com>
-rwxr-xr-xcases/function/hwpoison/run_soft.sh2
-rw-r--r--cases/function/hwpoison/tsoftinj.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/cases/function/hwpoison/run_soft.sh b/cases/function/hwpoison/run_soft.sh
index 6d41f4e..d5f2a2b 100755
--- a/cases/function/hwpoison/run_soft.sh
+++ b/cases/function/hwpoison/run_soft.sh
@@ -32,7 +32,7 @@ unmount_hugetlbfs
echo "------------------------------------------------------------------------"
echo "Running random_offline (random soft offline test for 60 seconds)"
-run_test "./random_offline -t 60" sucess
+run_test "./random_offline -t 60" success
free_resources
diff --git a/cases/function/hwpoison/tsoftinj.c b/cases/function/hwpoison/tsoftinj.c
index c2dfc6c..5afb234 100644
--- a/cases/function/hwpoison/tsoftinj.c
+++ b/cases/function/hwpoison/tsoftinj.c
@@ -93,12 +93,12 @@ void disk_backed(char *name, int flags)
{
char fn[100];
snprintf(fn, sizeof fn, TMPDIR "~test%u", getpid());
- printf("shared, diskbacked\n");
+ printf("private, diskbacked\n");
int fd = open(fn, O_RDWR|O_CREAT|O_TRUNC, 0644);
if (fd < 0) err("open tmpfile");
write(fd, empty, sizeof empty);
char *p = checked_mmap(NULL, PS, PROT_READ|PROT_WRITE,
- MAP_SHARED|flags, fd, 0);
+ MAP_PRIVATE|flags, fd, 0);
*(volatile int *)p = 1;
offline(ndesc(fn, "disk backed", name), p);
munmap(p, PS);
@@ -185,7 +185,7 @@ int main(void)
check(&count, "anonymous mlock", 1);
disk_backed("disk backed", 0);
check(&count, "disk backed", 1);
- disk_backed("disk backed mlock", 0);
+ disk_backed("disk backed mlock", MAP_LOCKED);
check(&count, "disk backed mlock", 1);
shm_hugepage("shm hugepage", 0);
check(&count, "shm hugepage", HPS / PS);