Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1503559 > unrolled thread

[PATCH 3/5] selftests: ftrace: Introduce TMPDIR for temporary files

Started byMasami Hiramatsu <mhiramat@kernel.org>
First post2016-10-19 07:00 +0200
Last post2016-10-19 07:00 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/5] selftests: ftrace: Introduce TMPDIR for temporary files Masami Hiramatsu <mhiramat@kernel.org> - 2016-10-19 07:00 +0200

#1503559 — [PATCH 3/5] selftests: ftrace: Introduce TMPDIR for temporary files

FromMasami Hiramatsu <mhiramat@kernel.org>
Date2016-10-19 07:00 +0200
Subject[PATCH 3/5] selftests: ftrace: Introduce TMPDIR for temporary files
Message-ID<stR8R-4sP-9@gated-at.bofh.it>
Introduce TMPDIR variable which is removed after each test
is done, so that the test script can put their temporary
files in that.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
 tools/testing/selftests/ftrace/ftracetest |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 4c6a0bf..172750f 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -236,6 +236,7 @@ __run_test() { # testfile
 run_test() { # testfile
   local testname=`basename $1`
   local testlog=`mktemp $LOG_DIR/${testname}-log.XXXXXX`
+  export TMPDIR=`mktemp -d /tmp/ftracetest-dir.XXXXXX`
   testcase $1
   echo "execute: "$1 > $testlog
   SIG_RESULT=0
@@ -252,6 +253,7 @@ run_test() { # testfile
     catlog $testlog
     TOTAL_RESULT=1
   fi
+  rm -rf $TMPDIR
 }
 
 # load in the helper functions

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web