summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/23-07-2011/Controller.py
diff options
context:
space:
mode:
authorMac-Linux2011-07-22 20:53:45 +0200
committerMac-Linux2011-07-22 20:53:45 +0200
commitd3e5b3926a59f9916e8cc5af493f4da27e22e8d5 (patch)
tree15b2eef2fd92ecad6e3793d321101d600dfc3ed5 /For Weekly Test/23-07-2011/Controller.py
parentdeleted some old files (diff)
downloadgsm-selftest-d3e5b3926a59f9916e8cc5af493f4da27e22e8d5.tar.gz
gsm-selftest-d3e5b3926a59f9916e8cc5af493f4da27e22e8d5.tar.xz
gsm-selftest-d3e5b3926a59f9916e8cc5af493f4da27e22e8d5.zip
editing file for weekly test.
Diffstat (limited to 'For Weekly Test/23-07-2011/Controller.py')
-rw-r--r--For Weekly Test/23-07-2011/Controller.py119
1 files changed, 22 insertions, 97 deletions
diff --git a/For Weekly Test/23-07-2011/Controller.py b/For Weekly Test/23-07-2011/Controller.py
index 0f8812f..b30ee6f 100644
--- a/For Weekly Test/23-07-2011/Controller.py
+++ b/For Weekly Test/23-07-2011/Controller.py
@@ -1,46 +1,19 @@
import sys
-import os
-import time
-import MySQLdb
-import subprocess
-
-
-import classClient #import class socket
-import classDb #import class db
-import classPing
-import classController
+import classClient
+import classDb
+import 2classController
+import classCheck
from time import sleep
-
-sipNum = "4661929"
-landlnNum = "076145875681"
-unisipNum = "076120397897"
-
-# Main software
-
-# Check DB connection
db = classDb.DBMySQLConnection('root', 'randompasswordSQL', 'localhost', 'gsmselftesting')
db.connectDB()
-print ""
dbStatus = db.connectDB()
if dbStatus == 1:
-
- # Check Ping to the Every Handler
- sipServer = classPing.Ping('132.230.4.8')
- sipServerStatus = sipServer.ping(3)
-
- sipGateServer = classPing.Ping('sipgate.de')
- sipGateServerStatus = sipGateServer.ping(3)
- sipLocalServer = classPing.Ping('132.230.252.228')
- sipLocalServerStatus = sipLocalServer.ping(3)
-
-# Fetch The task information from DB
- db.anyTasksToDo()
- #x = ()
+ db.anyTasksToDo()
for item in db.tasksList:
@@ -49,79 +22,31 @@ if dbStatus == 1:
callFrom = item[2]
callTo = item[3]
- print "Test ID : " , taskID
- print "Caller : " , callFrom
+ print "Test ID : " , taskID
+ print "Caller : " , callFrom
print "Receiver : " , callTo
- if callFrom == "sip":
- if sipServerStatus == 0:
- print "[failed] 500 Server Internal Error"
+ call = classCheck(callFrom)
+ rec = classCheck(callTo)
- else:
-
- if callTo == "gsmrz1":
+ if call.serverStatus <> 0:
- x = classController.test('-S',"gsmBox1","4661455")
- x.FuncTest()
-
- db.addResult(taskID, x.testResult)
+ if rec.serverStatus <> 0:
- if x.repeatTest == True:
- db.insertTaskIn2(callTo,callFrom,taskNo)
+ makeTest = classController.test(callFrom, callTo,rec.destNumber)
+ makeTest.FuncTest()
- if callTo == "gsmrz2":
-
- if gsmBox1Status == 0:
- print "[failed] 500 Server Internal Error"
-
- else:
- x = classController.test('-S', "gsmBox2", "4661404")
- x.FuncTest()
-
- db.addResult(taskID, x.testResult)
-
- if x.repeatTest == True:
- db.insertTaskIn2(callTo,callFrom,taskNo)
-
- if callTo == "gsmrz3":
+ db.addResult(taskID, makeTest.testResult)
- if gsmBox2Status == 0:
- print "[failed] 500 Server Internal Error"
-
- else:
- x = classController.test('-S', "gsmBox3","4661405")
- x.FuncTest()
-
- db.addResult(taskID, x.testResult)
-
- if x.repeatTest == True:
- db.insertTaskIn2(callTo,callFrom,taskNo)
-
- if callTo == "landline":
-
- if sipGateServerStatus == 0:
- print "[failed] 500 Server Internal Error"
-
- else:
- x = classController.test('-S', '-L',landlnNum)
- x.FuncTest()
-
- db.addResult(taskID, x.testResult)
-
- if x.repeatTest == True:
- db.insertTaskIn2(callTo,callFrom,taskNo)
- sleep(5)
-
- if callTo == "localsip":
- if sipLocalServerStatus == 0:
- print "[failed] 500 Server Internal Error"
-
- else:
- x = classController.test('-S', '-U',unisipNum)
- x.FuncTest()
+ if makeTest.repeatTest == True:
+ db.insertTaskIn2(callTo,callFrom,taskNo)
+ else:
+ print "[failed] 500 "+callTo+ " Server Internal Error"
+ else:
+ print "[failed] 500 "+callFrom+ " Server Internal Error"
- db.addResult(taskID, x.testResult)
- sleep(5)
+ call = None
+ rec = None
# will exit if DB connection failed
else: