summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Database/gsmselftesting.sql9
-rw-r--r--For Weekly Test/12-09-2011/DbClass.py54
-rw-r--r--For Weekly Test/12-09-2011/gsmselftest.py76
3 files changed, 43 insertions, 96 deletions
diff --git a/Database/gsmselftesting.sql b/Database/gsmselftesting.sql
index 0ce9b28..cba3741 100644
--- a/Database/gsmselftesting.sql
+++ b/Database/gsmselftesting.sql
@@ -18,7 +18,7 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `gsmselftesting`
--
-DROP DATABASE `gsmselftesting`;
+DROP DATABASE IF EXISTS `gsmselftesting`;
CREATE DATABASE `gsmselftesting` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `gsmselftesting`;
@@ -46,12 +46,13 @@ CREATE TABLE IF NOT EXISTS `DeviceAddressTable` (
INSERT INTO `DeviceAddressTable` (`deviceName`, `deviceIP`, `number`, `lastChange`, `username`, `password`, `server`) VALUES
('sip', 'localhost', '07612034661928', '2011-07-26 00:00:00', 'mpselftest1', '1mpselftest', '132.230.4.8'),
-('unisip', 'localhost', '076120397897', '2011-07-27 00:00:00', '4976120397897', 'hB8M3WyFt61C', '132.230.252.228'),
+('unisip', 'localhost', '076120397898', '2011-07-27 00:00:00', '4976120397898', 'itzEfmLkzvS9', '132.230.252.228'),
('landline', 'localhost', '076145875681', '2011-07-26 00:00:00', '1289459', 'MMW9AX', 'sipgate.de'),
('GSMRZ1', 'localhost', '07612034661xxx', '2011-07-27 15:47:08', '', '', ''),
-('GSMRZ2', '132.230.4.64', '07612034661455', '2011-07-27 15:48:04', '', '', ''),
+('GSMRZ2', 'localhost', '07612034661455', '2011-07-27 15:48:04', '', '', ''),
('GSMExt.Eplus', 'localhost', '015782677224', '2011-07-28 14:33:43', '', '', ''),
('GSMExt.Voda', 'localhost', '015252423662', '2011-07-28 14:35:33', '', '', ''),
+('GSMExt.Tm', 'localhost', '015128040906', '2011-08-29 14:47:18', '', '', ''),
('GSMExt.O2', 'localhost', '017678038038', '2011-07-28 14:36:13', '', '', '');
-- --------------------------------------------------------
@@ -132,7 +133,6 @@ CREATE TABLE IF NOT EXISTS `TaskTable` (
`taskNo` int(11) NOT NULL,
`from` varchar(15) NOT NULL,
`to` varchar(15) NOT NULL,
- `status` int(1) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`taskID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=25 ;
@@ -154,7 +154,6 @@ CREATE TABLE IF NOT EXISTS `TempTaskTable` (
`taskNo` int(11) NOT NULL,
`from` varchar(15) NOT NULL,
`to` varchar(15) NOT NULL,
- `status` int(1) NOT NULL,
PRIMARY KEY (`taskID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
diff --git a/For Weekly Test/12-09-2011/DbClass.py b/For Weekly Test/12-09-2011/DbClass.py
index f25afe2..d312b63 100644
--- a/For Weekly Test/12-09-2011/DbClass.py
+++ b/For Weekly Test/12-09-2011/DbClass.py
@@ -98,11 +98,7 @@ class DBMySQLConnection:
if self.connectionCreated == 1:
try:
successful = self.cur.execute("SELECT `deviceIP`,`number`, `username`, `password`, `server` FROM DeviceAddressTable where `deviceName`=%s", deviceName)
- output = self.cur.fetchall() #get the mysql response
- #parse the output from the mysql by creating a list
- #with lists where each attribue(column) gets independent
- #element of the list
-
+ output = self.cur.fetchall()
deviceAddr = ''
for record in output:
columns = list()
@@ -187,54 +183,6 @@ class DBMySQLConnection:
return 0
- def insertTaskIn2(self, fromDevice, toDevice, taskNo, status):
- if self.connectionCreated == 1:
- try:
- #I used here a transaction since I want the mysql to execute a few commands and tell me was it successful rather than to execute some and there happens a mistake and one part is updated and the other isn't
- newQuery = "START TRANSACTION; INSERT INTO `TaskTable` (`taskNo`, `from`, `to`, `status`) VALUES ('" + str(taskNo) + "', '" + str(fromDevice) + "', '" + str(toDevice) +"', '0'); SELECT @taskID := LAST_INSERT_ID(); INSERT INTO `TempTaskTable` (`taskID`, `taskNo`, `from`, `to`,`status` ) VALUES (@taskID, '" + str(taskNo) + "', '" + str(fromDevice) + "', '"+ str(toDevice) + "', '"+ str(status) + "'); COMMIT;"
-
-
- successful = self.cur.execute(newQuery)
- output = self.cur.fetchone()
-
-
- #without closing the cursos we get a MySQL error, the mistake is an internal mistak of the MySQLdb python library
- # self.cur.close()
- # self.cur = self.datBaseConn.cursor()
-
- while self.cur.nextset() is not None: pass
-
- newQuery1 = 'SELECT taskID FROM `TempTaskTable` ORDER BY taskID DESC LIMIT 1';
- successful1 = self.cur.execute(newQuery1)
- record = self.cur.fetchone()
-
- columns = list()
- for entry in record:
- columns.append(str(entry))
-
- columns.append(str(taskNo))
- columns.append(str(fromDevice))
- columns.append(str(toDevice))
- columns.append(str(status))
- #columns.append(str(0))
- self.tasksList.append(columns)
-
- return 1
-
- if debugMode == 1:
- print output
-
- except MySQLdb.Error, e:
- error = str(e)
- if debugMode == 1:
- print str(e)
- if error[1:5] == '1062':
- return 2 #duplicate entry for the key
- return 3
- else:
- return 0
-
-
def errorCode(self,code):
if self.connectionCreated == 1:
try:
diff --git a/For Weekly Test/12-09-2011/gsmselftest.py b/For Weekly Test/12-09-2011/gsmselftest.py
index 5f4789f..3e82b27 100644
--- a/For Weekly Test/12-09-2011/gsmselftest.py
+++ b/For Weekly Test/12-09-2011/gsmselftest.py
@@ -24,7 +24,7 @@ def ping(handler):
server = PingClass.Ping('132.230.252.228')
serverStatus = server.ping(1)
- elif handler == 'GSMRZ1':
+ elif handler == 'GSMRZ3':
server = PingClass.Ping('localhost')
serverStatus = server.ping(1)
@@ -54,7 +54,7 @@ def allPing():
server = PingClass.Ping('localhost')
gsmBox1 = server.ping(1)
- server = PingClass.Ping('132.230.4.64')
+ server = PingClass.Ping('10.4.58.241')
gsmBox2 = server.ping(1)
def initDB():
@@ -327,7 +327,6 @@ def doSipTest():
print '--SIP Part Test--'
destList = ['gsmr1','gsmr2', 'gsmr3', 'landline', 'unisip', 'GSMExt.O2', 'GSMExt.Voda', 'GSMExt.Eplus', 'GSMExt.Tm' ]
- #destList = ['landline']
for callTo in destList:
callFrom = 'sip'
@@ -360,7 +359,6 @@ def doGsmExtTest():
destList = ['GSMExt.O2', 'GSMExt.Voda', 'GSMExt.Eplus', 'GSMExt.Tm']
callList = ['sip']
- #callList = ['sip', 'GSMRZ1']
for callFrom in callList:
for callTo in destList:
@@ -383,7 +381,7 @@ def smartTest():
callerList = ['sip']
destinationList = ['SIP', 'GSMExt']
- #destinationList = ['GSMExt', 'GSMRZ', 'SIP', 'RZOutgoing']
+ #destinationList = ['GSMExt', 'GSMRZ', 'SIP', 'RZOutgoing', 'RZincoming']
for callFrom in callerList:
for destination in destinationList:
@@ -610,24 +608,10 @@ def smartTest():
initTest('GSMRZ1','unisip')
if result =='200':
-
- initTest('GSMRZ1','GSMExt.O2')
- if result =='200':
- print "Outgoing call from GSM RZ is working"
- elif result == '486':
- print "Outgoing call from GSM RZ to GSM external indicate having problem"
- else:
- print "incomplete test, GSM Handler having error, please do one more test"
+ print "Outgoing call from GSM RZ is working"
elif result == '486':
-
- initTest('GSMRZ1','GSMExt.O2')
- if result =='200':
- print "Outgoing call from GSM RZ to University telephone network indicate having problem"
- elif result == '486':
- print "Outgoing call from GSM RZ to GSM external and UTN indicate having problem"
- else:
- print "incomplete test, GSM Handler having error, please do one more test"
+ print "Outgoing call from GSM RZ to UTN indicate having problem"
else:
print "incomplete test, Handler having error, please do one more test"
else:
@@ -639,23 +623,10 @@ def smartTest():
initTest('GSMRZ1','unisip')
if result == '200':
-
- initTest('GSMRZ1','GSMExt.O2')
- if result == '200':
- print "Outgoing call from GSM RZ to Landline indicate having problem"
- elif result == '486':
- print "Outgoing call from GSM RZ to GSM External and landline indicate having problem"
- else:
- print "incomplete test, GSM Handler having error, please do one more test"
+ print "Outgoing call from GSM RZ to Landline indicate having problem"
elif result == '486':
- initTest('GSMRZ1','GSMExt.O2')
- if result == '200':
- print "Outgoing call from GSM RZ to Landline and UTN indicate having problem"
- elif result == '486':
- print "Outgoing call from GSM RZ having problem"
- else:
- print "incomplete test, GSM Handler having error, please do one more test"
+ print "Outgoing call from GSM RZ to Landline and UTN indicate having problem"
else:
print "incomplete test, Handler having error, please do one more test"
else:
@@ -665,6 +636,37 @@ def smartTest():
else:
print "No connection to SIP Gate server, check your connection"
+ elif destination == 'RZincoming':
+
+ ping('landline')
+ if serverStatus <> 0:
+ initTest('landline', 'GSMRZ1')
+
+ if result == '486':
+
+ initTest('GSMExt.O2','GSMRZ1')
+
+ if result =='200':
+ print "incoming call to GSM RZ working"
+
+ elif result == '486':
+
+ initTest('GSMExt.Voda','GSMRZ1')
+ if result =='200':
+ print "incoming call to GSM RZ working"
+ elif result == '486':
+ print "incoming call to GSM RZ notworking"
+ else:
+ print "incomplete test, GSM Handler having error, please do one more test"
+ else:
+ print "incomplete test, Handler having error, please do one more test"
+
+ elif result == '200':
+ print "incoming call to GSM RZ working"
+ else:
+ print "No connection to SIP Gate server, check your connection"
+
+
if len(sys.argv) > 1:
command = sys.argv[1]
@@ -710,8 +712,6 @@ else:
taskNo = item[1]
callFrom = item[2]
callTo = item[3]
- tried = item[4]
-
#if i == 0:
#db.updatePingResult(taskNo, sipServer, sipGate, unisip, gsmBox1, gsmBox2)