public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] Is running from a read-only path supported?
@ 2013-04-17 17:23 Ismael Farfán
  2013-04-17 18:09 ` chrubis
  0 siblings, 1 reply; 3+ messages in thread
From: Ismael Farfán @ 2013-04-17 17:23 UTC (permalink / raw)
  To: ltp-list

Hello guys,

First of, thanks for your effort writing all this bunch of tests, It's
really helpful.

We are running LTP to test the correct behavior of a FileSystem
mounted in /mnt, however I installed ltp in /read/only/NFS/export/ltp.

I've already changed ltprun [1] so that it writes the failed log in
TMP (which should point to /mnt) instead of LTPBIN, but there are a
bunch of tests creating files in "." instead of TMPDIR, and for what
I've seen "." is actually LTPBIN for some tests which in our case is
read-only.

Also, I can't pass a base directory to run on to many of the tests,
take [2] as example where I patched it to write to TMPDIR.


Question:
Is running form a read-only path supported?


How can I make it create files only is /mnt instead of random places
trough the LTPDIR and /tmp?


Thanks




[1]

:~/ltp-full-20130109$ git diff runltp
diff --git a/runltp b/runltp
index 04cc690..8819548 100755
--- a/runltp
+++ b/runltp
@@ -740,7 +740,7 @@ main()
     fi

     [ ! -z "$QUIET_MODE" ] && { echo "INFO: Test start time: $(date)" ; }
-    PAN_COMMAND="${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES
$DURATION -a $$ \
+    PAN_COMMAND="${LTPROOT}/bin/ltp-pan $QUIET_MODE -e -S $INSTANCES
$DURATION -a ${TMP}.$$
     -n $$ $PRETTY_PRT -f ${TMP}/alltests $LOGFILE $OUTPUTFILE $FAILCMDFILE"
     echo "COMMAND:    $PAN_COMMAND"
     if [ ! -z "$TAG_RESTRICT_STRING" ] ; then
@@ -833,7 +833,7 @@ main()
        fi
     # Some tests need to run inside the "bin" directory.
     cd "${LTPROOT}/testcases/bin"
-    "${LTPROOT}/bin/ltp-pan" $QUIET_MODE -e -S $INSTANCES $DURATION
-a $$ -n $$ $PRETTY_PRT
+    "${LTPROOT}/bin/ltp-pan" $QUIET_MODE -e -S $INSTANCES $DURATION
-a ${TMP}.$$ -n $$ $PRET

     if [ $? -eq 0 ]; then
       echo "INFO: ltp-pan reported all tests PASS"





[2]

:~/ltp-full-20130109$ git diff testcases/kernel/syscalls/dup/dup07.c
diff --git a/testcases/kernel/syscalls/dup/dup07.c
b/testcases/kernel/syscalls/dup/dup
index c9ddaf0..008e154 100644
--- a/testcases/kernel/syscalls/dup/dup07.c
+++ b/testcases/kernel/syscalls/dup/dup07.c
@@ -48,7 +48,9 @@ int local_flag;
 #define PASSED 1
 #define FAILED 0

-char testfile[40] = "";
+char testfile[240] = "";
+char *tmpdir = NULL;
+

 /*--------------------------------------------------------------------*/
 int main(int ac, char **av)
@@ -63,6 +65,7 @@ int main(int ac, char **av)
        int lc;
        char *msg;

+
        /*
         * parse standard options
         */
@@ -71,11 +74,22 @@ int main(int ac, char **av)
                tst_exit();
        }

+       tmpdir = getenv("TMPDIR");
+       if (tmpdir == NULL){
+               printf("INFO: Couldn't get the environment variable TMPDIR the"
+                       "files will be created in the current directory\n");
+       }
+
        local_flag = PASSED;

        for (lc = 0; TEST_LOOPING(lc); lc++) {

-               sprintf(testfile, "dup07.%d", getpid());
+               if (tmpdir == NULL) {
+                       sprintf(testfile, "dup07.%d", getpid());
+               } else {
+                       sprintf(testfile, "%s/dup07.%d", tmpdir, getpid());
+               }
+
                if ((rdoret = creat(testfile, 0444)) == -1) {
                        tst_resm(TFAIL, "Unable to creat file '%s'", testfile);
                        local_flag = FAILED;



--
Do not let me induce you to satisfy my curiosity, from an expectation,
that I shall gratify yours. What I may judge proper to conceal, does
not concern myself alone.

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] Is running from a read-only path supported?
  2013-04-17 17:23 [LTP] Is running from a read-only path supported? Ismael Farfán
@ 2013-04-17 18:09 ` chrubis
  2013-04-23 14:08   ` chrubis
  0 siblings, 1 reply; 3+ messages in thread
From: chrubis @ 2013-04-17 18:09 UTC (permalink / raw)
  To: Ismael Farf??n; +Cc: ltp-list

Hi!
> First of, thanks for your effort writing all this bunch of tests, It's
> really helpful.
> 
> We are running LTP to test the correct behavior of a FileSystem
> mounted in /mnt, however I installed ltp in /read/only/NFS/export/ltp.
> 
> I've already changed ltprun [1] so that it writes the failed log in
> TMP (which should point to /mnt) instead of LTPBIN, but there are a
> bunch of tests creating files in "." instead of TMPDIR, and for what
> I've seen "." is actually LTPBIN for some tests which in our case is
> read-only.

Such tests are buggy and needs to be fixed.

Just send a patch against latest git with Signed-off-by line and I will
apply it right away.

> Also, I can't pass a base directory to run on to many of the tests,
> take [2] as example where I patched it to write to TMPDIR.

We have a interface that automatically setups temporary directory for
the test. All that is needed is that the test calls tst_tmpdir() at the
start and tst_rmdir() at the end and, if needed, in the cleanup().

See include/test.h for details.

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

* Re: [LTP] Is running from a read-only path supported?
  2013-04-17 18:09 ` chrubis
@ 2013-04-23 14:08   ` chrubis
  0 siblings, 0 replies; 3+ messages in thread
From: chrubis @ 2013-04-23 14:08 UTC (permalink / raw)
  To: Ismael Farf??n; +Cc: ltp-list

Hi!
> > First of, thanks for your effort writing all this bunch of tests, It's
> > really helpful.
> > 
> > We are running LTP to test the correct behavior of a FileSystem
> > mounted in /mnt, however I installed ltp in /read/only/NFS/export/ltp.
> > 
> > I've already changed ltprun [1] so that it writes the failed log in
> > TMP (which should point to /mnt) instead of LTPBIN, but there are a
> > bunch of tests creating files in "." instead of TMPDIR, and for what
> > I've seen "." is actually LTPBIN for some tests which in our case is
> > read-only.
> 
> Such tests are buggy and needs to be fixed.
> 
> Just send a patch against latest git with Signed-off-by line and I will
> apply it right away.
> 
> > Also, I can't pass a base directory to run on to many of the tests,
> > take [2] as example where I patched it to write to TMPDIR.
> 
> We have a interface that automatically setups temporary directory for
> the test. All that is needed is that the test calls tst_tmpdir() at the
> start and tst_rmdir() at the end and, if needed, in the cleanup().
> 
> See include/test.h for details.

Ping. Any work done on this?

-- 
Cyril Hrubis
chrubis@suse.cz

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2013-04-23 14:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17 17:23 [LTP] Is running from a read-only path supported? Ismael Farfán
2013-04-17 18:09 ` chrubis
2013-04-23 14:08   ` chrubis

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