public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP]  [PATCH] mtest05/mmstress: Fix failure on read-only system
@ 2017-03-10  0:48 the_hoang0709
  2017-03-22  3:07 ` Hoang Nguyen
  2017-03-22 16:47 ` Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: the_hoang0709 @ 2017-03-10  0:48 UTC (permalink / raw)
  To: ltp

From: Hoang Nguyen <the_hoang0709@yahoo.com>

In order not to fail the test on read-only system, we used tst_tmpdir to
create temporary folder to run the test. Then remove it with tst_rmdir
after test finished (or test failed at the middle).

Fixes #87.

Signed-off-by: Hoang Nguyen <the_hoang0709@yahoo.com>
---
 testcases/kernel/mem/mtest05/mmstress.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/testcases/kernel/mem/mtest05/mmstress.c b/testcases/kernel/mem/mtest05/mmstress.c
index 0240a83..cbbc181 100644
--- a/testcases/kernel/mem/mtest05/mmstress.c
+++ b/testcases/kernel/mem/mtest05/mmstress.c
@@ -832,6 +832,7 @@ int main(int argc,		/* number of command line parameters                     */
 	optarg = NULL;
 	opterr = 0;
 
+	tst_tmpdir();
 	if (argc < 2)
 		tst_resm(TINFO, "run %s -h for all options", argv[0]);
 
@@ -937,6 +938,7 @@ int main(int argc,		/* number of command line parameters                     */
 
 		if (global_rc != SUCCESS) {
 			tst_resm(TFAIL, "Test Failed");
+			tst_rmdir();
 			exit(global_rc);
 		}
 
@@ -947,5 +949,6 @@ int main(int argc,		/* number of command line parameters                     */
 	} else {
 		tst_resm(TPASS, "Test Passed");
 	}
+	tst_rmdir();
 	exit(global_rc);
 }
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-27  8:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-10  0:48 [LTP] [PATCH] mtest05/mmstress: Fix failure on read-only system the_hoang0709
2017-03-22  3:07 ` Hoang Nguyen
2017-03-22 16:47 ` Cyril Hrubis
2017-03-27  8:02   ` Hoang Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox