summaryrefslogtreecommitdiffstats
path: root/For Weekly Test
diff options
context:
space:
mode:
Diffstat (limited to 'For Weekly Test')
-rw-r--r--For Weekly Test/19-08-2011/gsmselftest1.py128
1 files changed, 70 insertions, 58 deletions
diff --git a/For Weekly Test/19-08-2011/gsmselftest1.py b/For Weekly Test/19-08-2011/gsmselftest1.py
index bff1574..f61b07d 100644
--- a/For Weekly Test/19-08-2011/gsmselftest1.py
+++ b/For Weekly Test/19-08-2011/gsmselftest1.py
@@ -38,24 +38,24 @@ def allPing():
global sipGate
global sipServer
- global sipLoc
+ global unisip
global gsmBox1
global gsmBox2
server = PingClass.Ping('sipgate.de')
- sipGate = server.ping(3)
+ sipGate = server.ping(1)
server = PingClass.Ping('132.230.4.8')
- sipServer = server.ping(3)
+ sipServer = server.ping(1)
server = PingClass.Ping('132.230.252.228')
- unisip = server.ping(3)
+ unisip = server.ping(1)
server = PingClass.Ping('localhost')
- gsmBox1 = server.ping(3)
+ gsmBox1 = server.ping(1)
server = PingClass.Ping('132.230.4.64')
- gsmBox2 = server.ping(3)
+ gsmBox2 = server.ping(1)
def initDB():
global dbStatus
@@ -465,22 +465,28 @@ def doAllTest():
doGsmTest()
def smartTest():
+ ping('sip')
+ if serverStatus == 0:
+ print "Dont have connection to SIP Asterisk server, can't make a test"
+ sys.exit(1)
+
callerList = ['sip']
destinationList = ['GSMExt']
+ #destinationList = ['GSMExt', 'GSMRZ', 'SIP']
for callFrom in callerList:
for destination in destinationList:
if destination == 'GSMRZ':
print "make a call to GSMRZ1"
- initTest('sip','GSMRZ1')
+ initTest(callFrom,'GSMRZ1')
if result == '200':
print "make a call to GSMRZ2"
- initTest('sip','GSMRZ2')
+ initTest(callFrom,'GSMRZ2')
if result == '200':
print "make a call to GSMRZ3"
- initTest('sip','GSMRZ3')
+ initTest(callFrom,'GSMRZ3')
if result == '200':
print "all netwrok on GSMRZ are fine"
@@ -491,7 +497,7 @@ def smartTest():
elif result == '486':
print "make a call to GSMRZ3"
- initTest('sip','GSMRZ3')
+ initTest(callFrom,'GSMRZ3')
if result == '200':
print "BTS 2 Down"
@@ -504,11 +510,11 @@ def smartTest():
elif result == '486':
print "make a call to GSMRZ2"
- initTest('sip','GSMRZ2')
+ initTest(callFrom,'GSMRZ2')
if result == '200':
print "make a call to GSMRZ3"
- initTest('sip','GSMRZ3')
+ initTest(callFrom,'GSMRZ3')
if result == '200':
print "BTS 1 Down"
@@ -536,16 +542,16 @@ def smartTest():
elif destination == 'GSMExt':
- initTest('sip','GSMExt.O2')
+ initTest(callFrom,'GSMExt.O2')
if result == '200':
- initTest('sip','GSMExt.Voda')
+ initTest(callFrom,'GSMExt.Voda')
if result == '200':
- initTest('sip','GSMExt.Eplus')
+ initTest(callFrom,'GSMExt.Eplus')
if result == '200':
- initTest('sip','GSMExt.Tm')
+ initTest(callFrom,'GSMExt.Tm')
if result == '200':
print "All netwrok on GSM external are fine"
elif result == '486':
@@ -555,7 +561,7 @@ def smartTest():
elif result == '486':
- initTest('sip','GSMExt.Tm')
+ initTest(callFrom,'GSMExt.Tm')
if result == '200':
print "E-Plus card indicate having problem"
elif result == '486':
@@ -565,10 +571,10 @@ def smartTest():
elif result == '486':
- initTest('sip','GSMExt.Eplus')
+ initTest(callFrom,'GSMExt.Eplus')
if result == '200':
- initTest('sip','GSMExt.Tm')
+ initTest(callFrom,'GSMExt.Tm')
if result == '200':
print "Vodaphone card indicate having problem"
elif result == '486':
@@ -578,7 +584,7 @@ def smartTest():
elif result == '486':
- initTest('sip','GSMExt.Tm')
+ initTest(callFrom,'GSMExt.Tm')
if result == '200':
print "Vodaphone and E-Plus card indicate having problem"
elif result == '486':
@@ -590,13 +596,13 @@ def smartTest():
elif result == '486':
- initTest('sip','GSMExt.Voda')
+ initTest(callFrom,'GSMExt.Voda')
if result == '200':
- initTest('sip','GSMExt.Eplus')
+ initTest(callFrom,'GSMExt.Eplus')
if result == '200':
- initTest('sip','GSMExt.Tm')
+ initTest(callFrom,'GSMExt.Tm')
if result == '200':
print "O2 card indicate having problem"
elif result == '486':
@@ -606,7 +612,7 @@ def smartTest():
elif result == '486':
- initTest('sip','GSMExt.Tm')
+ initTest(callFrom,'GSMExt.Tm')
if result == '200':
print "O2 and E-Plus cards indicate having problem"
elif result == '486':
@@ -618,10 +624,10 @@ def smartTest():
elif result == '486':
- initTest('sip','GSMExt.Eplus')
+ initTest(callFrom,'GSMExt.Eplus')
if result == '200':
- initTest('sip','GSMExt.Tm')
+ initTest(callFrom,'GSMExt.Tm')
if result == '200':
print "O2 and Vodaphone cards indicate having problem"
elif result == '486':
@@ -631,7 +637,7 @@ def smartTest():
elif result == '486':
- initTest('sip','GSMExt.Tm')
+ initTest(callFrom,'GSMExt.Tm')
if result == '200':
print "O2, E-Plus and Vodaphone cards indicate having problem"
elif result == '486':
@@ -646,32 +652,41 @@ def smartTest():
print "incomplete test, Handler having error, please do one more test"
elif destination == 'SIP':
- print "make a call to Landline"
- initTest('sip','landline')
-
- if result == '200':
- print "make a call to UNISIP"
- initTest('sip','unisip')
-
- if result =='200':
- print "All SIP network is fine"
- elif result == '486':
- print "University telphone network indicate having problem"
- else:
- print "incomplete test, Handler having error, please do one more test"
+
+ ping('landline')
+ if serverStatus <> 0:
+ initTest(callFrom,'landline')
- elif result == '486':
- print "making a call to UNISIP"
- initTest('sip','unisip')
+ if result == '200':
+ ping('unisip')
+ if serverStatus <> 0:
+ initTest(callFrom,'unisip')
+
+ if result =='200':
+ print "All SIP network is fine"
+ elif result == '486':
+ print "University telphone network indicate having problem"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "No connection to University telephone network server, check your connection"
+ elif result == '486':
+ ping('unisip')
+ if serverStatus <> 0:
+ initTest(callFrom,'unisip')
- if result == '200':
- print "Landline indicate having problem"
- elif result == '486':
- print "SIP Network Down"
- else:
- print "incomplete test, Handler having error, please do one more test"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ if result == '200':
+ print "Landline indicate having problem"
+ elif result == '486':
+ print "SIP Network Down"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "No connection to University telephone network server, check your connection"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "No connection to SIP Gate server, check your connection"
if len(sys.argv) > 1:
@@ -709,12 +724,10 @@ else:
if db.anyTasksToDo() == 1:
- print '\n'
- #allPing()
+ allPing()
i=0
for item in db.tasksList:
- print item
- print db.tasksList
+
taskID = item[0]
taskNo = item[1]
callFrom = item[2]
@@ -722,8 +735,8 @@ else:
tried = item[4]
- #if i == 0:
- # db.updatePingResult(taskNo, sipServer, sipGate, sipLoc, gsmBox1, gsmBox2)
+ if i == 0:
+ db.updatePingResult(taskNo, sipServer, sipGate, unisip, gsmBox1, gsmBox2)
print '\n'
print 'Task ID :', taskID
print 'Calling From :', callFrom
@@ -772,7 +785,6 @@ else:
else:
print "--- No job at all ---"
else:
- print "holla"
sys.exit(1)