Esempio n. 1
0
    if not os.path.isdir(out_dir):
        os.makedirs(out_dir)
    out_file = str(out_dir) + "/" + str(strftime("%H-%M-%S", localtime())) + ".log"
    try:
        of = open(out_file, "w")
    except OSError, detail:
        print("Error: unable to create log file " + str(out_file) + ": " + str(detail))
        return [-1]

    old_stdout = sys.stdout
    old_stderr = sys.stderr
    sys.stdout = of
    sys.stderr = of

    # Set up paths to plfs install directories
    rs_env_init.add_plfs_paths(basedir)

    try:
        # Get all mount points
        mount_points = pcq.get_mountpoints()
        if len(mount_points) <= 0:
            raise plfsMntError("unable to get mount point.\n")

        # overall_stat informs  the user that at least one test has failed over
        # multiple mounts.
        overall_stat = "PASSED"

        # Loop through all mount points
        for mount_point in mount_points:
            # Test status. This will be printed out at the end and will be used to
            # determine if the test passed when check_results.py is called.
Esempio n. 2
0
        f.write("    fi\n")
        f.write('done\n')
        f.close()
        # Make the script executable.
        os.chmod(script, 0764)
    except (IOError, OSError), detail:
        print ("Problem with creating script " + str(script) 
            + ": " + str(detail))
        return [-1]


    # Run the script through experiment_management
    last_id = run_expr.main(['run_expr', str(common.curr_dir) + "/" + str(input_script),
        '--nprocs=' + str(common.nprocs), '--walltime=' + str(walltime), 
        '--dispatch=msub'])
    return [last_id]
    return [0]

if __name__ == "__main__":
    # If reg_test.py is being called directly, make sure the regression suite's
    # PLFS and MPI are in the appropriate environment variables. This should
    # work because test_common was already loaded.
    import rs_env_init
    rs_env_init.add_plfs_paths(common.basedir)

    result = main()
    if result[-1] > 0:
        sys.exit(0)
    else:
        sys.exit(1)