aboutsummaryrefslogtreecommitdiff
path: root/testall_preinit.sh
blob: e2cba4d3d6a26b41f3590c787cc21e0315b689e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
if [[ $# -ne 2 ]]
then
   echo "Usage: "$0" LOGLEAVES RUNS_TEST"
   exit 1
fi

logleaves=$1
runs_test=$2

echo "Initializing..."
rm files csaa.db module_state -rf

cp databases/csaa_$logleaves.db csaa.db
cp databases/state_$logleaves module_state

chmod 644 csaa.db module_state

start_id=$(echo "2^$1 - $runs_test + 1" | bc)

./server $1 csaa.db > /dev/null &
pid=$!
sleep .2
./testcreate.sh ./client $runs_test
./testmodify.sh ./client $runs_test $start_id
./testretrieve.sh ./client $runs_test $start_id
./testmodifyenc.sh ./client $runs_test $start_id

echo "Encrypted retrieve: "
./testretrieve.sh ./client $runs_test $start_id

kill -SIGINT $!
rm csaa.db module_state