From 2cc2c0e3377f4745afa9f0948d1aec95ca184781 Mon Sep 17 00:00:00 2001 From: triatmoko Date: Tue, 19 Jul 2011 14:18:07 +0200 Subject: modified all SIP part (landline, sip, university sip) to work with Main Controller. --- For Weekly Test/20-07-2011/Controller.py | 63 ++++++++++++++------------------ 1 file changed, 28 insertions(+), 35 deletions(-) (limited to 'For Weekly Test/20-07-2011/Controller.py') diff --git a/For Weekly Test/20-07-2011/Controller.py b/For Weekly Test/20-07-2011/Controller.py index 50c0f76..c1d63a4 100644 --- a/For Weekly Test/20-07-2011/Controller.py +++ b/For Weekly Test/20-07-2011/Controller.py @@ -23,23 +23,13 @@ sipRec = "sipReceiver.py" landlnCall = "landlineCall.py" landlnRec = "landlineReceiver.py" localSipRec = "localsipReceiver.py" -rz1Call = "rz1Call.py" -rz1Rec = "rz1Receiver.py" -o2Call = "o2Call.py" -o2Rec = "o2Receiver.py" -vodafoneCall = "vodafoneCall.py" -vodafoneRec = "vodafoneReceiver.py" -tmobileCall = "tmobileCall.py" -tmobilRec = "tmobileReceiver.py" - -# One function for all test case # Main software # Check DB connection db = classDb.DBMySQLConnection('root', 'randompasswordSQL', 'localhost', 'gsmselftesting') -print "Connecting to DB ", db.connectDB() +db.connectDB() print "" dbStatus = db.connectDB() @@ -57,14 +47,15 @@ if dbStatus == 1: sipLocalServerStatus = sipLocalServer.ping(3) # Fetch The task information from DB - print "do i have anything to do", db.anyTasksToDo() + db.anyTasksToDo() #x = () for item in db.tasksList: taskID = item[0] - callFrom = item[1] - callTo = item[2] + taskNo = item[1] + callFrom = item[2] + callTo = item[3] print "Test ID : " , taskID print "Caller : " , callFrom @@ -80,13 +71,11 @@ if dbStatus == 1: x = classController.test(sipCall, "localhost", "gsmincom_.py", "localhost","4661455") x.FuncTest() - print "Finish test" - db.addResult(taskID, testResult) - if repeatTest == "true": - #select temporary table, if there are have test from gsmrz to sip then skip - #else, update db, put new data to tasktable. from gsmrz to sip - # waiting db class for repeat test from refik which I ask for. - update + + db.addResult(taskID, x.testResult) + + if x.repeatTest == True: + db.insertTaskIn2(callTo,callFrom,taskNo) if callTo == "gsmrz2": @@ -96,13 +85,11 @@ if dbStatus == 1: else: x = classController.test(sipCall, "localhost", "Box1", "132.0.0.2","404") x.FuncTest() - print "" - db.addResult(taskID, testResult) - if repeatTest == "true": - #select temporary table, if there are have test from gsmrz to sip then skip - #else, update db, put new data to tasktable. from gsmrz to sip - update + db.addResult(taskID, x.testResult) + + if x.repeatTest == True: + db.insertTaskIn2(callTo,callFrom,taskNo) if callTo == "gsmrz3": @@ -112,13 +99,12 @@ if dbStatus == 1: else: x = classController.test(sipCall, "localhost", "Box2", "132.0.0.3","405") x.FuncTest() - - - db.addResult(taskID, testResult) - if repeatTest == "true": - #select temporary table, if there are have test from gsmrz to sip then skip - #else, update db, put new data to tasktable. from gsmrz to sip - update + + db.addResult(taskID, x.testResult) + + if x.repeatTest == True: + db.insertTaskIn2(callTo,callFrom,taskNo) + if callTo == "landline": if sipGateServerStatus == 0: @@ -127,7 +113,12 @@ if dbStatus == 1: else: x = classController.test(sipCall, "localhost", landlnRec, "localhost",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: @@ -136,7 +127,9 @@ if dbStatus == 1: else: x = classController.test(sipCall, "localhost", localSipRec, "localhost",unisipNum) x.FuncTest() - db.addResult(taskID, testResult) + + db.addResult(taskID, x.testResult) + sleep(5) if callTo == "externalgsm": x.FuncTest(sipCall, "localhost", o2Rec, "localhost","405") -- cgit v1.2.3-55-g7522