2014-10-30 20:59:37 +08:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Test that the brotli command-line tool can decompress old brotli-compressed
|
|
|
|
# files.
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
|
2016-06-24 21:32:51 +08:00
|
|
|
BRO=bin/bro
|
|
|
|
TMP_DIR=bin/tmp
|
2014-10-30 20:59:37 +08:00
|
|
|
|
2016-06-24 21:32:51 +08:00
|
|
|
for file in tests/testdata/*.compressed*; do
|
2014-10-30 20:59:37 +08:00
|
|
|
echo "Testing decompression of file $file"
|
2015-05-08 02:43:01 +08:00
|
|
|
expected=${file%.compressed*}
|
2016-06-24 21:32:51 +08:00
|
|
|
uncompressed=${TMP_DIR}/${expected##*/}.uncompressed
|
|
|
|
echo $uncompressed
|
2014-10-30 20:59:37 +08:00
|
|
|
$BRO -f -d -i $file -o $uncompressed
|
|
|
|
diff -q $uncompressed $expected
|
2014-11-17 22:31:00 +08:00
|
|
|
# Test the streaming version
|
|
|
|
cat $file | $BRO -d > $uncompressed
|
|
|
|
diff -q $uncompressed $expected
|
2015-05-08 02:43:01 +08:00
|
|
|
rm -f $uncompressed
|
2014-10-30 20:59:37 +08:00
|
|
|
done
|