* tests/test_sha512sum.in: New test.
This commit is contained in:
parent
2a8a75855c
commit
7994a09a9b
3 changed files with 37 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
2013-10-26 BVK Chaitanya <bvk.groups@gmail.com>
|
||||||
|
|
||||||
|
* tests/test_sha512sum.in: New test.
|
||||||
|
|
||||||
2013-10-26 Vladimir Serbinenko <phcoder@gmail.com>
|
2013-10-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* grub-core/fs/iso9660.c: Replace strncat with memcpy.
|
* grub-core/fs/iso9660.c: Replace strncat with memcpy.
|
||||||
|
|
|
@ -857,6 +857,12 @@ script = {
|
||||||
common = tests/grub_script_strcmp.in;
|
common = tests/grub_script_strcmp.in;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
script = {
|
||||||
|
testcase;
|
||||||
|
name = test_sha512sum;
|
||||||
|
common = tests/test_sha512sum.in;
|
||||||
|
};
|
||||||
|
|
||||||
script = {
|
script = {
|
||||||
testcase;
|
testcase;
|
||||||
name = grub_func_test;
|
name = grub_func_test;
|
||||||
|
|
27
tests/test_sha512sum.in
Normal file
27
tests/test_sha512sum.in
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# create a randome file
|
||||||
|
file=`mktemp`
|
||||||
|
cat >$file <<EOF
|
||||||
|
hello world!
|
||||||
|
EOF
|
||||||
|
|
||||||
|
outfile1=`mktemp`
|
||||||
|
@builddir@/grub-shell --files=/boot/grub/file=$file >$outfile1 <<EOF
|
||||||
|
sha512sum /boot/grub/file
|
||||||
|
EOF
|
||||||
|
|
||||||
|
outfile2=`mktemp`
|
||||||
|
sha512sum $file >$outfile2
|
||||||
|
|
||||||
|
SHA1=`cat $outfile1 | tr -d '\n' | cut -f1 -d\ `
|
||||||
|
SHA2=`cat $outfile2 | cut -f1 -d\ `
|
||||||
|
|
||||||
|
if test "$SHA1" = "$SHA2"; then
|
||||||
|
rm -f ${outfile1} ${outfile2}
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo "GRUB sha512sum output did not match sha512sum output."
|
||||||
|
echo "See diff -u ${outfile1} ${outfile2}"
|
||||||
|
exit 1
|
||||||
|
fi
|
Loading…
Reference in a new issue