[rhmessaging-commits] rhmessaging commits: r2181 - mgmt/trunk/cumin/python/cumin.

rhmessaging-commits at lists.jboss.org rhmessaging-commits at lists.jboss.org
Tue Jul 8 12:16:09 EDT 2008


Author: justi9
Date: 2008-07-08 12:16:08 -0400 (Tue, 08 Jul 2008)
New Revision: 2181

Modified:
   mgmt/trunk/cumin/python/cumin/test.py
Log:
Use a temp dir for the default qpidd process output

Modified: mgmt/trunk/cumin/python/cumin/test.py
===================================================================
--- mgmt/trunk/cumin/python/cumin/test.py	2008-07-08 15:52:17 UTC (rev 2180)
+++ mgmt/trunk/cumin/python/cumin/test.py	2008-07-08 16:16:08 UTC (rev 2181)
@@ -5,6 +5,7 @@
 from threading import Thread
 from popen2 import Popen4
 from shutil import copyfileobj
+from tempfile import mkdtemp
 import qpid, quirk, wooly
 
 from cumin import Cumin
@@ -18,22 +19,23 @@
         self.path = path
         self.port = port
 
-        self.key = "cumin-test-qpidd-%i" % port
-        
+        self.temp_dir = mkdtemp()
+        self.data_dir = os.path.join(self.temp_dir, "data")
+
         self.command = (path,
                         "--port", str(port),
                         "--auth", "no",
                         "--trace",
-                        "--data-dir", self.key)
+                        "--data-dir", self.data_dir)
 
-        self.log = "%s.log" % self.key
+        self.output_path = os.path.join(self.temp_dir, "output")
 
         self.setDaemon(True)
 
     def run(self):
-        os.makedirs(self.key)
+        print "Saving qpidd output to %s" % self.temp_dir
 
-        out = open(self.log, "w")
+        out = open(self.output_path, "w")
 
         try:
             pop = Popen4(self.command)
@@ -47,7 +49,7 @@
             kpid, stat = os.waitpid(pop.pid, os.WNOHANG)
 
             if kpid == 0:
-                print "Test qpidd not killed"
+                print "Test qpidd wouldn't die"
 
 class TestEnvironment(object):
     def __init__(self, app, broker_host, broker_port, spec_path):




More information about the rhmessaging-commits mailing list