]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
test: consistently use TMPDIR and same name pattern for temp files
authorAndrei Borzenkov <arvidjaar@gmail.com>
Fri, 30 Jan 2015 17:31:20 +0000 (20:31 +0300)
committerAndrei Borzenkov <arvidjaar@gmail.com>
Fri, 30 Jan 2015 17:31:20 +0000 (20:31 +0300)
tests/test_sha512sum.in

index 524c1d1c0376f69eb5212945409dda370dc09bd0..d5ef7f9ea62d1c9749c6a134580dace95fa7624a 100644 (file)
@@ -1,7 +1,7 @@
 #! /bin/bash
 
 # create a randome file
-file=`mktemp`
+file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
 cat >$file <<EOF
 hello world!
 EOF
@@ -15,12 +15,12 @@ else
 fi
 
 
-outfile1=`mktemp`
+outfile1="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
 @builddir@/grub-shell --files=/boot/grub/file=$file >$outfile1 <<EOF
 sha512sum $grub_file
 EOF
 
-outfile2=`mktemp`
+outfile2="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
 sha512sum $file >$outfile2
 
 SHA1=`cat $outfile1 | tr -d '\n' | cut -f1 -d\ `