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

View file

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