summaryrefslogtreecommitdiffstats
path: root/For Weekly Test
diff options
context:
space:
mode:
authorMac-Linux2011-07-27 18:28:12 +0200
committerMac-Linux2011-07-27 18:28:12 +0200
commit723deb22e251072b0e06c923f5cbb9cd9c6ffa4d (patch)
tree9648b2dea5f639530f5e2939ad4dc9d1c957c41e /For Weekly Test
parentgsm test file final (diff)
downloadgsm-selftest-723deb22e251072b0e06c923f5cbb9cd9c6ffa4d.tar.gz
gsm-selftest-723deb22e251072b0e06c923f5cbb9cd9c6ffa4d.tar.xz
gsm-selftest-723deb22e251072b0e06c923f5cbb9cd9c6ffa4d.zip
changing test
Diffstat (limited to 'For Weekly Test')
-rw-r--r--For Weekly Test/30-07-2011/ControllerClass.py6
-rw-r--r--For Weekly Test/30-07-2011/ControllerClass.pycbin5709 -> 5714 bytes
-rw-r--r--For Weekly Test/30-07-2011/DeviceAddress.py14
-rw-r--r--For Weekly Test/30-07-2011/DeviceAddress.txt10
-rwxr-xr-x[-rw-r--r--]For Weekly Test/30-07-2011/gsmselftest.py69
-rw-r--r--For Weekly Test/30-07-2011/help.txt4
6 files changed, 72 insertions, 31 deletions
diff --git a/For Weekly Test/30-07-2011/ControllerClass.py b/For Weekly Test/30-07-2011/ControllerClass.py
index 753548d..04c9614 100644
--- a/For Weekly Test/30-07-2011/ControllerClass.py
+++ b/For Weekly Test/30-07-2011/ControllerClass.py
@@ -86,9 +86,9 @@ class test:
def waitingFeedback(self):
- logger.logEvent('waiting Feedback')
- self.resultCaller = self.caller.receiveData(120)
- self.resultDest = self.receiver.receiveData(120)
+ logger.logEvent('Waiting Feedback')
+ self.resultCaller = self.caller.receiveData(60)
+ self.resultDest = self.receiver.receiveData(60)
if self.resultCaller <> 'CALL OK' or self.resultDest <> 'CALL OK':
diff --git a/For Weekly Test/30-07-2011/ControllerClass.pyc b/For Weekly Test/30-07-2011/ControllerClass.pyc
index d5ccb86..17cc236 100644
--- a/For Weekly Test/30-07-2011/ControllerClass.pyc
+++ b/For Weekly Test/30-07-2011/ControllerClass.pyc
Binary files differ
diff --git a/For Weekly Test/30-07-2011/DeviceAddress.py b/For Weekly Test/30-07-2011/DeviceAddress.py
index 1211b43..6f0039d 100644
--- a/For Weekly Test/30-07-2011/DeviceAddress.py
+++ b/For Weekly Test/30-07-2011/DeviceAddress.py
@@ -13,11 +13,15 @@ class DeviceAddress:
second= line.find(']') # search for position
find = line[first+1:second]
- space = line.find(' ')
- newLine =line[space+1:]
- space2 = newLine.find(' ')
+ stop = line.find(':')
+ newLine =line[stop+1:]
+ stop2 = newLine.find(':')
+
+ no = newLine[stop2+1:]
+ stop3 = no.find(':')
+
if find == device:
- self.add = newLine[0:space2]
- self.num = newLine[space2+1:]
+ self.add = newLine[0:stop2]
+ self.num = no[0:stop3]
file.close()
diff --git a/For Weekly Test/30-07-2011/DeviceAddress.txt b/For Weekly Test/30-07-2011/DeviceAddress.txt
index ae0b990..cd3467e 100644
--- a/For Weekly Test/30-07-2011/DeviceAddress.txt
+++ b/For Weekly Test/30-07-2011/DeviceAddress.txt
@@ -1,3 +1,9 @@
-[sip] localhost 999
+[sip]:localhost:07612034661928:
-[landline] localhost 888
+[landline]:localhost:076145875681:
+
+[unisip]:localhost:076120397897:
+
+[gsmr1]:localhost:076120346614xx:
+
+[gsmr2]:132.230.4.64:07612034661455: #Technisse Fakultät Building
diff --git a/For Weekly Test/30-07-2011/gsmselftest.py b/For Weekly Test/30-07-2011/gsmselftest.py
index 381f3f4..400970f 100644..100755
--- a/For Weekly Test/30-07-2011/gsmselftest.py
+++ b/For Weekly Test/30-07-2011/gsmselftest.py
@@ -1,5 +1,7 @@
+#! /usr/bin/env python
import sys
import ControllerClass
+import DbClass
import PingClass
import DeviceAddress
from time import sleep
@@ -29,7 +31,7 @@ def ping(handler):
serverStatus = server.ping(3)
-def doTest(callFrom,callTo)
+def doTest(callFrom,callTo):
global testResult
ping(callFrom)
@@ -41,7 +43,7 @@ def doTest(callFrom,callTo)
if serverStatus <> 0:
device.findDevice(callTo)
recAdd = device.add
- destNo = device.num
+ destNo = str(device.num)
device.findDevice(callFrom)
callAdd = device.add
@@ -70,15 +72,18 @@ def doTest(callFrom,callTo)
def doSipTest():
- destList = ['gsmr1', 'gsmr2', 'gsmr3', 'landline', 'unisip', 'gsmeO', 'gsmeV', 'gsmeT', 'gsmeE']
-
+ print '--SIP Part Test--'
+ destList = ['sip', 'gsmr1','gsmr2', 'gsmr3', 'landline', 'unisip', 'gsmeO', 'gsmeV', 'gsmeT', 'gsmeE']
+ #destList = ['unisip']
for callTo in destList:
callFrom = 'sip'
- doTest(callFrom, callTo)
+ if callFrom <> callTo:
+ doTest(callFrom, callTo)
def doLandlineTest():
+ print '--Landline Part Test--'
destList = ['gsmr1', 'gsmr2', 'gsmr3', 'sip']
for callTo in destList:
@@ -88,21 +93,16 @@ def doLandlineTest():
def doGsmrzTest():
- destList = ['sip', 'gsmr1','gsmr2', 'gsmr3', 'landline', 'unisip', 'gsmeO', 'gsmeV', 'gsmeT', 'gsmeE']
-
- for callTo in destList:
-
- callFrom = 'gsmr1'
- if callFrom <> callTo:
- doTest(callFrom, callTo)
+ print '--GSM Part Test--'
+ destList = ['sip', 'gsmr1','gsmr2', 'gsmr3', 'landline', 'unisip', 'gsmeO', 'gsmeV', 'gsmeT', 'gsmeE']
+ calllist = ['gsmr1','gsmr2', 'gsmr3']
+
+ for callFrom in calllist:
- callFrom = 'gsmr2'
- if callFrom <> callTo:
- doTest(callFrom, callTo)
+ for callTo in destList:
+ if callTo <> callFrom:
+ doTest(callFrom, callTo)
- callFrom = 'gsmr3'
- if callFrom <> callTo:
- doTest(callFrom, callTo)
doGsmExtTest()
def doGsmExtTest():
@@ -130,7 +130,9 @@ def doAllTest():
doGsmTest()
if len(sys.argv) > 1:
+
command = sys.argv[1]
+ print '\n'
if command == '--all':
doAllTest()
@@ -150,8 +152,9 @@ if len(sys.argv) > 1:
else:
print "command not found, Type '--help', '--copyright', '--credits' or '--license' for more information."
+ print '\n'
else:
-
+ print '\n'
db = DbClass.DBMySQLConnection('root', 'randompasswordSQL', 'localhost', 'gsmselftesting')
db.connectDB()
dbStatus = db.connectDB()
@@ -159,6 +162,8 @@ else:
if dbStatus == 1:
if db.anyTasksToDo() == 1:
+
+ allPing()
i=0
for item in db.tasksList:
taskID = item[0]
@@ -173,11 +178,13 @@ else:
callAdd = caller[0]
recAdd = destination[0]
destNo = destination[1]
+
+ #if i == 0:
+ # db.updatePingResult(taskNo, sipServer, sipGate, sipLoc, gsmBox1, gsmBox2)
if callFrom == 'unisip':
destNo = destNo[7:]
-
print '\n'
print "Task ID: ", taskID
print "Calling From: ", callFrom
@@ -219,6 +226,28 @@ else:
+def allPing():
+
+ global sipGate
+ global sipServer
+ global sipLoc
+ global gsmBox1
+ global gsmBox2
+
+ server = PingClass.Ping('sipgate.de')
+ sipGate = server.ping(3)
+
+ server = PingClass.Ping('132.230.4.8')
+ sipServer = server.ping(3)
+
+ server = PingClass.Ping('132.230.252.228')
+ sipLoc = server.ping(3)
+
+ server = PingClass.Ping('localhost')
+ gsmBox1 = server.ping(3)
+
+ server = PingClass.Ping('132.230.4.64')
+ gsmBox2 = server.ping(3)
diff --git a/For Weekly Test/30-07-2011/help.txt b/For Weekly Test/30-07-2011/help.txt
index 5a1f1ed..ccbc193 100644
--- a/For Weekly Test/30-07-2011/help.txt
+++ b/For Weekly Test/30-07-2011/help.txt
@@ -1,4 +1,6 @@
-usage: python gsmselftest.py [option]
+
+
+Usage: python gsmselftest.py [option]
Options and arguments (and corresponding environment variables):