def _getConfig(self): """ Manages the configuration wrapper of a test case """ a = self.__class__ if not hasattr(self, "_confDict"): template = self.getConfigTemplate() expandedCfg = _expandGlobalCfg(template, self._cfg) confDict = confUtils.conf2dict(template, expandedCfg) setattr(self, "_confDict", confDict) return self._confDict
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))
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))