summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-02-26 20:39:13 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-02-26 20:52:05 +0100
commit3b738a5914765afad2be30ba3f7db11170e87012 (patch)
tree712b2932370f76164e1398dcd186afd7b04e4af3 /source4/scripting
parent16a4fa97046e0db460882c70a5c3c241daf55223 (diff)
downloadsamba-3b738a5914765afad2be30ba3f7db11170e87012.tar.gz
samba-3b738a5914765afad2be30ba3f7db11170e87012.tar.bz2
samba-3b738a5914765afad2be30ba3f7db11170e87012.zip
provision: Add tests for determine_netbios_name.
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/samba/tests/provision.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py
index 0ebe400405..a96efdf39e 100644
--- a/source4/scripting/python/samba/tests/provision.py
+++ b/source4/scripting/python/samba/tests/provision.py
@@ -24,6 +24,7 @@ from samba.provision import (
ProvisionNames,
ProvisionPaths,
ProvisionResult,
+ determine_netbios_name,
sanitize_server_role,
setup_secretsdb,
findnss,
@@ -190,3 +191,11 @@ class ProvisionResultTests(TestCase):
self.assertEquals(entries[1],
("INFO", 'Admin password: geheim'))
+
+class DetermineNetbiosNameTests(TestCase):
+
+ def test_limits_to_15(self):
+ self.assertEquals("A" * 15, determine_netbios_name("a" * 30))
+
+ def test_strips_invalid(self):
+ self.assertEquals("BLABLA", determine_netbios_name("bla/bla"))