aboutsummaryrefslogtreecommitdiff
path: root/testdummy_preinit.sh
blob: 1fc73756a54e057c74f8cff0511aaf458cb35ac8 (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
#!/bin/bash
if [[ $# -ne 2 ]]
then
   echo "Usage: "$0" LOGLEAVES RUNS_TEST"
   exit 1
fi

logleaves=$1
runs_test=$2

echo "Initializing dummy..."
rm files -rf

cp databases/dummy_$logleaves.db csaa.db
chmod 644 csaa.db

./dummy_server $1 csaa.db > /dev/null &

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

pid=$!
sleep .2
./testcreate.sh ./dummy_client $runs_test
./testmodify.sh ./dummy_client $runs_test $start_id
./testretrieve.sh ./dummy_client $runs_test $start_id

kill -SIGINT $!

rm csaa.db