Hello,

I recently had the case where a test fails with something like this:
FAIL  :  hugeshmget01 call failed - errno = 38 : Function not implemented
This shows up as I don't use CONFIG_HUGETLBFS in my kernel.

Maybe this has already been discussed but how about including kernel config headers into LTP to avoid such irrelevant report?

Thoughts?


Attached is a small patch I tried in order to turn the FAILURE into N/A.
If the functionality is not present in the kernel, the program simply exits.

Before compiling, one must copy <kernel root>/include/linux/autoconf.h into <ltp root>/include .

The compilation is conditional. At LTP root, issue:
USE_KNL_CONFIG=y make


Gilles.


diff --git a/Makefile b/Makefile
index 6f0e4c1..52b7387 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,10 @@
 # in the commandline and in the Makefiles use a dummy variable like in
 # CFLAGS
 
+ifdef USE_KNL_CONFIG
+export CFLAGS += -DUSE_KNL_CONFIG
+endif
+
 ifdef CROSS_COMPILE
 CROSS_COMPILER = $(CROSS_COMPILE)
 endif
diff --git a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c
index fd08329..ad3382b 100644
--- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c
+++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c
@@ -57,6 +57,9 @@
  *	none
  */
 
+#ifdef USE_KNL_CONFIG
+#include "kernel_autoconf.h"
+#endif
 #include "ipcshm.h"
 
 char *TCID = "hugeshmget01";
@@ -71,6 +74,10 @@ int main(int ac, char **av)
 	char *msg;			/* message returned from parse_opts */
 	struct shmid_ds buf;
 
+#if USE_KNL_CONFIG && ! CONFIG_HUGETLBFS
+	tst_exit(TCONF);
+#endif
+
 	/* parse standard options */
 	if ((msg = parse_opts(ac, av, (option_t *)NULL, NULL)) != (char *)NULL){
 		tst_brkm(TBROK, cleanup, "OPTION PARSING ERROR - %s", msg);
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to