Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 if [[ ! -w /dev/crypto/nx-gzip ]]; then
0005         echo "Can't access /dev/crypto/nx-gzip, skipping"
0006         echo "skip: $0"
0007         exit 4
0008 fi
0009 
0010 set -e
0011 
0012 function cleanup
0013 {
0014         rm -f nx-tempfile*
0015 }
0016 
0017 trap cleanup EXIT
0018 
0019 function test_sizes
0020 {
0021         local n=$1
0022         local fname="nx-tempfile.$n"
0023 
0024         for size in 4K 64K 1M 64M
0025         do
0026                 echo "Testing $size ($n) ..."
0027                 dd if=/dev/urandom of=$fname bs=$size count=1
0028                 ./gzfht_test $fname
0029                 ./gunz_test ${fname}.nx.gz
0030         done
0031 }
0032 
0033 echo "Doing basic test of different sizes ..."
0034 test_sizes 0
0035 
0036 echo "Running tests in parallel ..."
0037 for i in {1..16}
0038 do
0039         test_sizes $i &
0040 done
0041 
0042 wait
0043 
0044 echo "OK"
0045 
0046 exit 0