[lkml]   [2019]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[BUGFIX PATCH] selftests: Use real temporary working directory for archiving
Use real temporary working directory for generating kselftest

tools/testing/selftests/kselftest directory has been used for
the temporary working directory for making a tar archive from, and it removes the directory for cleanup.

However, since the kselftest directory became a part of the
repository, it must not be used as a working dir.

Introduce mktemp to prepare a temporary working directory
for archiving kselftests.

Signed-off-by: Masami Hiramatsu <>
tools/testing/selftests/ | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/testing/selftests/ b/tools/testing/selftests/
index a27e2eec3586..eba1e9987ffc 100755
--- a/tools/testing/selftests/
+++ b/tools/testing/selftests/
@@ -38,16 +38,16 @@ main()

- install_dir=./kselftest
+ tmpdir=`mktemp -d ./install-XXXXXX` || exit 1

# Run install using INSTALL_KSFT_PATH override to generate install
# directory
-tar $copts kselftest${ext} $install_dir
+./ $tmpdir
+tar $copts kselftest${ext} -C $tmpdir kselftest
echo "Kselftest archive kselftest${ext} created!"

# clean up install directory
-rm -rf kselftest
+rm -rf $tmpdir

main "$@"
 \ /
  Last update: 2019-10-04 07:15    [W:0.174 / U:0.704 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site