test: consistently use TMPDIR and same name pattern for temp files

This commit is contained in:
Andrei Borzenkov 2015-01-30 20:31:20 +03:00
parent 958167b91c
commit f153fcb5a5
1 changed files with 3 additions and 3 deletions

View 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\ `