summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--tests/test_xmlrpc/test_automount_plugin.py28
-rw-r--r--tests/test_xmlrpc/test_group_plugin.py4
-rw-r--r--tests/test_xmlrpc/test_host_plugin.py4
-rw-r--r--tests/test_xmlrpc/test_hostgroup_plugin.py4
-rw-r--r--tests/test_xmlrpc/test_netgroup_plugin.py2
-rw-r--r--tests/test_xmlrpc/test_user_plugin.py4
-rw-r--r--tests/test_xmlrpc/xmlrpc_test.py13
8 files changed, 37 insertions, 26 deletions
diff --git a/Makefile b/Makefile
index b47d9bc8f..55f9fbebc 100644
--- a/Makefile
+++ b/Makefile
@@ -59,9 +59,7 @@ install: all server-install
done
test:
- @for subdir in $(SUBDIRS); do \
- (cd $$subdir && $(MAKE) $@) || exit 1; \
- done
+ ./make-test
release-update:
if [ ! -e RELEASE ]; then echo 0 > RELEASE; fi
diff --git a/tests/test_xmlrpc/test_automount_plugin.py b/tests/test_xmlrpc/test_automount_plugin.py
index fde86629f..4f9b9fdca 100644
--- a/tests/test_xmlrpc/test_automount_plugin.py
+++ b/tests/test_xmlrpc/test_automount_plugin.py
@@ -24,18 +24,18 @@ Test the `ipalib/plugins/f_automount' module.
import sys
from xmlrpc_test import XMLRPC_test
from ipalib import api
-from ipalib import errors
+from ipalib import errors2
class test_Service(XMLRPC_test):
"""
Test the `f_automount` plugin.
"""
- mapname='testmap'
- keyname='testkey'
- keyname2='secondkey'
- description='description of map'
- info='ro'
+ mapname=u'testmap'
+ keyname=u'testkey'
+ keyname2=u'secondkey'
+ description=u'description of map'
+ info=u'ro'
map_kw={'automountmapname': mapname, 'description': description}
key_kw={'automountmapname': mapname, 'automountkey': keyname, 'automountinformation': info}
key_kw2={'automountmapname': mapname, 'automountkey': keyname2, 'automountinformation': info}
@@ -116,8 +116,8 @@ class test_Service(XMLRPC_test):
"""
Test the `xmlrpc.automount_modkey` method.
"""
- self.key_kw['automountinformation'] = 'rw'
- self.key_kw['description'] = 'new description'
+ self.key_kw['automountinformation'] = u'rw'
+ self.key_kw['description'] = u'new description'
res = api.Command['automount_modkey'](**self.key_kw)
assert res
assert res.get('automountkey','') == self.keyname
@@ -128,11 +128,11 @@ class test_Service(XMLRPC_test):
"""
Test the `xmlrpc.automount_modmap` method.
"""
- self.map_kw['description'] = 'new description'
+ self.map_kw['description'] = u'new description'
res = api.Command['automount_modmap'](**self.map_kw)
assert res
assert res.get('automountmapname','') == self.mapname
- assert res.get('description','') == 'new description'
+ assert res.get('description','') == u'new description'
def test_remove1key(self):
"""
@@ -182,10 +182,10 @@ class test_Indirect(XMLRPC_test):
"""
Test the `f_automount` plugin Indirect map function.
"""
- mapname='auto.home'
- keyname='/home'
- parentmap='auto.master'
- description='Home directories'
+ mapname=u'auto.home'
+ keyname=u'/home'
+ parentmap=u'auto.master'
+ description=u'Home directories'
map_kw={'automountkey': keyname, 'parentmap': parentmap, 'description': description}
def test_add_indirect(self):
diff --git a/tests/test_xmlrpc/test_group_plugin.py b/tests/test_xmlrpc/test_group_plugin.py
index 2cd6bdf13..23c9b0504 100644
--- a/tests/test_xmlrpc/test_group_plugin.py
+++ b/tests/test_xmlrpc/test_group_plugin.py
@@ -78,7 +78,7 @@ class test_Group(XMLRPC_test):
Test the `xmlrpc.group_add_member` with a non-existent member
"""
kw={}
- kw['groups'] = "notfound"
+ kw['groups'] = u"notfound"
res = api.Command['group_add_member'](self.cn, **kw)
# an error isn't thrown, the list of failed members is returned
assert res != []
@@ -137,7 +137,7 @@ class test_Group(XMLRPC_test):
Test the `xmlrpc.group_remove_member` method with non-member
"""
kw={}
- kw['groups'] = "notfound"
+ kw['groups'] = u"notfound"
# an error isn't thrown, the list of failed members is returned
res = api.Command['group_remove_member'](self.cn, **kw)
assert res != []
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py
index 35fbc4d4d..2529868c5 100644
--- a/tests/test_xmlrpc/test_host_plugin.py
+++ b/tests/test_xmlrpc/test_host_plugin.py
@@ -24,14 +24,14 @@ Test the `ipalib/plugins/f_host` module.
import sys
from xmlrpc_test import XMLRPC_test
from ipalib import api
-from ipalib import errors
+from ipalib import errors2
class test_Host(XMLRPC_test):
"""
Test the `f_host` plugin.
"""
- cn = api.env.host.decode('UTF-8')
+ cn = u'ipatesthost.%s' % api.env.domain
description = u'Test host'
localityname = u'Undisclosed location'
kw={'cn': cn, 'description': description, 'localityname': localityname}
diff --git a/tests/test_xmlrpc/test_hostgroup_plugin.py b/tests/test_xmlrpc/test_hostgroup_plugin.py
index 54e978c8e..4b0d65925 100644
--- a/tests/test_xmlrpc/test_hostgroup_plugin.py
+++ b/tests/test_xmlrpc/test_hostgroup_plugin.py
@@ -24,7 +24,7 @@ Test the `ipalib/plugins/f_hostgroup` module.
import sys
from xmlrpc_test import XMLRPC_test
from ipalib import api
-from ipalib import errors
+from ipalib import errors2
class test_Host(XMLRPC_test):
@@ -35,7 +35,7 @@ class test_Host(XMLRPC_test):
description=u'Test host group'
kw={'cn': cn, 'description': description}
- host_cn = api.env.host.decode('UTF-8')
+ host_cn = u'ipatesthost.%s' % api.env.domain
host_description = u'Test host'
host_localityname = u'Undisclosed location'
diff --git a/tests/test_xmlrpc/test_netgroup_plugin.py b/tests/test_xmlrpc/test_netgroup_plugin.py
index e3ca8ddb0..33c7b419a 100644
--- a/tests/test_xmlrpc/test_netgroup_plugin.py
+++ b/tests/test_xmlrpc/test_netgroup_plugin.py
@@ -45,7 +45,7 @@ class test_Netgroup(XMLRPC_test):
ng_description=u'Netgroup'
ng_kw={'cn': ng_cn, 'description': ng_description}
- host_cn = api.env.host.decode('UTF-8')
+ host_cn = u'ipatesthost.%s' % api.env.domain
host_description=u'Test host'
host_localityname=u'Undisclosed location'
host_kw={'cn': host_cn, 'description': host_description, 'localityname': host_localityname}
diff --git a/tests/test_xmlrpc/test_user_plugin.py b/tests/test_xmlrpc/test_user_plugin.py
index da2df4bc8..200511401 100644
--- a/tests/test_xmlrpc/test_user_plugin.py
+++ b/tests/test_xmlrpc/test_user_plugin.py
@@ -75,8 +75,8 @@ class test_User(XMLRPC_test):
"""
Test the `xmlrpc.user_find` method with all attributes.
"""
- kw={'uid':self.uid, 'all': True}
- res = api.Command['user_find'](**kw)
+ kw={'all': True}
+ res = api.Command['user_find'](self.uid, **kw)
assert res
assert len(res) == 2
assert res[1].get('givenname','') == self.givenname
diff --git a/tests/test_xmlrpc/xmlrpc_test.py b/tests/test_xmlrpc/xmlrpc_test.py
index 1070196e1..8e626600f 100644
--- a/tests/test_xmlrpc/xmlrpc_test.py
+++ b/tests/test_xmlrpc/xmlrpc_test.py
@@ -26,7 +26,20 @@ import socket
import nose
from ipalib import api, request
from ipalib import errors2
+from ipalib import errors
+# Initialize the API. We do this here so that one can run the tests
+# individually instead of at the top-level. If API.bootstrap()
+# has already been called we continue gracefully. Other errors will be
+# raised.
+try:
+ api.bootstrap(context='cli')
+ api.finalize()
+except StandardError, e:
+ if str(e) == "API.bootstrap() already called":
+ pass
+ else:
+ raise e
class XMLRPC_test(object):
"""