示例#1
0
def must_fail_routine(bunch_name, verification_fcn, bunch_params=None):
    if not isinstance(bunch_name, basestring):
        bunch_dir = " ".join(map(lambda b: join(BUNCHES, b), bunch_name))
    else:
        bunch_dir = join(BUNCHES, bunch_name)
    bunch_params = "" if bunch_params is None else bunch_params
    cmdline = "bunch {bunch_params} {bunch} {result}".format(
        bunch=bunch_dir, result=RESULT_DIR, bunch_params=bunch_params)

    code, out, err = run_bunch_cli(cmdline)
    bunch_deployment = join(RESULT_DIR, "".join(bunch_name))
    with open(bunch_deployment + "_console.log", 'w') as f:
        f.write(out)
    verification_fcn(code, out, err, bunch_deployment)
示例#2
0
def fixtures_routine(bunch_name, pattern, bunch_params=None):
    bunch_dir = join(BUNCHES, bunch_name)
    bunch_params = "" if bunch_params is None else bunch_params
    cmdline = "bunch {bunch_params} {bunch} {result}".format(
        bunch=bunch_dir,
        result=RESULT_DIR,
        bunch_params=bunch_params)

    code, out, err = run_bunch_cli(cmdline)
    assert_equals(code, 0, "Return code nonzero")
    assert_equals(err, "", "stderr is not empty: \n%s" % err)
    with open(join(RESULT_DIR, bunch_name+"_console.log"), 'w') as f:
        f.write(out)
    assert_feature_matches(out, pattern)
def checklist_plugin_routine(bunch_name, verification_fcn, bunch_params=None):
    if not isinstance(bunch_name, basestring):
        bunch_dir = " ".join(map(lambda b: join(BUNCHES, b),bunch_name))
    else:
        bunch_dir = join(BUNCHES, bunch_name)
    bunch_params = "" if bunch_params is None else bunch_params
    cmdline = "bunch {bunch_params} {bunch} {result}".format(
        bunch=bunch_dir,
        result=RESULT_DIR,
        bunch_params="{xtra} {plugin}".format(xtra=bunch_params, plugin=PLUGIN_PARAMS))

    code, out, err = run_bunch_cli(cmdline)
    bunch_deployment = join(RESULT_DIR, "".join(bunch_name))
    with open(bunch_deployment + "_console.log", 'w') as f:
        f.write(out)
    verification_fcn(code, out, err, bunch_deployment, load_last_result_data())
def must_fail_routine(bunch_name, verification_fcn, bunch_params=None):
    if not isinstance(bunch_name, basestring):
        bunch_dir = " ".join(map(lambda b: join(BUNCHES, b),bunch_name))
    else:
        bunch_dir = join(BUNCHES, bunch_name)
    bunch_params = "" if bunch_params is None else bunch_params
    cmdline = "bunch {bunch_params} {bunch} {result}".format(
        bunch=bunch_dir,
        result=RESULT_DIR,
        bunch_params=bunch_params)

    code, out, err = run_bunch_cli(cmdline)
    bunch_deployment = join(RESULT_DIR, "".join(bunch_name))
    with open(bunch_deployment + "_console.log", 'w') as f:
        f.write(out)
    verification_fcn(code, out, err, bunch_deployment)
示例#5
0
def fixtures_routine(bunch_name, pattern, bunch_params=None):
    if not isinstance(bunch_name, basestring):
        bunch_dir = " ".join(map(lambda b: join(BUNCHES, b),bunch_name))
    else:
        bunch_dir = join(BUNCHES, bunch_name)
    bunch_params = "" if bunch_params is None else bunch_params
    cmdline = "bunch {bunch_params} {bunch} {result}".format(
        bunch=bunch_dir,
        result=RESULT_DIR,
        bunch_params=bunch_params)

    code, out, err = run_bunch_cli(cmdline)
    assert_equals(code, 0, "Return code nonzero")
    assert_equals(err, "", "stderr is not empty: \n%s" % err)
    with open(join(RESULT_DIR, "".join(bunch_name)+"_console.log"), 'w') as f:
        f.write(out)
    assert_feature_matches(out, pattern)
示例#6
0
def checklist_plugin_routine(bunch_name, verification_fcn, bunch_params=None):
    if not isinstance(bunch_name, basestring):
        bunch_dir = " ".join(map(lambda b: join(BUNCHES, b), bunch_name))
    else:
        bunch_dir = join(BUNCHES, bunch_name)
    bunch_params = "" if bunch_params is None else bunch_params
    cmdline = "bunch {bunch_params} {bunch} {result}".format(
        bunch=bunch_dir,
        result=RESULT_DIR,
        bunch_params="{xtra} {plugin}".format(xtra=bunch_params,
                                              plugin=PLUGIN_PARAMS))

    code, out, err = run_bunch_cli(cmdline)
    bunch_deployment = join(RESULT_DIR, "".join(bunch_name))
    with open(bunch_deployment + "_console.log", 'w') as f:
        f.write(out)
    verification_fcn(code, out, err, bunch_deployment, load_last_result_data())