From 6cce50ffe8314f6db0c1b3e891a284c40f2d2226 Mon Sep 17 00:00:00 2001 From: August Date: Sat, 28 Jul 2018 15:45:58 +0800 Subject: [PATCH] dragonboard: add ethernet test case Signed-off-by: August --- .../target/dragonboard/src/testcases/Makefile | 1 + .../src/testcases/nettester/Makefile | 11 +++++ .../src/testcases/nettester/nettester.sh | 42 +++++++++++++++++++ .../sun50iw1p1/configs/m64/test_config.fex | 11 ++++- 4 files changed, 64 insertions(+), 1 deletion(-) mode change 100644 => 100755 lichee/buildroot/target/dragonboard/src/testcases/Makefile create mode 100755 lichee/buildroot/target/dragonboard/src/testcases/nettester/Makefile create mode 100755 lichee/buildroot/target/dragonboard/src/testcases/nettester/nettester.sh diff --git a/lichee/buildroot/target/dragonboard/src/testcases/Makefile b/lichee/buildroot/target/dragonboard/src/testcases/Makefile old mode 100644 new mode 100755 index 7329c74e7f..eb9af98e1a --- a/lichee/buildroot/target/dragonboard/src/testcases/Makefile +++ b/lichee/buildroot/target/dragonboard/src/testcases/Makefile @@ -26,6 +26,7 @@ all: make -C otgtester make -C 2gtester make -C bluetooth + make -C nettester make -C gyrotester make -C gyroiiotester make -C vrcmptester diff --git a/lichee/buildroot/target/dragonboard/src/testcases/nettester/Makefile b/lichee/buildroot/target/dragonboard/src/testcases/nettester/Makefile new file mode 100755 index 0000000000..f8570b39cc --- /dev/null +++ b/lichee/buildroot/target/dragonboard/src/testcases/nettester/Makefile @@ -0,0 +1,11 @@ + +# define sources root directory before everything +SRC_ROOT := ../.. + +# include rule.mk +include $(SRC_ROOT)/rule.mk + +.PHONY: all +all: + cp nettester.sh $(BINDIR)/ + diff --git a/lichee/buildroot/target/dragonboard/src/testcases/nettester/nettester.sh b/lichee/buildroot/target/dragonboard/src/testcases/nettester/nettester.sh new file mode 100755 index 0000000000..20cef0aaf2 --- /dev/null +++ b/lichee/buildroot/target/dragonboard/src/testcases/nettester/nettester.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +#source script_parser.sh +source send_cmd_pipe.sh + + +if ifconfig -a | grep eth0; then + ifconfig eth0 down + sleep 1 + + ifconfig eth0 up + if [ $? -ne 0 ];then + + SEND_CMD_PIPE_FALL $3 + exit 1 + fi + + /etc/init.d/auto_config_network & + sleep 10 + + ping_address=$(ping -c 4 www.baidu.com); + + ping_cmd=$(echo $ping_address | grep -c "bytes from"); + + if [ $ping_cmd -eq 1 ]; then + SEND_CMD_PIPE_OK $3 + else + SEND_CMD_PIPE_FAIL $3 + exit 1 + fi + +# ifconfig eth0 down +# if [ $? -ne 0 ]; then +# SEND_CMD_PIPE_FAIL $3 +# exit 1 +# fi + +else + + SEND_CMD_PIPE_FAIL $3 + exit 1 +fi diff --git a/lichee/tools/pack/chips/sun50iw1p1/configs/m64/test_config.fex b/lichee/tools/pack/chips/sun50iw1p1/configs/m64/test_config.fex index 6c1cf3c220..faaadfa644 100644 --- a/lichee/tools/pack/chips/sun50iw1p1/configs/m64/test_config.fex +++ b/lichee/tools/pack/chips/sun50iw1p1/configs/m64/test_config.fex @@ -59,7 +59,7 @@ run_type = 1 ;------------------------------------------------------------------------------- [wifi] display_name= "网络" -activated = 1 +activated = 0 program = "wifitester.sh" category = 0 run_type = 1 @@ -67,6 +67,15 @@ module_count= 1 module_path = "/system/vendor/modules/8723cs.ko" module_args = +[ethernet] +display_name= "乙太網" +activated = 1 +program = "nettester.sh" +category = 0 +run_type = 1 +module_path = +module_args = + ;------------------------------------------------------------------------------- ; module_path ; The full path of g-sensor module file.