)
    parser.add_option(
        "-r",
        "--test-failure-retry",
        action='store',
        dest="testFailureRetry",
        default=None,
        help="[Optional] Set the max retry times, when test checker is failed. "
    )
    (options, arg) = parser.parse_args()
    if not options.testCaseList:
        parser.print_help()
        sys.exit(1)

    signal.signal(signal.SIGINT, sigint_handler)

    w = WoodPecker(options)
    w.main()
    test_end_time = time.time()
    test_time = test_end_time - test_start_time
    test_time_list = str(test_time).split('.')
    print "Total test time: %s.%s (%s)\n" % (time.strftime(
        '%H:%M:%S', time.gmtime(int(
            test_time_list[0]))), test_time_list[1][:3], test_time)
    sys.exit(0)


if __name__ == '__main__':
    debug.install_runtime_tracedumper()
    main()
Beispiel #2
0
    parser = optparse.OptionParser()
    parser.add_option("-f", "--test-case", dest="testCaseList", default=None, help="[Required] Define what test cases will run.")
    parser.add_option("-c", "--test-config", dest="testConfig", default=DEFAULT_TEST_CONFIG, help="[Optional] Integration test config file. Default config file will be test-config.xml under test cases folder.")
    parser.add_option("-v", "--verbose", action='store_true', dest="verbose", help="[Optional] print output to console")
    parser.add_option("-u", "--dry-run", action='store_true', dest="dryRun", help="[Optional] Dry run test case")
    parser.add_option("-n", "--no-cleanup", action='store_true', dest="noCleanup", default=False, help="[Optional] do not execute error_cleanup(), when test case fails")
    parser.add_option("-s", "--stop-failure", action='store_true', dest="stopWhenFail", default=False, help="[Optional] Stop testing, when there is test case failure. Used to work with -n option")
    parser.add_option("-m", "--stop-failure-match", action='store', dest="stopWhenFailMatch", default=None, help="[Optional] Stop testing, when there is test case failure and test log match given string. Used to work with -n option")
    parser.add_option("-a", "--action-log", action='store_true', dest="onlyActionLog", default=False, help="[Optional] only save 'Action' log by test_util.action_logger(). test_util.test_logger() will not be saved in test case's action.log file.")
    parser.add_option("-d", "--start-debugger", action='store_true', dest="startDebugger", default=False, help="[Optional] start remote debugger with rpdb (default port 4444) at the time of exception.")
    parser.add_option("-t", "--case-timeout", action='store', dest="defaultTestCaseTimeout", default='1800', help="[Optional] test case timeout, if test case doesn't set one. The default timeout is 1800s.")
    parser.add_option("-r", "--test-failure-retry", action='store', dest="testFailureRetry", default=None, help="[Optional] Set the max retry times, when test checker is failed. ")
    (options, arg) = parser.parse_args()
    if not options.testCaseList:
        parser.print_help()
        sys.exit(1)

    signal.signal(signal.SIGINT, sigint_handler)

    w = WoodPecker(options)
    w.main()
    test_end_time = time.time()
    test_time = test_end_time - test_start_time
    test_time_list = str(test_time).split('.')
    print "Total test time: %s.%s (%s)\n" % (time.strftime('%H:%M:%S', time.gmtime(int(test_time_list[0]))), test_time_list[1][:3], test_time)
    sys.exit(0)

if __name__ == '__main__':
    debug.install_runtime_tracedumper()
    main()