def test_getMaxJobsTable_nofile(self): try: workspace = Workspace(vomap = self.vomap) cfgfile = workspace.getConfigurationFile() config = DynSchedUtils.readConfigurationFromFile(cfgfile) result = DynSchedUtils.getMaxJobsTable(config) except DynSchedUtils.UtilsException, test_error: msg = str(test_error) self.assertTrue(msg.startswith("Error running"))
def test_getMaxJobsTable_ok(self): workspace = Workspace(vomap = self.vomap) workspace.setMaxJobCmd(self.mjTable) cfgfile = workspace.getConfigurationFile() config = DynSchedUtils.readConfigurationFromFile(cfgfile) result = DynSchedUtils.getMaxJobsTable(config) self.assertTrue('atlas' in result and result['atlas'] == 50 and 'dteam' in result and result['dteam'] == 150 and 'infngrid' in result and result['infngrid'] == 360)
def test_getMaxJobsTable_wrongexit(self): try: workspace = Workspace(vomap = self.vomap) script = """#!/bin/bash exit 1 """ workspace.setMaxJobCmd(script) cfgfile = workspace.getConfigurationFile() config = DynSchedUtils.readConfigurationFromFile(cfgfile) result = DynSchedUtils.getMaxJobsTable(config) except DynSchedUtils.UtilsException, test_error: msg = str(test_error) self.assertTrue(msg.startswith("VO max jobs backend command returned"))