summaryrefslogtreecommitdiffstats
path: root/ipatests/test_ipaserver
diff options
context:
space:
mode:
authorOleg Fayans <ofayans@redhat.com>2015-08-27 19:19:28 +0200
committerMartin Basti <mbasti@redhat.com>2015-08-28 16:12:25 +0200
commitc7408f67f6cff7bd3ac14b7661472898f8e7dd73 (patch)
treea48c4664fea638b7200cffc03384a78efa46538c /ipatests/test_ipaserver
parent0914cb663e6ea72628776e79d93f20bf979c7b68 (diff)
downloadfreeipa-c7408f67f6cff7bd3ac14b7661472898f8e7dd73.tar.gz
freeipa-c7408f67f6cff7bd3ac14b7661472898f8e7dd73.tar.xz
freeipa-c7408f67f6cff7bd3ac14b7661472898f8e7dd73.zip
Integration tests for topology plugin
Reviewed-By: Martin Basti <mbasti@redhat.com> Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipatests/test_ipaserver')
-rw-r--r--ipatests/test_ipaserver/test_topology_plugin.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/ipatests/test_ipaserver/test_topology_plugin.py b/ipatests/test_ipaserver/test_topology_plugin.py
index 667897499..b162822e0 100644
--- a/ipatests/test_ipaserver/test_topology_plugin.py
+++ b/ipatests/test_ipaserver/test_topology_plugin.py
@@ -2,18 +2,23 @@
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
+import io
import os
from ipaserver.plugins.ldap2 import ldap2
from ipalib import api
from ipapython import ipautil
from ipapython.dn import DN
-import nose
+import pytest
class TestTopologyPlugin(object):
"""
Test Topology plugin from the DS point of view
+ Testcase: http://www.freeipa.org/page/V4/Manage_replication_topology/
+ Test_plan#Test_case:
+ _Replication_Topology_is_listed_among_directory_server_plugins
"""
+ pwfile = os.path.join(api.env.dot_ipa, ".dmpw")
def setup(self):
"""
@@ -25,6 +30,8 @@ class TestTopologyPlugin(object):
if self.conn and self.conn.isconnected():
self.conn.disconnect()
+ @pytest.mark.skipif(ipautil.file_exists(pwfile) is False,
+ reason="You did not provide a .dmpw file with the DM password")
def test_topologyplugin(self):
pluginattrs = {
u'nsslapd-pluginPath': [u'libtopology'],
@@ -56,11 +63,8 @@ class TestTopologyPlugin(object):
('cn', 'plugins'),
('cn', 'config'))
pwfile = os.path.join(api.env.dot_ipa, ".dmpw")
- if ipautil.file_exists(pwfile):
- with open(pwfile, "r") as f:
- dm_password = f.read().rstrip()
- else:
- raise nose.SkipTest("No directory manager password in %s" % pwfile)
+ with io.open(pwfile, "r") as f:
+ dm_password = f.read().rstrip()
self.conn = ldap2(api)
self.conn.connect(bind_dn=DN(('cn', 'directory manager')),
bind_pw=dm_password)