From 42eef9ac46c877cc186715ae327d105b66b9e786 Mon Sep 17 00:00:00 2001 From: gsmselftest Date: Fri, 14 Oct 2011 16:47:54 +0200 Subject: rearragne backup file. --- For Weekly Test/Advance/initTestClass.py | 37 ++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) mode change 100644 => 100755 For Weekly Test/Advance/initTestClass.py (limited to 'For Weekly Test/Advance/initTestClass.py') diff --git a/For Weekly Test/Advance/initTestClass.py b/For Weekly Test/Advance/initTestClass.py old mode 100644 new mode 100755 index b91e07d..ed0c666 --- a/For Weekly Test/Advance/initTestClass.py +++ b/For Weekly Test/Advance/initTestClass.py @@ -116,13 +116,16 @@ class doTest: makeTest = ControllerClass.doTheTest(callFrom, callPortName, accCaller, callTo, destPortName, destNo, accDest) makeTest.FuncTest() self.result = str(makeTest.testResult) + + print callFrom, callTo, makeTest.testResult else: self.result = 100 else: self.result = 100 + #sleep(4) self.killProc() # kill all the handler self.db.closeDBConn() - #sleep(5) + #sleep(1) else: self.result = 500 else: @@ -133,7 +136,7 @@ class doTest: return self.result - def isThere(keyword,lists): + def isThere(self,keyword,lists): x = 0 for item in lists: @@ -150,6 +153,7 @@ class doTest: gsmRZList = list() sipList = list() destList = list() + rem = list() self.db.closeDBConn() for lists in deviceLists: #define category of the device @@ -168,8 +172,10 @@ class doTest: i = random.randint(0, len(gsmRZList)-1) callTo = gsmRZList[i] self.initTest('unisip',callTo) + gsmRZList.remove(callTo) destList.remove(callTo) + self.smartResultList.append(['unisip', callTo, self.result]) @@ -184,6 +190,7 @@ class doTest: callTo = destList[i] self.initTest(callFrom,callTo) + destList.remove(callTo) destList.remove(callFrom) gsmRZList.remove(callFrom) @@ -193,16 +200,34 @@ class doTest: i = random.randint(0, len(gsmRZList)-1) # callTo = gsmRZList[i] self.initTest('landline',callTo) + - if isThere(callTo,destList) == 1: # Checking whether caller at gsmrz list in the destination list, if yes delete it. + if self.isThere(callTo,destList) == 1: # Checking whether caller at gsmrz list in the destination list, if yes delete it. destList.remove(callTo) - self.smartResultList.append(['landline', callTo, self.result]) + self.smartResultList.append(['landline', callTo, self.result]) for callTo in destList: callFrom = 'sip' self.initTest(callFrom,callTo) - - self.smartResultList.append([callFrom, callTo, self.result]) + self.smartResultList.append([callFrom, callTo, self.result]) + + #retry to call in success test to make sure tests are valid + for dest in self.smartResultList: + if int(dest[2]) == 486: + self.initTest('sip', dest[1]) + self.smartResultList.append(['sip', dest[1], self.result]) + rem.append(dest) + + caller = dest[0] # to test nanobts if the test come from RZ GSM but fehler + if caller[0:5] == 'GSMRZ': + self.initTest('sip', dest[0]) + self.smartResultList.append(['sip', dest[1], self.result]) + rem.append(dest) + + for remov in rem: + for x in self.smartResultList: + if x == remov: + self.smartResultList.remove(x) return self.smartResultList -- cgit v1.2.3-55-g7522