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


Groups > linux.kernel > #1523287

[PATCH -tip v3 7/9] selftests: ftrace: Introduce TMPDIR for temporary files

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject [PATCH -tip v3 7/9] selftests: ftrace: Introduce TMPDIR for temporary files
Date 2016-11-16 09:20 +0100
Message-ID <sE3BM-jF-29@gated-at.bofh.it> (permalink)
References <sE3BL-jF-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 d08235f..685376b4 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -242,6 +242,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
@@ -258,6 +259,7 @@ run_test() { # testfile
     [ $BE_QUIET -eq 0 ] && catlog $testlog
     TOTAL_RESULT=1
   fi
+  rm -rf $TMPDIR
 }
 
 # load in the helper functions

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH -tip v3 0/9] ftrace: selftests: Add full glob matching and update ftracetest Masami Hiramatsu <mhiramat@kernel.org> - 2016-11-16 09:20 +0100
  [PATCH -tip v3 9/9] selftests: ftrace: Add a testcase for types of kprobe event Masami Hiramatsu <mhiramat@kernel.org> - 2016-11-16 09:20 +0100
  [PATCH -tip v3 4/9] selftests: ftrace: Check whether snapshot trigger is supported correctly Masami Hiramatsu <mhiramat@kernel.org> - 2016-11-16 09:20 +0100
  [PATCH -tip v3 2/9] selftests: ftrace: Initialize ftrace before each test Masami Hiramatsu <mhiramat@kernel.org> - 2016-11-16 09:20 +0100
  [PATCH -tip v3 5/9] selftests: ftrace: Fix trigger-mod to run without syscall trace Masami Hiramatsu <mhiramat@kernel.org> - 2016-11-16 09:20 +0100
  [PATCH -tip v3 8/9] selftests: ftrace: Add a testcase for function filter glob match Masami Hiramatsu <mhiramat@kernel.org> - 2016-11-16 09:20 +0100
  [PATCH -tip v3 7/9] selftests: ftrace: Introduce TMPDIR for temporary files Masami Hiramatsu <mhiramat@kernel.org> - 2016-11-16 09:20 +0100

csiph-web