]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - tools/tools/crypto/cryptorun.sh
Merge bmake-20201117
[FreeBSD/FreeBSD.git] / tools / tools / crypto / cryptorun.sh
1 #!/bin/sh
2 #
3 # A simple test runner for cryptotest
4 #
5 # Althought cryptotest itself has a -z mode to test all algorithms at
6 # a variety of sizes, this script allows us to be more selective.
7 # Threads and buffer sizes move in powers of two from 1, for threads,
8 # and 256 for buffer sizes.
9 #
10 # e.g.  cryptorun.sh aes 4 512
11 #
12 # Test aes with 1, 2 and 4 processes, and at sizes of 256 and 512 bytes.
13 #
14 # $FreeBSD$
15 #
16
17 threads=1
18 size=256
19 iterations=1000000
20 crypto="/tank/users/gnn/Repos/svn/FreeBSD.HEAD/tools/tools/crypto/cryptotest"
21 max_threads=$2
22 max_size=$3 
23
24 while [ "$threads" -le "$max_threads" ]; do
25         echo "Testing with $threads processes."
26         while [ "$size" -le "$max_size" ]; do
27                 $crypto -t $threads -a $1 $iterations $size
28                 size=$(($size * 2))
29         done
30         size=256
31         threads=$(($threads * 2))
32 done