summaryrefslogtreecommitdiff
path: root/tests/input-controller-test
blob: 08e786761daa6a78fd9e61acc3745ad394e8618c (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
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
59
60
61
#!/bin/sh
#
#	Device Input Controller Test for G27 steering switch
#
#	  Remark: This examination premises that Weston does not run.

# 1 Delete log file
mkdir ../tests/testlog 2> /dev/null
rm -fr ../tests/testlog/* 2> /dev/null

# 2 set weston environment
export XDG_RUNTIME_DIR=/run/user/5000
export XDG_CONFIG_HOME="../tests"

# 3 Start Device Input Controllers
export DIC_GTFORCE_CONF="./testdata/g27racingwheel.conf"
../gtforce/ico_dic-gtforce -Dstdout -L > ../tests/testlog/gtforce.log 2>&1 &
sleep 0.5

# 4 Start Weston
/usr/bin/weston --tty=2 --idle-time=0 $WESTON_BACKEND --log=../tests/testlog/weston.log &
sleep 180

# 5 End of Test
sleep 1
/usr/bin/killall ico_dic-gtforce
sleep 0.4
/usr/bin/killall -9 ico_dic-gtforce > /dev/nul 2>&1
sleep 0.1
/usr/bin/killall weston
sleep 1

# 9 Check Error
FOUND_ERR=0
/bin/grep "ERR>" testlog/*
if [ "$?" != "1" ] ; then
	FOUND_ERR=1
fi
/bin/grep "WRN>" testlog/*
if [ "$?" != "1" ] ; then
	FOUND_ERR=1
fi
/bin/grep "Error" testlog/*
if [ "$?" != "1" ] ; then
	FOUND_ERR=1
fi
/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:"
if [ "$?" != "1" ] ; then
    FOUND_ERR=1
fi
/bin/grep "Fail" testlog/* | /bin/grep -v "error_but_no_problem_for_test" | /bin/grep -v "initialize backlight" | /bin/grep -v "disconnect"
if [ "$?" != "1" ] ; then
	FOUND_ERR=1
fi

if [ $FOUND_ERR = 0 ] ; then
	echo "Device Input Controller Test: OK"
else
	echo "Device Input Controller Test: ERROR"
fi