def testValidSettings(self): """ Test the check_attributes function to see if it oks good attributes """ config_file = get_test_config("managedfork/check_ok.ini") configuration = ConfigParser.SafeConfigParser() configuration.read(config_file) settings = managedfork.ManagedForkConfiguration(logger=global_logger) try: settings.parse_configuration(configuration) except Exception, e: self.fail("Received exception while parsing configuration: %s" % e)
def testServiceList(self): """ Test to make sure right services get returned """ config_file = get_test_config("managedfork/check_ok.ini") configuration = ConfigParser.SafeConfigParser() configuration.read(config_file) settings = managedfork.ManagedForkConfiguration(logger=global_logger) try: settings.parse_configuration(configuration) except Exception, e: self.fail("Received exception while parsing configuration: %s" % e)
def testParsingIgnored(self): """ Test managedfork parsing when ignored """ config_file = get_test_config("managedfork/ignored.ini") configuration = ConfigParser.SafeConfigParser() configuration.read(config_file) settings = managedfork.ManagedForkConfiguration(logger=global_logger) try: settings.parse_configuration(configuration) except Exception, e: self.fail("Received exception while parsing configuration: %s" % e)
try: settings.parse_configuration(configuration) except Exception, e: self.fail("Received exception while parsing configuration: %s" % e) services = settings.enabled_services() expected_services = set(['condor-ce', 'condor']) self.assertEqual( services, expected_services, "List of enabled services incorrect, " + "got %s but expected %s" % (services, expected_services)) config_file = get_test_config("managedfork/managedfork_disabled.ini") configuration = ConfigParser.SafeConfigParser() configuration.read(config_file) settings = managedfork.ManagedForkConfiguration(logger=global_logger) try: settings.parse_configuration(configuration) except Exception, e: self.fail("Received exception while parsing configuration: %s" % e) services = settings.enabled_services() expected_services = set() self.assertEqual( services, expected_services, "List of enabled services incorrect, " + "got %s but expected %s" % (services, expected_services)) config_file = get_test_config("managedfork/ignored.ini") configuration = ConfigParser.SafeConfigParser() configuration.read(config_file)