6 SERVER="http://localhost:$PORT"
9 CFLAG="-dir=$CSTORE -server=$SERVER"
10 SFLAG="-dir=$SSTORE -addr=:$PORT"
13 echo epoint-client $CFLAG "$@" 1>&2
14 epoint-client $CFLAG "$@"
18 # send [key|draft|cert] path
20 curl --data-urlencode $1@$2 $SERVER/submit
28 rm -rf $CSTORE $SSTORE
30 epoint-server $SFLAG 2> server.log &
38 IFPR=$(echo isecret | client i unit | client v | awk '/^Id:/ {print $2}')
41 HFPR=$(echo hsecret | client h $IFPR | client v | awk '/^Id:/ {print $2}')
44 echo isecret | client i '' | client s k
45 echo hsecret | client h $IFPR | client s k
47 # make draft: issuer->holder 10
48 echo isecret | client d $HFPR 10 | client s d | client s c | client v | awk '/^Balance:/ {if ($2 != 10) exit 1}'
49 # make draft: holder->issuer 3
50 echo hsecret | client d $IFPR 3 | client s d | client s c | client v | awk '/^Balance:/ {if ($2 != -7) exit 1}'
53 query certby/key.issuer/$IFPR.$IFPR | client v | awk '/^Balance:/ {if ($2 != -7) exit 1}'
54 query certby/key.issuer/$HFPR.$IFPR | client v | awk '/^Balance:/ {if ($2 != 7) exit 1}'
56 kill $(cat server.pid)
58 echo server is killed 1>&2