-
Notifications
You must be signed in to change notification settings - Fork 197
/
test_vicc_with_handler_test.sh
executable file
·58 lines (50 loc) · 1.12 KB
/
test_vicc_with_handler_test.sh
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#! /bin/sh
HANDLER_TEST="${HANDLER_TEST:=handler_test}"
if test -z "$VICC"
then
if test -r ../virtualsmartcard/src/vpicc/vicc.in -a -n "`which python`"
then
VICC="python ../virtualsmartcard/src/vpicc/vicc.in"
elif test -x ../virtualsmartcard/src/vpicc/vicc
then
VICC=../virtualsmartcard/src/vpicc/vicc
elif test -n "`which vicc`"
then
VICC=vicc
else
echo "vicc not found"
exit 1
fi
fi
if test -z "$HANDLER_TEST"
then
if test -n "`which handler_test`"
then
HANDLER_TEST=handler_test
else
echo "handler_test not found"
exit 1
fi
fi
for flag in -A -T
do
$VICC --type handler_test --port 35963 --reversed >/dev/null 2>&1 &
VICC_PID=$!
if test $? -ne 0
then
echo "could not start vicc"
exit 1
fi
sleep 1
$HANDLER_TEST \
-l src/vpcd/.libs/libvpcd.so \
-1 -2 -3 -4 $flag \
-d localhost:35963
HANDLER_TEST_RESULT=$?
kill $VICC_PID 2>/dev/null
if test $HANDLER_TEST_RESULT -ne 0
then
echo "could not perform test"
exit 1
fi
done