Skip to contentSkip to conversation

KSM test case fixes - ksm01

PATCH Superseded Nageswara R Sastry 2 participants 2 messages Sep 5, 2011 – Sep 6, 2011

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 KSM test case fixes - ksm01

While setting up the environment, checking whether ksm related directory exists in sysfs or not.

ksm01, ksm01_1:
Before patch:
...

ksm01       0  TINFO  :  KSM merging...
ksm01       1  TBROK  :  open: errno=ENOENT(2): No such file or directory
ksm01       2  TBROK  :  Remaining cases broken

...

After patch:
...

ksm01       1  TCONF  :  KSM configuration is not enabled
ksm01       2  TCONF  :  Remaining cases not appropriate for configuration

...

Signature · 2 lines
Regards
R.Nageswara Sastry
testcases/kernel/mem/ksm/ksm01.c +6 -0
@@ -109,6 +109,12 @@ void setup(void)
 
 	tst_sig(FORK, DEF_HANDLER, NULL);
 	TEST_PAUSE;
+
+	char *fname = "/sys/kernel/mm/ksm/";
+
+        if( access( fname, F_OK ) == -1 ) {
+                tst_brkm(TCONF, NULL, "KSM configuration is not enabled");
+        }
 }
 
 void cleanup(void)

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

testcases/kernel/mem/ksm/ksm01.c void setup(void) · line 118

Quoted 7 lines · Nageswara R Sastry
testcases/kernel/mem/ksm/ksm01.c +6 -0
+
+	char *fname = "/sys/kernel/mm/ksm/";
+
+        if( access( fname, F_OK ) == -1 ) {
+                tst_brkm(TCONF, NULL, "KSM configuration is not enabled");
+        }
  }

Hi, thanks for the patch. However, there is already a macro defined in include/mem.h:

#define PATH_KSM "/sys/kernel/mm/ksm/"

And I think the braces are not necessary here?

Thanks,
Caspar

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE! Finally, a world-class log management solution at an even better price-free! And you'll get a free "Love Thy Logs" t-shirt when you download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list