* [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
* [LTP] [PATCH] mtest05/mmstress: Fix failure on read-only system
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
1 sibling, 0 replies; 4+ messages in thread
From: Hoang Nguyen @ 2017-03-22 3:07 UTC (permalink / raw)
To: ltp
Hi,
Could you help to check, so that we can close the Issue ?
Thanks and regards
Hoang
Sent from Yahoo Mail on Android
On Fri, Mar 10, 2017 at 7:48, the_hoang0709@yahoo.com<the_hoang0709@yahoo.com> wrote: 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20170322/3dff5a53/attachment.html>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [LTP] [PATCH] mtest05/mmstress: Fix failure on read-only system
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
1 sibling, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2017-03-22 16:47 UTC (permalink / raw)
To: ltp
Hi!
This was broken for when the test was passed the -t option since in that
case the alarm called exit(). Well the -t option was broken anyway,
since it did exit(0) regardless of the result of the test functions.
So I've cleaned up the test a bit so that SIGALRM only sets a flag that
causes the main loop to exit and also to call tst_exit() properly and
then added the tst_tmpdir() and tst_rmdir() calls.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 4+ messages in thread
* [LTP] [PATCH] mtest05/mmstress: Fix failure on read-only system
2017-03-22 16:47 ` Cyril Hrubis
@ 2017-03-27 8:02 ` Hoang Nguyen
0 siblings, 0 replies; 4+ messages in thread
From: Hoang Nguyen @ 2017-03-27 8:02 UTC (permalink / raw)
To: ltp
Hi,
Thanks Cyril. I can see it passed on my board.
Thanks a lot for your help.
Best regards,
Hoang
Sent from Yahoo Mail on Android
On Wed, Mar 22, 2017 at 23:50, Cyril Hrubis<chrubis@suse.cz> wrote: Hi!
This was broken for when the test was passed the -t option since in that
case the alarm called exit(). Well the -t option was broken anyway,
since it did exit(0) regardless of the result of the test functions.
So I've cleaned up the test a bit so that SIGALRM only sets a flag that
causes the main loop to exit and also to call tst_exit() properly and
then added the tst_tmpdir() and tst_rmdir() calls.
--
Cyril Hrubis
chrubis@suse.cz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20170327/2d059a84/attachment.html>
^ permalink raw reply [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