getrusage03: skip on small RAM system
It is easy to get VmSwap increase with a small system, here is
run with a 1G RAM kvm guest and TBROK:
7 tst_test.c:1365: TINFO: Timeout per run is 0h 05m 00s
8 getrusage03.c:43: TPASS: initial.self ~= child.self
9 getrusage03.c:57: TPASS: initial.children ~= 100MB
10 getrusage03.c:66: TPASS: child.children == 0
11 getrusage03.c:84: TPASS: child.children ~= 300MB
12 getrusage03.c:104: TPASS: initial.children ~= pre_wait.children
13 getrusage03.c:112: TPASS: post_wait.children ~= 400MB
14 getrusage03.h:25: TBROK: VmSwap is not zero
15 getrusage03.c:133: TPASS: initial.children ~= after_zombie.children
16 getrusage03.h:25: TBROK: VmSwap is not zero
17 getrusage03_child.c:57: TPASS: initial.self ~= exec.self
18 getrusage03_child.c:62: TPASS: initial.children ~= exec.children
Signed-off-by: Li Wang <liwang@redhat.com>
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Acked-by: Jan Stancek <jstancek@redhat.com>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/testcases/kernel/syscalls/getrusage/getrusage03.c b/testcases/kernel/syscalls/getrusage/getrusage03.c
index bf51274..201d258 100644
--- a/testcases/kernel/syscalls/getrusage/getrusage03.c
+++ b/testcases/kernel/syscalls/getrusage/getrusage03.c
@@ -173,6 +173,14 @@
}
}
+static void setup(void)
+{
+ long long mem_avail = tst_available_mem();
+
+ if (mem_avail < 512L*1024)
+ tst_brk(TCONF, "Needed > 512MB available, only have: %ld kB", mem_avail);
+}
+
static struct tst_test test = {
.forks_child = 1,
.child_needs_reinit = 1,
@@ -182,6 +190,7 @@
{"linux-git", "1f10206cf8e9"},
{}
},
+ .setup = setup,
.test = run,
.tcnt = ARRAY_SIZE(testfunc_list),
};