numa_helper: add flag and min_nodes parameters to is_numa()

get_allowed_nodes() can fail if callers request more nodes than
are available. This patch changes is_numa() by adding a parameters
to it, which allows to easily check that system supports NUMA and
has at least certain number of nodes and it also updates tests
that used get_allowed_nodes() without checking node count first.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/testcases/kernel/mem/oom/oom02.c b/testcases/kernel/mem/oom/oom02.c
index 48bd0a3..8bbb18a 100644
--- a/testcases/kernel/mem/oom/oom02.c
+++ b/testcases/kernel/mem/oom/oom02.c
@@ -79,7 +79,7 @@
 	tst_sig(FORK, DEF_HANDLER, cleanup);
 	TEST_PAUSE;
 
-	if (!is_numa(NULL))
+	if (!is_numa(NULL, NH_MEMS, 2))
 		tst_brkm(TCONF, NULL, "The case need a NUMA system.");
 
 	overcommit = get_sys_tune("overcommit_memory");