Added a test script to control the test, using python.

This commit is contained in:
maniacbug
2011-07-13 15:02:03 -07:00
parent 77411b4ec5
commit 22b4c558cd
3 changed files with 30 additions and 2 deletions

20
tests/pingpair_test/runtest.py Executable file
View File

@@ -0,0 +1,20 @@
#!/opt/local/bin/python
import sys,serial
def read_until(token):
while 1:
line = ser.readline(None,"\r")
sys.stdout.write(line)
if (line.startswith("+OK")):
break
return line
ser = serial.Serial(sys.argv[1], 57600, timeout=5)
line = read_until("+OK")
if (line.find("PASS") != -1):
sys.exit(0)
else:
sys.exit(1)