File: testcrypt

package info (click to toggle)
rsyncrypto 1.12-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 1,312 kB
  • ctags: 576
  • sloc: sh: 3,958; cpp: 3,253; makefile: 70
file content (24 lines) | stat: -rwxr-xr-x 477 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

rm tests/A
rm tests/A.key

times=$1
fail=0
ulimit -c unlimited

while [ $times -ne 0 -a $fail -eq 0 ]
do
    dd if=/dev/urandom count=$2 bs=1 >> tests/A 2>/dev/null
    times=$((times-1))
#rm tests/A.*
    ./rsyncrypto tests/A tests/A.enc tests/A.key tests/cert.crt
    ./rsyncrypto -d tests/A.dec tests/A.enc tests/A.key tests/cert.crt
    diff tests/A tests/A.dec
    fail=$?
done

if [ $fail -ne 0 ]
then
    echo "Test failed on length $(( ($1-$times)*$2 ))"
fi