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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to