diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2012-03-23 23:46:19 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2012-03-24 03:19:31 +0100 |
commit | 289632f85eefe987b429f6ca8500b3a17e42ebbb (patch) | |
tree | 2d98d41fd42ea42194f64ce1d7a2e752e570380a /selftest/tests | |
parent | f18d9e147d4a242cdfb31a816d91d277b99badae (diff) | |
download | samba-289632f85eefe987b429f6ca8500b3a17e42ebbb.tar.gz samba-289632f85eefe987b429f6ca8500b3a17e42ebbb.tar.bz2 samba-289632f85eefe987b429f6ca8500b3a17e42ebbb.zip |
selftest.py: Add mk_realms_stanza function.
Diffstat (limited to 'selftest/tests')
-rw-r--r-- | selftest/tests/test_samba.py | 34 |
1 files changed, 31 insertions, 3 deletions
diff --git a/selftest/tests/test_samba.py b/selftest/tests/test_samba.py index d3da930553..60f6f7fca0 100644 --- a/selftest/tests/test_samba.py +++ b/selftest/tests/test_samba.py @@ -21,7 +21,10 @@ from selftest.tests import TestCase -from selftest.target.samba import bindir_path +from selftest.target.samba import ( + bindir_path, + mk_realms_stanza, + ) class BinDirPathTests(TestCase): @@ -33,6 +36,31 @@ class BinDirPathTests(TestCase): bindir_path({"exe": "ls"}, "/bin", "exe")) def test_no_mapping(self): - self.assertEquals("exe", bindir_path({}, "/some/path", "exe")) - self.assertEquals("/bin/ls", + self.assertEqual("exe", bindir_path({}, "/some/path", "exe")) + self.assertEqual("/bin/ls", bindir_path({}, "/bin", "ls")) + + +class MkRealmsStanzaTests(TestCase): + + def test_basic(self): + self.assertEqual( + mk_realms_stanza("rijk", "dnsnaam", "domein", "ipv4_kdc"), + '''\ + rijk = { + kdc = ipv4_kdc:88 + admin_server = ipv4_kdc:88 + default_domain = dnsnaam + } + dnsnaam = { + kdc = ipv4_kdc:88 + admin_server = ipv4_kdc:88 + default_domain = dnsnaam + } + domein = { + kdc = ipv4_kdc:88 + admin_server = ipv4_kdc:88 + default_domain = dnsnaam + } + +''') |