Prechádzať zdrojové kódy

add batled-test.sh script for battery led test.

Joe 1 deň pred
rodič
commit
5db2500ffa

+ 18 - 0
python_test/batled-test.sh

@@ -0,0 +1,18 @@
+#!/bin/sh
+
+# get battleled status
+
+ec_suspend=`echo "111111" | sudo -S ls`
+sudo ./Linux_led_V03/release/led_tool batledsys 0
+sleep 1
+sudo ./Linux_led_V03/release/led_tool batledsys 1
+sleep 2
+sudo ./Linux_led_V03/release/led_tool batledsys 2
+sleep 1
+sudo ./Linux_led_V03/release/led_tool batledsys 3
+sleep 2
+leddata=`sudo ./Linux_led_V03/release/led_tool batledsys 4 | grep -c "OK"`
+echo $leddata
+
+
+

+ 5 - 3
python_test/test_function.py

@@ -639,8 +639,10 @@ def step14_routine(context):
 
 
 def step15_routine(context):
 def step15_routine(context):
     context.print1("==SubTest: 检查电池健康指示灯功能测试 -  Titem_16")
     context.print1("==SubTest: 检查电池健康指示灯功能测试 -  Titem_16")
-    context.print1("-:) sh led-test.sh") 
-    a = os.popen("sh led-test.sh | tail -1").read().replace('\n', '').replace('\r', '').strip()
+    context.print1("-:) sh batled-test.sh")
+    a = os.popen("sh batled-test.sh").read().replace('\n', '').replace('\r', '').strip()
+    context.print1("output: {}".format(a))   
+    a = os.popen("sh batled-test.sh | tail -1").read().replace('\n', '').replace('\r', '').strip()
     try:
     try:
         a_int = int(a)
         a_int = int(a)
     except ValueError:
     except ValueError:
@@ -740,7 +742,7 @@ def step27_routine(context):
     context.print1("==SubTest: 检查gsensor基本功能测试  -  Titem_23")
     context.print1("==SubTest: 检查gsensor基本功能测试  -  Titem_23")
     context.print1("-:) bash ./gsensor-SC7A20H/C180_gsensor_function_script.sh")
     context.print1("-:) bash ./gsensor-SC7A20H/C180_gsensor_function_script.sh")
     context.print1("10s内手动转动屏幕,才能测试PASS!")
     context.print1("10s内手动转动屏幕,才能测试PASS!")
-    tkMessageBox.showinfo("Prompt", "请人工向右转动屏幕检查横竖屏,判断重力传感器是否正常?"):
+    tkMessageBox.showinfo("Prompt", "请人工向右转动屏幕检查横竖屏,判断重力传感器是否正常?")
     a = os.popen("bash ./gsensor-SC7A20H/C180_gsensor_function_script.sh  | grep -c \"pass\"").read().replace('\n', '').replace('\r', '').strip()
     a = os.popen("bash ./gsensor-SC7A20H/C180_gsensor_function_script.sh  | grep -c \"pass\"").read().replace('\n', '').replace('\r', '').strip()
     try:
     try:
         a_int = int(a)
         a_int = int(a)

BIN
python_test/test_function.pyc