Exemple #1
0
    def test_all_config_items_missing(self):
        """Assert behavior when all config items are missing."""
        config = {'some_meaningless_other_key': 'boring_value'}

        config = buildsys.get_krb_conf(config)

        self.assertEqual(config, {})
Exemple #2
0
    def test_krb_principal(self):
        """Assert behavior when only krb_prinicpal is present."""
        config = {'some_meaningless_other_key': 'boring_value', 'krb_principal': 'a_principal'}

        config = buildsys.get_krb_conf(config)

        self.assertEqual(config, {'principal': 'a_principal'})
Exemple #3
0
    def test_complete_config(self):
        """Assert behavior with a config that has all possible elements."""
        config = {'some_meaningless_other_key': 'boring_value', 'krb_ccache': 'a_ccache',
                  'krb_keytab': 'a_keytab', 'krb_principal': 'a_principal'}

        config = buildsys.get_krb_conf(config)

        self.assertEqual(config,
                         {'ccache': 'a_ccache', 'keytab': 'a_keytab', 'principal': 'a_principal'})
Exemple #4
0
    def test_krb_keytab(self):
        """Assert behavior when only krb_keytab is present."""
        config = {
            'some_meaningless_other_key': 'boring_value',
            'krb_keytab': 'a_keytab'
        }

        config = buildsys.get_krb_conf(config)

        assert config == {'keytab': 'a_keytab'}
Exemple #5
0
    def test_krb_ccache_uid(self):
        """Assert behavior for krb ccache uid replacement."""
        config = {
            'some_meaningless_other_key': 'boring_value',
            'krb_ccache': 'a_ccache_%{uid}'
        }

        config = buildsys.get_krb_conf(config)

        assert config == {'ccache': 'a_ccache_%d' % os.geteuid()}