[asterisk-scf-commits] asterisk-scf/integration/testsuite.git branch "review" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Wed Jun 1 21:27:09 CDT 2011


branch "review" has been updated
       via  c95d85c1cd60f972a734551287cf7181e8066401 (commit)
      from  c6491119a8ab021b9f1e2fd0223159fae2bb4490 (commit)

Summary of changes:
 lib/python/TestSuite.py |   37 +++++++------------------------------
 1 files changed, 7 insertions(+), 30 deletions(-)


- Log -----------------------------------------------------------------
commit c95d85c1cd60f972a734551287cf7181e8066401
Author: Darren Sessions <dsessions at digium.com>
Date:   Wed Jun 1 21:27:06 2011 -0500

    and yet . . more debugging

diff --git a/lib/python/TestSuite.py b/lib/python/TestSuite.py
index 019c788..1477d67 100644
--- a/lib/python/TestSuite.py
+++ b/lib/python/TestSuite.py
@@ -13,6 +13,7 @@
 
 import os
 import sys
+import tarfile
 import xmlrpclib
 import subprocess
 
@@ -42,9 +43,12 @@ class utils():
         w.write(fd.data)
         w.close()
         installPath = installPath.replace('!!TMP!!', '%s/tmp' % cwd)
-        results = self.execute(['tar', '-xvf', '%s/tmp/%s' % (cwd, fn), '-C', '%s' % installPath], cwd, True)
-        if results['success'] == False:
-            return results
+        tar = tarfile.open('%s/tmp/%s' % (cwd, fn))
+        tar.extractall(path="%s" % installPath)
+        tar.close()
+        #results = self.execute(['tar', '-xvf', '%s/tmp/%s' % (cwd, fn), '-C', '%s' % installPath], cwd, True)
+        #if results['success'] == False:
+        #    return results
         return {'success':'True'}
 
     def rpc(self, host):
@@ -56,33 +60,6 @@ class utils():
         ipv4, ipv6 = rpc.whatAreMyIps() 
         return {'success':True, 'rpc':rpc, 'ipv4':ipv4, 'ipv6':ipv6}
 
-    def execute(self, cmd, cwd, wait=False):
-        for arg in cmd:
-            try:
-                cmd[cmd.index(arg)] = arg.replace('!!TMP!!', '%s/tmp' % cwd)
-            except:
-                pass
-
-        cmd[0] = self.which(cmd[0])
-        if os.path.exists(cmd[0]) and os.access(cmd[0], os.X_OK):
-            p = subprocess.Popen(
-                cmd,
-                bufsize=-1,
-                shell=False,
-                #stdin=subprocess.PIPE,
-                #stdout=subprocess.PIPE,
-                #stderr=subprocess.PIPE
-            )
-            p.poll()
-            if wait == True:
-                p.wait()
-            os.chdir('%s' % cwd)
-            if p.returncode:
-                return {'success':False,"msg":"Could not execute '%s'." % ' '.join(cmd)}
-        else:
-            return {'success':False,"msg":"FAILED TO EXECUTE '%s', it must exist and be executable" % ' '.join(cmd)}
-        return {'success':True}
-
     def which(self, app):
         def if_exists(fp):
             return os.path.exists(fp) and os.access(fp, os.X_OK)

-----------------------------------------------------------------------


-- 
asterisk-scf/integration/testsuite.git



More information about the asterisk-scf-commits mailing list