summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/19-08-2011/gsmselftest1.py
diff options
context:
space:
mode:
authortt412011-08-03 00:11:17 +0200
committertt412011-08-03 00:11:17 +0200
commitb703d8b3158bbce0e7c477389ffaf7a88141ab74 (patch)
tree7c18c1e930a964423782e6b734a7bcb78fccabd8 /For Weekly Test/19-08-2011/gsmselftest1.py
parentMerge branch 'master' of lab.ks.uni-freiburg.de:lsfks/projekte/gsm-selftest (diff)
downloadgsm-selftest-b703d8b3158bbce0e7c477389ffaf7a88141ab74.tar.gz
gsm-selftest-b703d8b3158bbce0e7c477389ffaf7a88141ab74.tar.xz
gsm-selftest-b703d8b3158bbce0e7c477389ffaf7a88141ab74.zip
new feature added. smart test and true table.
Diffstat (limited to 'For Weekly Test/19-08-2011/gsmselftest1.py')
-rw-r--r--For Weekly Test/19-08-2011/gsmselftest1.py107
1 files changed, 55 insertions, 52 deletions
diff --git a/For Weekly Test/19-08-2011/gsmselftest1.py b/For Weekly Test/19-08-2011/gsmselftest1.py
index d2b974b..190431f 100644
--- a/For Weekly Test/19-08-2011/gsmselftest1.py
+++ b/For Weekly Test/19-08-2011/gsmselftest1.py
@@ -5,6 +5,9 @@ import DbClass
import PingClass
from time import sleep
+global resultsList
+resultsList = list()
+
def ping(handler):
global serverStatus
@@ -84,15 +87,16 @@ def initTest(callFrom,callTo):
callAdd = caller[0]
accCaller = caller[2]+':'+caller[3]+':'+caller[4]+':'
- recAdd = destination[0]
- destNo = destination[1]
- accDest = destination[2]+':'+destination[3]+':'+destination[4]+':'
+ destAdd = dest[0]
+ destNo = dest[1]
+ accDest = dest[2]+':'+dest[3]+':'+dest[4]+':'
- makeTest = ControllerClass.test(caller, callAdd, accCaller, callTo, recAdd, destNo, accDest)
+ makeTest = ControllerClass.test(callFrom, callAdd, accCaller, callTo, destAdd, destNo, accDest)
makeTest.FuncTest()
- result = makeTest.testResult
+ result = str(makeTest.testResult)
repeatTest = makeTest.repeatTest
+ sleep(5)
else:
print "No connection to Database"
@@ -108,13 +112,13 @@ def initTrueTable(caller):
if caller == x[0]:
- if destination == 'GSMRZ1' and
+ if destination == 'GSMRZ1':
if result =='486':
for y in resultsList:
destination = y[1]
result = y[2]
-
+
if caller == y[0]:
if destination == 'GSMRZ2':
if result == '200':
@@ -123,13 +127,13 @@ def initTrueTable(caller):
destination = z[1]
result = z[2]
-
+
if caller == z[0]:
if destination == 'GSMRZ3':
if result == '200':
print "BTS RZ 1 Broken"
- elif == '486':
+ elif result == '486':
print "BTS RZ 1 & 3 indicate having Problem"
else:
print "incomplete test, Handler having error, please do one more test"
@@ -146,7 +150,7 @@ def initTrueTable(caller):
if result == '200':
print "BTS RZ 1 & 2 indicate having Problem"
- elif result ='486':
+ elif result == '486':
print "OpenBSc Down"
else:
print "incomplete test, Handler having error, please do one more test"
@@ -215,7 +219,7 @@ def initTrueTable(caller):
result = z[2]
if caller == z[0]:
- if destination == 'GSMExt.Tm':
+ if destination == 'GSMExt.Eplus':
if result != '200':
print "O2 & T-Mobile indicate having Problem"
@@ -229,7 +233,7 @@ def initTrueTable(caller):
result = z[2]
if caller == z[0]:
- if destination == 'GSMExt.Tm':
+ if destination == 'GSMExt.Eplus':
if result == '200':
print "O2 and Vodaphone indicate having problem"
@@ -251,7 +255,7 @@ def initTrueTable(caller):
result = z[2]
if caller == z[0]:
- if destination == 'GSMExt.Tm':
+ if destination == 'GSMExt.Eplus':
if result == '200':
print "GSM external modem is Fine"
@@ -266,7 +270,7 @@ def initTrueTable(caller):
result = z[2]
if caller == z[0]:
- if destination == 'GSMExt.Tm':
+ if destination == 'GSMExt.Eplus':
if result == '200':
print "Vodaphone indicate broken"
@@ -281,20 +285,17 @@ def initTrueTable(caller):
def doTest(callFrom,callTo):
-
- global resultList
- print '\n'
- resultsList = list()
-
+ global resultsList
testRepeat = None
ping(callFrom)
- if serverStatus <> 0 and dbStatus == 1:
+ if serverStatus <> 0:
ping(callTo)
if serverStatus <> 0:
- initTest(callFrom,callTo)
- resultList.append([callTo, callFrom, result])
+
+ initTest(callFrom,callTo)
+ resultsList.append([callFrom, callTo, result])
db.errorCode(result)
print 'Result : ' +str(result)+ ' ' +db.errCode
sleep(5)
@@ -345,16 +346,18 @@ def doGsmrzTest():
doGsmExtTest()
def doGsmExtTest():
-
- destList = ['sip', 'GSMRZ1','GSMRZ2', 'GSMRZ3']
- callList = ['GSMExt.O2', 'GSMExt.Voda', 'GSMExt.Tm', 'GSMExt.Eplus']
+
+ destList = ['GSMExt.O2', 'GSMExt.Voda', 'GSMExt.Eplus']
+ callList = ['sip']
for callFrom in callList:
for callTo in destList:
doTest(callFrom, callTo)
- if repeatTest == True:
- doTest(callTo,callFrom)
+ #if repeatTest == True:
+ #doTest(callTo,callFrom)
+ callerList = ['sip']
+ initTrueTable(caller)
def doAllTest():
@@ -364,6 +367,7 @@ def doAllTest():
def smartTest():
callerList = ['sip']
+ destinationList = ['GSMExt']
for callFrom in callerList:
for destination in destinationList:
@@ -432,26 +436,26 @@ def smartTest():
elif destination == 'GSMExt':
- print "make a call to O2"
+
initTest('sip','GSMExt.O2')
-
- if result == '200':
- print "make a call to Voda"
+
+ if result == '200':
+
initTest('sip','GSMExt.Voda')
if result == '200':
- print "make a call to T-Mobile"
- initTest('sip','GSMExt.Tm')
+
+ initTest('sip','GSMExt.Eplus')
if result == '200':
print "All netwrok on GSM external are fine"
elif result == '486':
- print "T-Mobile card indicate having problem"
+ print "Eplus card indicate having problem"
else:
print "incomplete test, Handler having error, please do one more test"
elif result == '486':
- print "make a call to T-Mobile"
+
initTest('sip','GSMExt.Tm')
if result == '200':
@@ -461,12 +465,12 @@ def smartTest():
else:
print "incomplete test, Handler having error, please do one more test"
- if result == '486':
- print "make a call to Vodaphone"
+ elif result == '486':
+
initTest('sip','GSMExt.Voda')
if result == '200':
- print "make a call to T-Mobile"
+
initTest('sip','GSMExt.Tm')
if result == '200':
@@ -475,7 +479,7 @@ def smartTest():
print "O2 and T-Mobile card indicate having problem"
elif result == '486':
- print "make a call to T-Mobile"
+
initTest('sip','GSMExt.Tm')
if result == '200':
@@ -486,8 +490,8 @@ def smartTest():
print "incomplete test, Handler having error, please do one more test"
else:
print "incomplete test, Handler having error, please do one more test"
- else:
- print "incomplete test, Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
elif destination == 'SIP':
print "make a call to Landline"
@@ -529,13 +533,14 @@ if len(sys.argv) > 1:
doSipTest()
elif command == '--gsm':
- doGsmTest()
+ #doGsmTest()
+ doGsmExtTest()
elif command == '--landline':
doLandlineTest()
- elif command == '-- smart':
- smartTest()
+ elif command == '--smart':
+ smartTest()
elif command == '--help':
file = open('help.txt', 'r')
@@ -548,7 +553,7 @@ else:
global resultList
print '\n'
resultsList = list()
-
+ initDB()
if dbStatus == 1:
if db.anyTasksToDo() == 1:
@@ -570,8 +575,6 @@ else:
print 'Task ID :', taskID
print 'Calling From :', callFrom
print 'To :', callTo
- print 'number :', destNo
- print 'status :', tried
ping(callFrom)
@@ -580,10 +583,10 @@ else:
ping(callTo)
if serverStatus <> 0:
- initTest(callFrom,callTo)
+ initTest(callFrom,callTo)
db.addResult(taskID, result)
- resultList.append([callTo, callFrom, result])
+ resultList.append([callFrom, callTo, result])
if repeatTest == True and tried <> '1':
db.insertTaskIn2(callTo,callFrom,taskNo, '1')
@@ -608,9 +611,9 @@ else:
db.cleanTasksList()
# fetch result list and make adjustment about the result
- callerList = ['sip']
- for caller in callerList:
- initTrueTable(caller)
+ callerList = ['sip']
+ for caller in callerList:
+ initTrueTable(caller)
else:
print "No job at all"
else: