linux/tools/testing/selftests/powerpc/nx-gzip/nx-gzip-test.sh
<<
>>
Prefs
   1#!/bin/bash
   2# SPDX-License-Identifier: GPL-2.0-or-later
   3
   4if [[ ! -w /dev/crypto/nx-gzip ]]; then
   5        echo "Can't access /dev/crypto/nx-gzip, skipping"
   6        echo "skip: $0"
   7        exit 4
   8fi
   9
  10set -e
  11
  12function cleanup
  13{
  14        rm -f nx-tempfile*
  15}
  16
  17trap cleanup EXIT
  18
  19function test_sizes
  20{
  21        local n=$1
  22        local fname="nx-tempfile.$n"
  23
  24        for size in 4K 64K 1M 64M
  25        do
  26                echo "Testing $size ($n) ..."
  27                dd if=/dev/urandom of=$fname bs=$size count=1
  28                ./gzfht_test $fname
  29                ./gunz_test ${fname}.nx.gz
  30        done
  31}
  32
  33echo "Doing basic test of different sizes ..."
  34test_sizes 0
  35
  36echo "Running tests in parallel ..."
  37for i in {1..16}
  38do
  39        test_sizes $i &
  40done
  41
  42wait
  43
  44echo "OK"
  45
  46exit 0
  47