Revise: add manifest file for SMACK label setting. And add process start/end log.
[profile/ivi/ico-uxf-device-input-controller.git] / tests / input-controller-test.G25
1 #!/bin/sh
2 #
3 #       Device Input Controller Test for G25 steering switch
4 #
5 #         Remark: This examination premises that Weston does not run.
6
7 # 1 Delete log file
8 mkdir ../tests/testlog 2> /dev/null
9 rm -fr ../tests/testlog/* 2> /dev/null
10
11 # 2 set weston environment
12 export XDG_RUNTIME_DIR=/run/user/5000
13 export XDG_CONFIG_HOME="../tests"
14
15 # 3 Start Device Input Controllers
16 export DIC_GTFORCE_CONF="./testdata/drivingforcegt.conf"
17 ../gtforce/ico_dic-gtforce -Dstdout -L > ../tests/testlog/gtforce.log 2>&1 &
18 sleep 0.5
19
20 # 4 Start Weston
21 /usr/bin/weston --tty=2 --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log &
22 sleep 180
23
24 # 5 End of Test
25 sleep 1
26 /usr/bin/killall ico_dic-gtforce
27 sleep 0.4
28 /usr/bin/killall -9 ico_dic-gtforce > /dev/nul 2>&1
29 sleep 0.1
30 /usr/bin/killall weston
31 sleep 1
32
33 # 9 Check Error
34 FOUND_ERR=0
35 /bin/grep "ERR>" testlog/*
36 if [ "$?" != "1" ] ; then
37         FOUND_ERR=1
38 fi
39 /bin/grep "WRN>" testlog/*
40 if [ "$?" != "1" ] ; then
41         FOUND_ERR=1
42 fi
43 /bin/grep "Error" testlog/*
44 if [ "$?" != "1" ] ; then
45         FOUND_ERR=1
46 fi
47 /bin/grep "error" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "failed to restore kb mode:" | /bin/grep -v "failed to set KD_TEXT mode on tty:"
48 if [ "$?" != "1" ] ; then
49     FOUND_ERR=1
50 fi
51 /bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" | /bin/grep -v "disconnect"
52 if [ "$?" != "1" ] ; then
53         FOUND_ERR=1
54 fi
55
56 if [ $FOUND_ERR = 0 ] ; then
57         echo "Device Input Controller Test: OK"
58 else
59         echo "Device Input Controller Test: ERROR"
60 fi
61