summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/tricode
diff options
context:
space:
mode:
authorTriatmoko2011-10-20 23:09:36 +0200
committerTriatmoko2011-10-20 23:09:36 +0200
commitebf6aa92b0101b43fc3cd0e4b117287083682bc7 (patch)
tree6f6fa5349edc8ba8a221e915ff3143f55a956511 /For Weekly Test/tricode
parentmodified the controller (diff)
downloadgsm-selftest-ebf6aa92b0101b43fc3cd0e4b117287083682bc7.tar.gz
gsm-selftest-ebf6aa92b0101b43fc3cd0e4b117287083682bc7.tar.xz
gsm-selftest-ebf6aa92b0101b43fc3cd0e4b117287083682bc7.zip
trying use smart test with the website
Diffstat (limited to 'For Weekly Test/tricode')
-rwxr-xr-xFor Weekly Test/tricode/gsmselftest-website2.py3
-rwxr-xr-xFor Weekly Test/tricode/initTestClass.py52
-rwxr-xr-xFor Weekly Test/tricode/mutexTry.php2
3 files changed, 43 insertions, 14 deletions
diff --git a/For Weekly Test/tricode/gsmselftest-website2.py b/For Weekly Test/tricode/gsmselftest-website2.py
index 7689e53..66e85c6 100755
--- a/For Weekly Test/tricode/gsmselftest-website2.py
+++ b/For Weekly Test/tricode/gsmselftest-website2.py
@@ -152,6 +152,9 @@ def doAllTest():
def regularTest():
regulartest = initTestClass.doTest()
regulartest.smartTest()
+ for messages in regulartest.messageList:
+ sendResultWebsite(messages)
+ sleep(0.25)
initTrueTable(regulartest.smartResultList)
def sendResultWebsite(message):
diff --git a/For Weekly Test/tricode/initTestClass.py b/For Weekly Test/tricode/initTestClass.py
index 434d600..15a167c 100755
--- a/For Weekly Test/tricode/initTestClass.py
+++ b/For Weekly Test/tricode/initTestClass.py
@@ -9,6 +9,9 @@ from time import sleep
class doTest:
+ def __init__(self):
+ self.messageList = list()
+
def pings(self,IP):
server = PingClass.Ping(IP)
@@ -125,6 +128,7 @@ class doTest:
destList = list()
rem = list()
item = list()
+
cpgsmRZList = list()
self.db.closeDBConn()
@@ -144,12 +148,15 @@ class doTest:
#first test from university telphone network to random GSM RZ avaliable
i = random.randint(0, len(gsmRZList)-1)
callTo = gsmRZList[i]
- self.initTest('unisip',callTo)
+ callFrom = 'unisip'
+ self.initTest(callFrom,callTo)
gsmRZList.remove(callTo)
destList.remove(callTo)
- self.smartResultList.append(['unisip', callTo, self.result, 1])
+ self.smartResultList.append([callFrom, callTo, self.result, 1])
+ message = '|' + str(callFrom) + '|' + str(callTo) + '|' + str(self.result) + '|' + str(self.db.errCode)
+ self.messageList.append(message)
for callFrom in gsmRZList:
@@ -168,17 +175,21 @@ class doTest:
destList.remove(callFrom)
gsmRZList.remove(callFrom)
self.smartResultList.append([callFrom, callTo, self.result,1])
+ message = '|' + str(callFrom) + '|' + str(callTo) + '|' + str(self.result) + '|' + str(self.db.errCode)
+ self.messageList.append(message)
# test incoming call from outside rz network to gsm rz
i = random.randint(0, len(gsmRZList)-1) #
callTo = gsmRZList[i]
- self.initTest('landline',callTo)
+ callFrom = 'landline'
+ self.initTest(callFrom,callTo)
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,1])
-
+ self.smartResultList.append([callFrom, callTo, self.result,1])
+ message = '|' + str(callFrom) + '|' + str(callTo) + '|' + str(self.result) + '|' + str(self.db.errCode)
+ self.messageList.append(message)
# testing from random GSM RZ to sip
#i = random.randint(0, len(cpgsmRZList)-1) #
#callFrom = cpgsmRZList[i]
@@ -190,7 +201,8 @@ class doTest:
callFrom = 'sip'
self.initTest(callFrom, callTo)
self.smartResultList.append([callFrom, callTo, self.result,1])
-
+ message = '|' + str(callFrom) + '|' + str(callTo) + '|' + str(self.result) + '|' + str(self.db.errCode)
+ self.messageList.append(message)
#checking unsuccess call, to make sure that destination are really unreachable
for dest in self.smartResultList:
#check unsuccess call and did the test have already tried, 2 means has been check
@@ -201,8 +213,12 @@ class doTest:
if test[1] == dest[1] and int(dest[2]) == 200:
testDestination = True
if testDestination == True:
- self.initTest('sip', dest[1])
- self.smartResultList.append(['sip', dest[1], self.result,2])
+ callFrom = 'sip'
+ callTo = dest[1]
+ self.initTest(callFrom,callTo)
+ self.smartResultList.append([callFrom,callTo, self.result,2])
+ message = '|' + str(callFrom) + '|' + str(callTo) + '|' + str(self.result) + '|' + str(self.db.errCode)
+ self.messageList.append(message)
rem.append(dest)
#check unsuccess call because caller handler having problem
@@ -213,15 +229,23 @@ class doTest:
if test[1] == dest[1] and int(dest[2]) != 200:
testDestination = True
if testDestination == True:
- self.initTest('sip', dest[1])
- self.smartResultList.append(['sip', dest[1], self.result,2])
+ callFrom = 'sip'
+ callTo = dest[1]
+ self.initTest(callFrom,callTo)
+ self.smartResultList.append([callFrom,callTo, self.result,2])
+ message = '|' + str(callFrom) + '|' + str(callTo) + '|' + str(self.result) + '|' + str(self.db.errCode)
+ self.messageList.append(message)
#rem.append(dest)
caller = dest[0] # to test nanobts if the test come from RZ GSM but fehler
if caller[0:5] == 'GSMRZ' and int(dest[3]) != 2 and dest[1] != 'sip':
if int(dest[2]) == 486:
- self.initTest('sip', dest[1])
- self.smartResultList.append(['sip', dest[1], self.result,2])
+ callFrom = 'sip'
+ callTo = dest[1]
+ self.initTest(callFrom,callTo)
+ self.smartResultList.append([callFrom,callTo, self.result,2])
+ message = '|' + str(callFrom) + '|' + str(callTo) + '|' + str(self.result) + '|' + str(self.db.errCode)
+ self.messageList.append(message)
rem.append(dest)
# test to make sure nanoBTS working or not. sice probably that nanotbts seems error but actually not.
@@ -249,6 +273,8 @@ class doTest:
callFrom = cpgsmRZList[x]
self.initTest(callFrom, callTo)
self.smartResultList.append([callFrom, callTo, self.result,2])
+ message = '|' + str(callFrom) + '|' + str(callTo) + '|' + str(self.result) + '|' + str(self.db.errCode)
+ self.messageList.append(message)
item = '['+str(gsmrzResult[0])+','+str(gsmrzResult[1])+','+str(gsmrzResult[2])+','+str(1)+']'
rem.append(item)
@@ -256,7 +282,7 @@ class doTest:
for x in self.smartResultList:
if x == remov:
self.smartResultList.remove(x)
-
+
return self.smartResultList
diff --git a/For Weekly Test/tricode/mutexTry.php b/For Weekly Test/tricode/mutexTry.php
index a671a54..f577915 100755
--- a/For Weekly Test/tricode/mutexTry.php
+++ b/For Weekly Test/tricode/mutexTry.php
@@ -80,7 +80,7 @@ if ($locking == '1') //1 means nobody is on the website
{
socket_set_timeout($fp,50); //one should set the number of the longest test, so we can define the timeout function (it is the number after "$fp,")
- fwrite($fp, "START TEST"); //send command to start the tests
+ fwrite($fp, "SMART TEST"); //send command to start the tests
if(!feof($fp))
{
while(!feof($fp))