#!/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 # 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=1 --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/* 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