summaryrefslogtreecommitdiff
path: root/php/config/TestUtil.py
diff options
context:
space:
mode:
Diffstat (limited to 'php/config/TestUtil.py')
-rw-r--r--php/config/TestUtil.py108
1 files changed, 54 insertions, 54 deletions
diff --git a/php/config/TestUtil.py b/php/config/TestUtil.py
index 8c09d262128..78ad2024237 100644
--- a/php/config/TestUtil.py
+++ b/php/config/TestUtil.py
@@ -57,15 +57,15 @@ except getopt.GetoptError:
for o, a in opts:
if o == "--debug":
- debug = 1
+ debug = 1
if o == "--protocol":
- protocol = a
+ protocol = a
if o == "--compress":
- compress = 1
+ compress = 1
if o == "--threadPerConnection":
- threadPerConnection = 1
+ threadPerConnection = 1
if o == "--host":
- host = a
+ host = a
#
# Check for ICE_HOME
@@ -101,13 +101,13 @@ def isSolaris():
def closePipe(pipe):
try:
- status = pipe.close()
+ status = pipe.close()
except IOError, ex:
- # TODO: There's a waitpid problem on CentOS, so we have to ignore ECHILD.
- if ex.errno == errno.ECHILD:
- status = 0
- else:
- raise
+ # TODO: There's a waitpid problem on CentOS, so we have to ignore ECHILD.
+ if ex.errno == errno.ECHILD:
+ status = 0
+ else:
+ raise
return status
@@ -118,22 +118,22 @@ class ReaderThread(Thread):
def run(self):
- #print "started: " + str(self) + ": " + str(thread.get_ident())
+ #print "started: " + str(self) + ": " + str(thread.get_ident())
try:
while 1:
line = self.pipe.readline()
if not line: break
- # Suppress "adapter ready" messages. Under windows the eol isn't \n.
- if not line.endswith(" ready\n") and not line.endswith(" ready\r\n"):
- print "server: " + line,
+ # Suppress "adapter ready" messages. Under windows the eol isn't \n.
+ if not line.endswith(" ready\n") and not line.endswith(" ready\r\n"):
+ print "server: " + line,
except IOError:
pass
- self.status = closePipe(self.pipe)
- #print "terminating: " + str(self)
+ self.status = closePipe(self.pipe)
+ #print "terminating: " + str(self)
def getStatus(self):
- return self.status
+ return self.status
serverPids = []
serverThreads = []
@@ -143,18 +143,18 @@ def joinServers():
global serverThreads
global allServerThreads
for t in serverThreads:
- t.join()
- allServerThreads.append(t)
+ t.join()
+ allServerThreads.append(t)
serverThreads = []
def serverStatus():
global allServerThreads
joinServers()
for t in allServerThreads:
- status = t.getStatus()
- if status:
- print "server " + str(t) + " status: " + str(status)
- return status
+ status = t.getStatus()
+ if status:
+ print "server " + str(t) + " status: " + str(status)
+ return status
return 0
def killServers():
@@ -192,32 +192,32 @@ def getServerPid(pipe):
global serverThreads
while 1:
- output = pipe.readline().strip()
- if not output:
- print "failed!"
- killServers()
- sys.exit(1)
- if output.startswith("warning: "):
- continue
- break
+ output = pipe.readline().strip()
+ if not output:
+ print "failed!"
+ killServers()
+ sys.exit(1)
+ if output.startswith("warning: "):
+ continue
+ break
try:
- serverPids.append(int(output))
+ serverPids.append(int(output))
except ValueError:
- print "Output is not a PID: " + output
- raise
+ print "Output is not a PID: " + output
+ raise
def ignorePid(pipe):
while 1:
- output = pipe.readline().strip()
- if not output:
- print "failed!"
- killServers()
- sys.exit(1)
- if output.startswith("warning: "):
- continue
- break
+ output = pipe.readline().strip()
+ if not output:
+ print "failed!"
+ killServers()
+ sys.exit(1)
+ if output.startswith("warning: "):
+ continue
+ break
def getAdapterReady(pipe, createThread = True):
global serverThreads
@@ -231,9 +231,9 @@ def getAdapterReady(pipe, createThread = True):
# Start a thread for this server.
if createThread:
- serverThread = ReaderThread(pipe)
- serverThread.start()
- serverThreads.append(serverThread)
+ serverThread = ReaderThread(pipe)
+ serverThread.start()
+ serverThreads.append(serverThread)
def waitServiceReady(pipe, token, createThread = True):
global serverThreads
@@ -248,9 +248,9 @@ def waitServiceReady(pipe, token, createThread = True):
# Start a thread for this server.
if createThread:
- serverThread = ReaderThread(pipe)
- serverThread.start()
- serverThreads.append(serverThread)
+ serverThread = ReaderThread(pipe)
+ serverThread.start()
+ serverThreads.append(serverThread)
def printOutputFromPipe(pipe):
@@ -274,7 +274,7 @@ else:
os.environ["LD_LIBRARY_PATH_64"] = os.path.join(ice_home, "lib") + ":" + os.getenv("LD_LIBRARY_PATH_64", "")
if protocol == "ssl":
- plugin = " --Ice.Plugin.IceSSL=IceSSL:createIceSSL"
+ plugin = " --Ice.Plugin.IceSSL=IceSSL:createIceSSL"
clientProtocol = plugin + " --Ice.Default.Protocol=ssl" + \
" --IceSSL.DefaultDir=" + os.path.join(ice_home, "certs") + \
" --IceSSL.CertFile=c_rsa1024_pub.pem" + \
@@ -328,7 +328,7 @@ def clientServerTestWithOptionsAndNames(name, additionalServerOptions, additiona
print "starting " + serverName + "...",
serverCmd = server + serverOptions + additionalServerOptions
if debug:
- print "(" + serverCmd + ")",
+ print "(" + serverCmd + ")",
serverPipe = os.popen(serverCmd + " 2>&1")
getServerPid(serverPipe)
getAdapterReady(serverPipe)
@@ -337,7 +337,7 @@ def clientServerTestWithOptionsAndNames(name, additionalServerOptions, additiona
print "starting " + clientName + "...",
clientCmd = client + " -- " + clientOptions + additionalClientOptions
if debug:
- print "(" + clientCmd + ")",
+ print "(" + clientCmd + ")",
clientPipe = os.popen(clientCmd + " 2>&1")
print "ok"
@@ -345,10 +345,10 @@ def clientServerTestWithOptionsAndNames(name, additionalServerOptions, additiona
clientStatus = closePipe(clientPipe)
if clientStatus:
- killServers()
+ killServers()
if clientStatus or serverStatus():
- sys.exit(1)
+ sys.exit(1)
os.chdir(cwd)