summaryrefslogtreecommitdiffstats
path: root/For Weekly Test/12-09-2011
diff options
context:
space:
mode:
authorgsmselgtest2011-08-31 16:45:13 +0200
committergsmselgtest2011-08-31 16:45:13 +0200
commit5b6356f53a1c04332e680463ac9bfb2f26b85f23 (patch)
tree43379fb02be722eb630c58b3fe5ba5d9c5569506 /For Weekly Test/12-09-2011
parenttrue table done (diff)
downloadgsm-selftest-5b6356f53a1c04332e680463ac9bfb2f26b85f23.tar.gz
gsm-selftest-5b6356f53a1c04332e680463ac9bfb2f26b85f23.tar.xz
gsm-selftest-5b6356f53a1c04332e680463ac9bfb2f26b85f23.zip
ssh tunneling add
Diffstat (limited to 'For Weekly Test/12-09-2011')
-rw-r--r--For Weekly Test/12-09-2011/ControllerClass.py16
-rw-r--r--For Weekly Test/12-09-2011/ControllerClass.pycbin7153 -> 7102 bytes
-rw-r--r--For Weekly Test/12-09-2011/DbClass.pycbin7612 -> 7002 bytes
-rw-r--r--For Weekly Test/12-09-2011/SSHTunnelBox1Class.py42
-rw-r--r--For Weekly Test/12-09-2011/SSHTunnelBox2Class.py42
-rw-r--r--For Weekly Test/12-09-2011/SSHTunnelClass.py47
-rw-r--r--For Weekly Test/12-09-2011/TestProcessLog.log21
-rw-r--r--For Weekly Test/12-09-2011/gsmselftest.py4
8 files changed, 169 insertions, 3 deletions
diff --git a/For Weekly Test/12-09-2011/ControllerClass.py b/For Weekly Test/12-09-2011/ControllerClass.py
index 065f070..45f415d 100644
--- a/For Weekly Test/12-09-2011/ControllerClass.py
+++ b/For Weekly Test/12-09-2011/ControllerClass.py
@@ -1,7 +1,8 @@
import sys
import os
import subprocess
-
+import SSHTunnelBox1Class
+import SSHTunnelBox2Class
import ClientClass
import LogFileClass
@@ -121,9 +122,13 @@ class doTheTest:
elif self.callFrom =="GSMRZ2":
self.portCaller = 50008
+ box1 = SHTunnelBox1Class.SSHTunneling(50000, 50008, '10.4.58.241', 'lsfks', 'r')
+ box1.startTunneling()
elif self.callFrom =="GSMRZ3":
self.portCaller = 50009
+ box2 = SHTunnelBox2Class.SSHTunneling(50000, 50009, '10.4.58.241', 'lsfks', 'r')#ip??
+ box2.startTunneling()
elif self.callFrom =="GSMExt.O2":
self.portCaller = 50010
@@ -160,9 +165,14 @@ class doTheTest:
elif self.dest =="GSMRZ2":
self.portDest = 50008
+ box1 = SHTunnelBox1Class.SSHTunneling(50000, 50008, '10.4.58.241', 'lsfks', 'r')
+ box1.startTunneling()
elif self.dest =="GSMRZ3":
self.portDest = 50009
+ box2 = SHTunnelBox2Class.SSHTunneling(50000, 50009, '10.4.58.241', 'lsfks', 'r')#ip??
+ box2.startTunneling()
+
elif self.dest =="GSMExt.O2":
self.portDest = 50010
@@ -191,6 +201,10 @@ class doTheTest:
def initTerminate(self):
self.caller.sendData('TERMINATE CONNECTION')
self.receiver.sendData('TERMINATE CONNECTION')
+ if self.dest =="GSMRZ2" or self.callFrom =="GSMRZ2":
+ box1.killTunneling()
+ if self.dest =="GSMRZ3" or self.callFrom =="GSMRZ3":
+ box2.killTunneling()
def callerGreeting(self):
self.connected = None
diff --git a/For Weekly Test/12-09-2011/ControllerClass.pyc b/For Weekly Test/12-09-2011/ControllerClass.pyc
index ce084e1..ae0ddd1 100644
--- a/For Weekly Test/12-09-2011/ControllerClass.pyc
+++ b/For Weekly Test/12-09-2011/ControllerClass.pyc
Binary files differ
diff --git a/For Weekly Test/12-09-2011/DbClass.pyc b/For Weekly Test/12-09-2011/DbClass.pyc
index 5d4f4ce..325aa87 100644
--- a/For Weekly Test/12-09-2011/DbClass.pyc
+++ b/For Weekly Test/12-09-2011/DbClass.pyc
Binary files differ
diff --git a/For Weekly Test/12-09-2011/SSHTunnelBox1Class.py b/For Weekly Test/12-09-2011/SSHTunnelBox1Class.py
new file mode 100644
index 0000000..408367e
--- /dev/null
+++ b/For Weekly Test/12-09-2011/SSHTunnelBox1Class.py
@@ -0,0 +1,42 @@
+#Here is a tutorial how to generate and copy your RSA SSH public key :)
+#>>> http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
+import subprocess
+
+class SSHTunneling:
+
+ def __init__(self, localPort, remotePort, remoteServer, username, password):
+ self.lPort = localPort
+ self.rPort = remotePort
+ self.rServer = remoteServer
+
+ self.usern = username
+ self.passw = password
+
+ self.__tunnelStarted = 0
+ self.__sshTunnel = 1
+
+ def startTunneling(self):
+ if self.__tunnelStarted == 0:
+ command = str(self.lPort) + ':' + self.rServer + ':' + str(self.rPort)
+ uad = self.usern + '@' + self.rServer
+
+ try:
+ self.__sshTunnel = subprocess.Popen(['ssh','-p','7884','-N', '-L', command, uad], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.__tunnelStarted = 1
+ return 1
+ except Exception, e:
+ print str(e)
+ return 0
+
+ def killTunneling(self):
+ if self.__tunnelStarted == 1:
+ try:
+ self.__sshTunnel.kill()
+ self.__tunnelStarted = 0
+ return 1
+
+ except Exception, e:
+ print str(e)
+ return 0
+
+
diff --git a/For Weekly Test/12-09-2011/SSHTunnelBox2Class.py b/For Weekly Test/12-09-2011/SSHTunnelBox2Class.py
new file mode 100644
index 0000000..408367e
--- /dev/null
+++ b/For Weekly Test/12-09-2011/SSHTunnelBox2Class.py
@@ -0,0 +1,42 @@
+#Here is a tutorial how to generate and copy your RSA SSH public key :)
+#>>> http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
+import subprocess
+
+class SSHTunneling:
+
+ def __init__(self, localPort, remotePort, remoteServer, username, password):
+ self.lPort = localPort
+ self.rPort = remotePort
+ self.rServer = remoteServer
+
+ self.usern = username
+ self.passw = password
+
+ self.__tunnelStarted = 0
+ self.__sshTunnel = 1
+
+ def startTunneling(self):
+ if self.__tunnelStarted == 0:
+ command = str(self.lPort) + ':' + self.rServer + ':' + str(self.rPort)
+ uad = self.usern + '@' + self.rServer
+
+ try:
+ self.__sshTunnel = subprocess.Popen(['ssh','-p','7884','-N', '-L', command, uad], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.__tunnelStarted = 1
+ return 1
+ except Exception, e:
+ print str(e)
+ return 0
+
+ def killTunneling(self):
+ if self.__tunnelStarted == 1:
+ try:
+ self.__sshTunnel.kill()
+ self.__tunnelStarted = 0
+ return 1
+
+ except Exception, e:
+ print str(e)
+ return 0
+
+
diff --git a/For Weekly Test/12-09-2011/SSHTunnelClass.py b/For Weekly Test/12-09-2011/SSHTunnelClass.py
new file mode 100644
index 0000000..12bedeb
--- /dev/null
+++ b/For Weekly Test/12-09-2011/SSHTunnelClass.py
@@ -0,0 +1,47 @@
+#Here is a tutorial how to generate and copy your RSA SSH public key :)
+#>>> http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
+import subprocess
+
+class SSHTunneling:
+
+ def __init__(self, localPort, remotePort, remoteServer, username, password):
+ self.lPort = localPort
+ self.rPort = remotePort
+ self.rServer = remoteServer
+
+ self.usern = username
+ self.passw = password
+
+ self.__tunnelStarted = 0
+ self.__sshTunnel = 1
+
+ def startTunneling(self):
+ if self.__tunnelStarted == 0:
+ command = str(self.lPort) + ':' + self.rServer + ':' + str(self.rPort)
+ uad = self.usern + '@' + self.rServer
+
+ try:
+ self.__sshTunnel = subprocess.Popen(['ssh','-p','7884','-N', '-L', command, uad], stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+ self.__tunnelStarted = 1
+ return 1
+ except Exception, e:
+ print str(e)
+ return 0
+
+ def killTunneling(self):
+ if self.__tunnelStarted == 1:
+ try:
+ self.__sshTunnel.kill()
+ self.__tunnelStarted = 0
+ return 1
+
+ except Exception, e:
+ print str(e)
+ return 0
+
+x = SSHTunneling(50000, 50008, '10.4.58.241', 'lsfks', 'r')
+print x.startTunneling()
+print 'Tunnel started '
+sleep(50)
+print x.killTunneling()
+print 'kill tunnel'
diff --git a/For Weekly Test/12-09-2011/TestProcessLog.log b/For Weekly Test/12-09-2011/TestProcessLog.log
index 37f795d..281d9d0 100644
--- a/For Weekly Test/12-09-2011/TestProcessLog.log
+++ b/For Weekly Test/12-09-2011/TestProcessLog.log
@@ -2627,3 +2627,24 @@ On: 2011-08-29 17:28:41.497286 Event: Receiver handler : Ready
On: 2011-08-29 17:28:41.497315 Event: Start Call
On: 2011-08-29 17:28:41.497365 Event: Waiting Feedback
On: 2011-08-29 17:28:54.416778 Event: Test Succeed
+
+
+------------------STARTED THE LOGGING 2011-08-31 15:37:15.507315 ------------------
+On: 2011-08-31 15:37:15.507391 Event: init Caller
+On: 2011-08-31 15:37:15.507411 Event: GSMRZ2
+On: 2011-08-31 15:37:17.510321 Event: Connected to Caller Handler
+On: 2011-08-31 15:37:17.512205 Event: 999 General Handler Error: Could not connect to Caller handler
+
+
+------------------STARTED THE LOGGING 2011-08-31 15:38:08.227638 ------------------
+On: 2011-08-31 15:38:08.227714 Event: init Caller
+On: 2011-08-31 15:38:08.227733 Event: GSMRZ2
+On: 2011-08-31 15:38:10.230628 Event: Connected to Caller Handler
+On: 2011-08-31 15:38:10.232532 Event: 999 General Handler Error: Could not connect to Caller handler
+
+
+------------------STARTED THE LOGGING 2011-08-31 15:38:24.083483 ------------------
+On: 2011-08-31 15:38:24.083561 Event: init Caller
+On: 2011-08-31 15:38:24.083581 Event: GSMRZ2
+On: 2011-08-31 15:38:26.086472 Event: Cannt connect to Caller
+On: 2011-08-31 15:38:26.086524 Event: 999 General Handler Error: Could not connect to Caller handler
diff --git a/For Weekly Test/12-09-2011/gsmselftest.py b/For Weekly Test/12-09-2011/gsmselftest.py
index 14a91ee..5f4789f 100644
--- a/For Weekly Test/12-09-2011/gsmselftest.py
+++ b/For Weekly Test/12-09-2011/gsmselftest.py
@@ -29,7 +29,7 @@ def ping(handler):
serverStatus = server.ping(1)
elif handler == 'GSMRZ2':
- server = PingClass.Ping('132.230.4.64')
+ server = PingClass.Ping('10.4.58.241')
serverStatus = server.ping(1)
else:
serverStatus = 1
@@ -95,7 +95,6 @@ def initTest(callFrom,callTo):
makeTest.FuncTest()
result = str(makeTest.testResult)
- repeatTest = makeTest.repeatTest
else:
print "No connection to Database"
@@ -111,6 +110,7 @@ def initTrueTable():
vodaCard = None
tmobileCard = None
outgoingLandline = None
+ asteriskServer = None
for x in resultsList: