From 43208040a405651f456c8fc20ae9c0ea2b919f1c Mon Sep 17 00:00:00 2001
From: Lenka Doudova <ldoudova@redhat.com>
Date: Tue, 23 Aug 2016 16:14:50 +0200
Subject: [PATCH 1/3] Tests: Failing tests in test_ipalib/test_plugable

Tests test_Registry and test_API are failing, both due to changes made during
thin client implementation. Partial fix for [1], complete fix for [2].

[1] https://fedorahosted.org/freeipa/ticket/6191
[2] https://fedorahosted.org/freeipa/ticket/6186
---
 ipatests/test_ipalib/test_plugable.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/ipatests/test_ipalib/test_plugable.py b/ipatests/test_ipalib/test_plugable.py
index e8e867d..0ea02a7 100644
--- a/ipatests/test_ipalib/test_plugable.py
+++ b/ipatests/test_ipalib/test_plugable.py
@@ -118,7 +118,7 @@ class plugin3(Base3):
     # a class:
     p = plugin1()
     e = raises(TypeError, r(), p)
-    assert str(e) == 'plugin must be a class; got %r' % p
+    assert str(e) == 'plugin must be callable; got %r' % p
 
     # Check that registration works
     r()(plugin1)
@@ -229,7 +229,7 @@ def get_plugin_name(b, p):
             base_name = get_base_name(b)
             base = locals()[base_name]
             ns = getattr(api, base_name)
-            assert isinstance(ns, plugable.NameSpace)
+            assert isinstance(ns, plugable.APINameSpace)
             assert read_only(api, base_name) is ns
             assert len(ns) == 3
             for p in range(3):
@@ -239,7 +239,6 @@ def get_plugin_name(b, p):
                 assert isinstance(inst, base)
                 assert isinstance(inst, plugin)
                 assert inst.name == plugin_name
-                assert read_only(ns, plugin_name) is inst
                 assert inst.method(7) == 7 + b
 
         # Test that calling finilize again raises AssertionError:

From 7fb6584a2a37661f3996a0600d7a6266fd6b3b3b Mon Sep 17 00:00:00 2001
From: Lenka Doudova <ldoudova@redhat.com>
Date: Tue, 23 Aug 2016 16:18:26 +0200
Subject: [PATCH 2/3] Tests: Failing test_ipalib/test_rpc

Due to thin client implementation a part of the original test is no longer
valid and causes test to fail.

https://fedorahosted.org/freeipa/ticket/6192
---
 ipatests/test_ipalib/test_rpc.py | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/ipatests/test_ipalib/test_rpc.py b/ipatests/test_ipalib/test_rpc.py
index f13e7cf..f038951 100644
--- a/ipatests/test_ipalib/test_rpc.py
+++ b/ipatests/test_ipalib/test_rpc.py
@@ -209,14 +209,6 @@ def test_forward(self):
         class user_add(Command):
             pass
 
-        # Test that ValueError is raised when forwarding a command that is not
-        # in api.Command:
-        (o, api, home) = self.instance('Backend', in_server=False)
-        e = raises(ValueError, o.forward, 'user_add')
-        assert str(e) == '%s.forward(): %r not in api.Command' % (
-            'xmlclient', 'user_add'
-        )
-
         (o, api, home) = self.instance('Backend', user_add, in_server=False)
         args = (binary_bytes, utf8_bytes, unicode_str)
         kw = dict(one=binary_bytes, two=utf8_bytes, three=unicode_str)

From 03bca80b715b3e534ee75d14b8b00eaf46a2fbf6 Mon Sep 17 00:00:00 2001
From: Lenka Doudova <ldoudova@redhat.com>
Date: Tue, 23 Aug 2016 16:20:34 +0200
Subject: [PATCH 3/3] Tests: Failing test_ipaserver/test_ldap test

Plugins are being imported in the test_ldap/test_Backend test, which is no
longer valid due to changes made during thin client implementation. Plugins are
imported automatically and explicit imports make tests fail because of the
duplicity.

https://fedorahosted.org/freeipa/ticket/6194
---
 ipatests/test_ipaserver/test_ldap.py | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/ipatests/test_ipaserver/test_ldap.py b/ipatests/test_ipaserver/test_ldap.py
index 816f12f..a92c503 100644
--- a/ipatests/test_ipaserver/test_ldap.py
+++ b/ipatests/test_ipaserver/test_ldap.py
@@ -35,8 +35,6 @@
 import six
 
 from ipaserver.plugins.ldap2 import ldap2
-from ipaserver.plugins.service import service, service_show
-from ipaserver.plugins.host import host
 from ipalib import api, x509, create_api, errors
 from ipapython import ipautil
 from ipaplatform.paths import paths
@@ -118,10 +116,6 @@ def test_Backend(self):
         # we need for the test.
         myapi = create_api(mode=None)
         myapi.bootstrap(context='cli', in_server=True, in_tree=True)
-        myapi.add_plugin(ldap2)
-        myapi.add_plugin(host)
-        myapi.add_plugin(service)
-        myapi.add_plugin(service_show)
         myapi.finalize()
 
         pwfile = api.env.dot_ipa + os.sep + ".dmpw"
