summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2015-09-14 13:47:40 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2015-09-14 13:47:40 +0800
commit2cc06953fdbd31aef372c445219d089722f726be (patch)
tree874e82223946ebdf9b8d60c45c9a3eb5fbd68db8
parent3ac7fa871a4b66c444cd574bcd113fb32eb937d9 (diff)
downloadlinaro-android-kernel-test-2cc06953fdbd31aef372c445219d089722f726be.tar.gz
evdevtest: fix failure for evdevtest
change to use getevent to find the input device added. but leave one question here: why the number is different between /devices/virtual/input/inputN and /dev/input/eventsN Change-Id: If9ce07e7365e580e971309ad53349a48c78b1f34 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--evdevtest/juice_evtest.c2
-rwxr-xr-xevdevtest/juice_evtest.sh17
2 files changed, 16 insertions, 3 deletions
diff --git a/evdevtest/juice_evtest.c b/evdevtest/juice_evtest.c
index 32ddf2b..d110cb8 100644
--- a/evdevtest/juice_evtest.c
+++ b/evdevtest/juice_evtest.c
@@ -18,7 +18,7 @@
#define JUICE_ERROR(X) \
do \
- printf("##Juice error: %s in %s at line %d ##\n", X, __FUNCTION__, __LINE__); \
+ printf("##Juice error: %s in %s at line %d ##: %s\n", X, __FUNCTION__, __LINE__, strerror(errno)); \
while(0)
#define DELAY 10
diff --git a/evdevtest/juice_evtest.sh b/evdevtest/juice_evtest.sh
index 4f5f2e0..9c3dd20 100755
--- a/evdevtest/juice_evtest.sh
+++ b/evdevtest/juice_evtest.sh
@@ -7,6 +7,8 @@ if [ ! -e /system/modules/juice_input_test_module.ko ]; then
exit
fi
+rmmod juice_input_test_module
+
insmod /system/modules/juice_input_test_module.ko
rc=$?
if [ $rc -ne 0 ]; then
@@ -14,10 +16,21 @@ if [ $rc -ne 0 ]; then
exit
fi
-N=`dmesg |grep Juice|awk -F '' '{print $NF}'`
+input_dev=""
+for dev in $(ls /dev/input/event*);do
+ if getevent -i "${dev}"|grep -q "Juice EVDEV Test Module"; then
+ input_dev=${dev}
+ break
+ fi
+done
+
+if [ -z "${input_dev}" ]; then
+ echo "Failed to find the input device for kernel evdev test"
+ exit 1
+fi
echo "Evdev IOCTL CMD TEST START"
-juice_evtest -p /dev/input/event$N
+juice_evtest -p ${input_dev}
rc=$?
if [ $rc -ne 0 ]; then
echo "Evdev IOCTL CMD TEST FAIL!"