47 lines · bash
1#!/bin/bash2# SPDX-License-Identifier: GPL-2.0-or-later3 4if [[ ! -w /dev/crypto/nx-gzip ]]; then5 echo "Can't access /dev/crypto/nx-gzip, skipping"6 echo "skip: $0"7 exit 48fi9 10set -e11 12function cleanup13{14 rm -f nx-tempfile*15}16 17trap cleanup EXIT18 19function test_sizes20{21 local n=$122 local fname="nx-tempfile.$n"23 24 for size in 4K 64K 1M 64M25 do26 echo "Testing $size ($n) ..."27 dd if=/dev/urandom of=$fname bs=$size count=128 ./gzfht_test $fname29 ./gunz_test ${fname}.nx.gz30 done31}32 33echo "Doing basic test of different sizes ..."34test_sizes 035 36echo "Running tests in parallel ..."37for i in {1..16}38do39 test_sizes $i &40done41 42wait43 44echo "OK"45 46exit 047