def test_match_missing(self): input_data = {} input_data['hostname'] = HOSTNAME input_data['etc_cobbler_settings'] = ETC_COBBLER_CONFIG_CORRECT input_data['etc_cobbler_modules_conf'] = ETC_COBBLER_MODULES_CONF_MISSING expected = {'errors': [ 'Option module in section authentication not found in /etc/cobbler/modules.conf' ]} self.assertEquals(expected, sat5_cobbler_config.main(input_data))
def test_match_one(self): input_data = {} input_data['hostname'] = HOSTNAME input_data['etc_cobbler_settings'] = ETC_COBBLER_CONFIG_FAILING_ONE input_data['etc_cobbler_modules_conf'] = ETC_COBBLER_MODULES_CONF_CORRECT expected = {'errors': [ 'In /etc/cobbler/settings there should be \'redhat_management_server: satellite.example.com\'' ]} self.assertEquals(expected, sat5_cobbler_config.main(input_data))
def test_match_missing(self): input_data = {} input_data['hostname'] = HOSTNAME input_data['etc_cobbler_settings'] = ETC_COBBLER_CONFIG_MISSING input_data['etc_cobbler_modules_conf'] = ETC_COBBLER_MODULES_CONF_MISSING expected = {'errors': [ 'Not all of redhat_management_type, redhat_management_server and server options found in /etc/cobbler/settings', 'Option module in section authentication not found in /etc/cobbler/modules.conf' ]} self.assertEquals(expected, sat5_cobbler_config.main(input_data))
def test_match(self): input_data = {} input_data['hostname'] = HOSTNAME input_data['etc_cobbler_settings'] = ETC_COBBLER_CONFIG_FAILING input_data['etc_cobbler_modules_conf'] = ETC_COBBLER_MODULES_CONF_FAILING expected = {'errors': [ 'In /etc/cobbler/settings there should be \'redhat_management_type: "site"\'', 'In /etc/cobbler/settings there should be \'redhat_management_server: satellite.example.com\'', "In /etc/cobbler/settings there should be 'server: satellite.example.com'", "In /etc/cobbler/modules.conf there should be 'module = authn_spacewalk'" ]} self.assertEquals(expected, sat5_cobbler_config.main(input_data))
def test_no_match_noquot(self): input_data = {} input_data['hostname'] = HOSTNAME input_data['etc_cobbler_settings'] = ETC_COBBLER_CONFIG_NOQUOT input_data['etc_cobbler_modules_conf'] = ETC_COBBLER_MODULES_CONF_NOQUOT self.assertEquals(None, sat5_cobbler_config.main(input_data))