summaryrefslogtreecommitdiffstats
path: root/tests/test_xmlrpc/test_hostgroup_plugin.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_xmlrpc/test_hostgroup_plugin.py')
-rw-r--r--tests/test_xmlrpc/test_hostgroup_plugin.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/test_xmlrpc/test_hostgroup_plugin.py b/tests/test_xmlrpc/test_hostgroup_plugin.py
index eda5f02f8..5642b1097 100644
--- a/tests/test_xmlrpc/test_hostgroup_plugin.py
+++ b/tests/test_xmlrpc/test_hostgroup_plugin.py
@@ -32,6 +32,10 @@ hostgroup1 = u'testhostgroup1'
dn1 = DN(('cn',hostgroup1),('cn','hostgroups'),('cn','accounts'),
api.env.basedn)
+hostgroup_single = u'a'
+dn_single = DN(('cn',hostgroup_single),('cn','hostgroups'),('cn','accounts'),
+ api.env.basedn)
+
fqdn1 = u'testhost1.%s' % api.env.domain
host_dn1 = DN(('fqdn',fqdn1),('cn','computers'),('cn','accounts'),
api.env.basedn)
@@ -267,6 +271,39 @@ class test_hostgroup(Declarative):
dict(
+ desc='Create hostgroup with name containing only one letter: %r' % hostgroup_single,
+ command=('hostgroup_add', [hostgroup_single],
+ dict(description=u'Test hostgroup with single letter in name')
+ ),
+ expected=dict(
+ value=hostgroup_single,
+ summary=u'Added hostgroup "a"',
+ result=dict(
+ dn=lambda x: DN(x) == dn_single,
+ cn=[hostgroup_single],
+ objectclass=objectclasses.hostgroup,
+ description=[u'Test hostgroup with single letter in name'],
+ ipauniqueid=[fuzzy_uuid],
+ mepmanagedentry=lambda x: [DN(i) for i in x] == \
+ [DN(('cn',hostgroup_single),('cn','ng'),('cn','alt'),
+ api.env.basedn)],
+ ),
+ ),
+ ),
+
+
+ dict(
+ desc='Delete %r' % hostgroup_single,
+ command=('hostgroup_del', [hostgroup_single], {}),
+ expected=dict(
+ value=hostgroup_single,
+ summary=u'Deleted hostgroup "a"',
+ result=dict(failed=u''),
+ ),
+ ),
+
+
+ dict(
desc='Delete host %r' % fqdn1,
command=('host_del', [fqdn1], {}),
expected=dict(