summaryrefslogtreecommitdiff
path: root/selftest/tests
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-23 23:46:34 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-24 03:19:31 +0100
commit99b4d52633a9c099c31254b6ed59122261414a67 (patch)
tree5ad37dbe16a0b7d4254b7bedfae88f4c5014e4fd /selftest/tests
parent289632f85eefe987b429f6ca8500b3a17e42ebbb (diff)
downloadsamba-99b4d52633a9c099c31254b6ed59122261414a67.tar.gz
samba-99b4d52633a9c099c31254b6ed59122261414a67.tar.bz2
samba-99b4d52633a9c099c31254b6ed59122261414a67.zip
selftest.py: Add write_krb5_conf.
Diffstat (limited to 'selftest/tests')
-rw-r--r--selftest/tests/test_samba.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/selftest/tests/test_samba.py b/selftest/tests/test_samba.py
index 60f6f7fca0..6fe1efefaf 100644
--- a/selftest/tests/test_samba.py
+++ b/selftest/tests/test_samba.py
@@ -19,11 +19,14 @@
"""Tests for selftest.target.samba."""
+from cStringIO import StringIO
+
from selftest.tests import TestCase
from selftest.target.samba import (
bindir_path,
mk_realms_stanza,
+ write_krb5_conf,
)
@@ -64,3 +67,39 @@ class MkRealmsStanzaTests(TestCase):
}
''')
+
+
+class WriteKrb5ConfTests(TestCase):
+
+ def test_simple(self):
+ f = StringIO()
+ write_krb5_conf(f, "rijk", "dnsnaam", "domein", "kdc_ipv4")
+ self.assertEquals('''\
+#Generated krb5.conf for rijk
+
+[libdefaults]
+\tdefault_realm = rijk
+\tdns_lookup_realm = false
+\tdns_lookup_kdc = false
+\tticket_lifetime = 24h
+\tforwardable = yes
+\tallow_weak_crypto = yes
+
+[realms]
+ rijk = {
+ kdc = kdc_ipv4:88
+ admin_server = kdc_ipv4:88
+ default_domain = dnsnaam
+ }
+ dnsnaam = {
+ kdc = kdc_ipv4:88
+ admin_server = kdc_ipv4:88
+ default_domain = dnsnaam
+ }
+ domein = {
+ kdc = kdc_ipv4:88
+ admin_server = kdc_ipv4:88
+ default_domain = dnsnaam
+ }
+
+''', f.getvalue())