예제 #1
0
def runBatch(confFile, options):
    """
    Run a batch test as stated in a config file.
    """
    # Try to load config file
    mycfg = {}
    batchcfg = {}
    output = sys.stdout
    try:
        output.write("Validating configuration file '%s'.\n" % (os.path.split(confFile)[1]))
        output.flush()
        confUtils.validateConfigFile(CONFIG_TEMPLATE, confFile)
        output.write("Loading RUTH configuration.\n")
        batchcfg = ConfigParser()
        batchcfg.read(confFile)
        mycfg = confUtils.conf2dict(CONFIG_TEMPLATE, batchcfg)
    except Exception, ex:
        raise Exception("Could not load config file '%s'. Bailing out from batch. (%s: %s)" % (confFile, ex.__class__.__name__, ex))
예제 #2
0
def validateSuiteConfig(suite, cfg):
    """
    Validate a config against a suite. Validates that all the test cases in the suite have
    all the options they need in the configuration file.

    To be used by most ruth modules.

    :returns: a touple of ``(result, message)``.
    """
    masterTemplate = generateTemplateFromSuite(suite)
    cfg = _expandGlobalCfg(masterTemplate, cfg)
    return confUtils.validateConfigFile(masterTemplate, cfg)
예제 #3
0
def validateSuiteConfig(suite, cfg):
    """
    Validate a config against a suite. Validates that all the test cases in the suite have
    all the options they need in the configuration file.

    To be used by most ruth modules.

    :returns: a touple of ``(result, message)``.
    """
    masterTemplate = generateTemplateFromSuite(suite)
    cfg = _expandGlobalCfg(masterTemplate, cfg)
    return confUtils.validateConfigFile(masterTemplate, cfg)
예제 #4
0
def runBatch(confFile, options):
    """
    Run a batch test as stated in a config file.
    """
    # Try to load config file
    mycfg = {}
    batchcfg = {}
    output = sys.stdout
    try:
        output.write("Validating configuration file '%s'.\n" %
                     (os.path.split(confFile)[1]))
        output.flush()
        confUtils.validateConfigFile(CONFIG_TEMPLATE, confFile)
        output.write("Loading RUTH configuration.\n")
        batchcfg = ConfigParser()
        batchcfg.read(confFile)
        mycfg = confUtils.conf2dict(CONFIG_TEMPLATE, batchcfg)
    except Exception, ex:
        raise Exception(
            "Could not load config file '%s'. Bailing out from batch. (%s: %s)"
            % (confFile, ex.__class__.__name__, ex))