Exemple #1
0
    def run_single_command(self, script, param=None):
        """
        Run a single command using the shell.
        """
        cmd = script
        if param is not None and param != '':
            cmd += ' ' + param

        print("Running '%s' shell command" % cmd)
        uos.system(cmd)
Exemple #2
0
 def download(url, local_name):
     if debug:
         print("wget -q %s -O %s" % (url, local_name))
     rc = os.system("wget -q %s -O %s" % (url, local_name))
     if local_name not in cleanup_files:
         cleanup_files.append(local_name)
     if rc == 8 * 256:
         raise NotFoundError
    if test.startswith("native"):
        return True
    if test.startswith("viper"):
        return True


test_count = 0
passed_count = 0
skip_count = 0

for suite in tests:
    #print("Running in: %s" % suite)
    if sys.platform == 'win32':
        # dir /b prints only contained filenames, one on a line
        # http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/dir.mspx
        r = os.system("dir /b %s/*.py >tests.lst" % suite)
    else:
        r = os.system("ls %s/*.py | xargs -n1 basename >tests.lst" % suite)
    assert r == 0

    with open("tests.lst") as f:
        testcases = f.readlines()
        testcases = [l[:-1] for l in testcases]
    assert testcases, "No tests found in dir '%s', which is implausible" % suite
    #print(testcases)
    for t in testcases:
        if t == "native_check.py":
            continue

        qtest = "%s/%s" % (suite, t)
Exemple #4
0
def gzdecompress_(package_fname):
    os.system("gzip -d -c %s > ungz" % package_fname)
    with open("ungz", "rb") as f:
        return f.read()