summaryrefslogtreecommitdiffstats
path: root/Under-Testing/Server-Code-New/gsmselftest.py
diff options
context:
space:
mode:
authorgsmselftest2011-11-17 19:12:47 +0100
committergsmselftest2011-11-17 19:12:47 +0100
commitfadf2551d69a15fdd5782b686b962d4e16e4dd92 (patch)
tree30fe337c0e3a1e86d9ced6772c54f83458c615ec /Under-Testing/Server-Code-New/gsmselftest.py
parentupdate loging files for every handler and fic device configuration function (diff)
downloadgsm-selftest-fadf2551d69a15fdd5782b686b962d4e16e4dd92.tar.gz
gsm-selftest-fadf2551d69a15fdd5782b686b962d4e16e4dd92.tar.xz
gsm-selftest-fadf2551d69a15fdd5782b686b962d4e16e4dd92.zip
need more test for tonight. Will be final version by tomorrow noon.
Diffstat (limited to 'Under-Testing/Server-Code-New/gsmselftest.py')
-rw-r--r--Under-Testing/Server-Code-New/gsmselftest.py29
1 files changed, 12 insertions, 17 deletions
diff --git a/Under-Testing/Server-Code-New/gsmselftest.py b/Under-Testing/Server-Code-New/gsmselftest.py
index ffd24c9..7e43173 100644
--- a/Under-Testing/Server-Code-New/gsmselftest.py
+++ b/Under-Testing/Server-Code-New/gsmselftest.py
@@ -86,11 +86,11 @@ def initNagiosString(x):
initResult = truthtableClass.trueTable(x)
initResult.initTrueTable()
- if int(initResult.FAILED) !=0 :
+ if int(initResult.FAILED) != 0:
print "GSM CRITICAL - Number of test "+str(initResult.testMount)+'; Failure '+str(initResult.FAILED)+'; Unknown '+str(initResult.handlerError)
elif int(initResult.handlerError) != 0:
print "GSM WARNING - Number of test "+str(initResult.testMount)+'; Failure '+str(initResult.FAILED)+'; Unknown '+str(initResult.handlerError)
- elif int(initResult.OK) == int(initResult.testMount):
+ elif int(initResult.FAILED) == 0 and int(initResult.handlerError) == 0:
print "GSM OK - Number of test "+str(initResult.testMount)+'; Failure '+str(initResult.FAILED)+'; Unknown '+str(initResult.handlerError)
else:
@@ -168,7 +168,7 @@ def isThere(keyword,lists):
def testDest(callFrom, callTo, tried):
- makeTest.initTest(callFrom,callTo)#xxxx
+ makeTest.initTest(callFrom,callTo)
db.insertTask(taskNum,callFrom,callTo)
smartResultList.append([callFrom,callTo, makeTest.result,tried])
taskID = db.maxTaskID()
@@ -245,10 +245,11 @@ def smartTest():
#checking unsuccess call, to make sure that destination are really unreachable
for dest in smartResultList:
#check unsuccess call and did the test have already tried, 2 means has been check
- if int(dest[2]) == 486 or int(dest[2]) == 999 or int(dest[2]) == 998 or int(dest[2]) == 801 or int(dest[2]) == 802:
+ if int(dest[2]) == 486 or int(dest[2]) == 999 or int(dest[2]) == 998 or int(dest[2]) == 801 or int(dest[2]) == 802:
+
if int(dest[3]) != 2 and dest[1] != 'sip':
testDestination = True
- founds = False
+ testFromRZ = False
testCaller = True
# make sure that destination have not tested by another part and give success result.
for test in smartResultList:
@@ -259,28 +260,24 @@ def smartTest():
if int(test[2]) == 200:
testCaller = False
#if destination have not tested by other part. try to test from RZ GSM
- if int(test[2]) == 200 and founds != True:
+ if int(test[2]) == 200 and testFromRZ != True:
for caller in cpgsmRZList:
if caller == test[0] or caller == test[1]:
callFrom = caller
- founds = True
+ testFromRZ = True
- if dest[0] != 'sip':
- founds = False
-
if testDestination == True:
- if founds != True:
+ if testFromRZ != True:
callFrom = 'sip'
callTo = dest[1]
- if dest[0] != 'sip':
- testDest(callFrom, callTo, 2)
- rem.append(dest)
+ testDest(callFrom, callTo, 2)
+ rem.append(dest)
#check unsuccess call because caller handler having problem
#destination handler having problem, we should make test also to the caller
if int(dest[2]) == 998 or int(dest[2]) == 802 or int(dest[2]) == 486:
if testCaller == True:
- if founds != True:
+ if testFromRZ != True:
callFrom = 'sip'
callTo = dest[0]
testDest(callFrom, callTo, 2)
@@ -672,8 +669,6 @@ def closeFunction(dbConn,serverSocket):
if len(sys.argv) > 1:
command = sys.argv[1]
-
- print ' '
if command == '--all':
resultsList = list()