Re: [Freeipa-devel] [PATCH 140] extdom: migrate check-based test to cmocka

2015-03-18 Thread Sumit Bose
On Fri, Mar 13, 2015 at 03:14:55PM +0100, Jakub Hrozek wrote:
 On Fri, Mar 13, 2015 at 11:56:46AM +0100, Sumit Bose wrote:
  On Wed, Mar 04, 2015 at 06:42:05PM +0100, Sumit Bose wrote:
   Hi,
   
   this is the first patch for https://fedorahosted.org/freeipa/ticket/4922
   which converts the check-based tests of the extdom plugin to cmocka.
   
   bye,
   Sumit
  
  Rebased version attached.
  
  bye,
  Sumit
 
 The test itself is fine, but did freeipa consider moving to cmocka-1.0+
 to avoid warnings like:
 ipa_extdom_cmocka_tests.c: In function ‘main’:
 ipa_extdom_cmocka_tests.c:408:5: warning: ‘_run_tests’ is deprecated
 (declared at /usr/include/cmocka.h:2001) [-Wdeprecated-declarations]
  return run_tests(tests);
 
 But I'm fine with ACKing this patch, the conversion should be done
 separately.

yes, I found it more flexible to use the old style now because it works
with all versions of cmocka. When I converted the remaining check based
test to cmocka I will provide a patch which will switch all to the new
version.

bye,
Sumit

 
 -- 
 Manage your subscription for the Freeipa-devel mailing list:
 https://www.redhat.com/mailman/listinfo/freeipa-devel
 Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [PATCH 140] extdom: migrate check-based test to cmocka

2015-03-18 Thread Martin Kosek
On 03/18/2015 01:32 PM, Sumit Bose wrote:
 On Wed, Mar 18, 2015 at 12:53:04PM +0100, Martin Kosek wrote:
 On 03/18/2015 11:22 AM, Jakub Hrozek wrote:
 On Wed, Mar 18, 2015 at 11:01:35AM +0100, Sumit Bose wrote:
 On Fri, Mar 13, 2015 at 03:14:55PM +0100, Jakub Hrozek wrote:
 On Fri, Mar 13, 2015 at 11:56:46AM +0100, Sumit Bose wrote:
 On Wed, Mar 04, 2015 at 06:42:05PM +0100, Sumit Bose wrote:
 Hi,

 this is the first patch for https://fedorahosted.org/freeipa/ticket/4922
 which converts the check-based tests of the extdom plugin to cmocka.

 bye,
 Sumit

 Rebased version attached.

 bye,
 Sumit

 The test itself is fine, but did freeipa consider moving to cmocka-1.0+
 to avoid warnings like:
 ipa_extdom_cmocka_tests.c: In function ‘main’:
 ipa_extdom_cmocka_tests.c:408:5: warning: ‘_run_tests’ is deprecated
 (declared at /usr/include/cmocka.h:2001) [-Wdeprecated-declarations]
  return run_tests(tests);

 But I'm fine with ACKing this patch, the conversion should be done
 separately.

 yes, I found it more flexible to use the old style now because it works
 with all versions of cmocka. When I converted the remaining check based
 test to cmocka I will provide a patch which will switch all to the new
 version.

 bye,
 Sumit

 Sure, ACK

 (sorry, from my point of view it was obvious I was OK with pushing even
 the previous version. Hopefully it's even clearer now :-))


 Thanks for this work guys! I would push it, but there is a conflict in 
 ipa_extdom.
 
 Rebased version attached.
 
 bye,
 Sumit
 

Thanks! Pushed to master: d0d79ada379ab809c26a7dc0bbc88b47ab85f744

What are your next steps for https://fedorahosted.org/freeipa/ticket/4922,
replace BuildRequires: check with cmocka BuildRequires in the FreeIPA
referential spec file?

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


Re: [Freeipa-devel] [PATCH 140] extdom: migrate check-based test to cmocka

2015-03-18 Thread Martin Kosek
On 03/18/2015 11:22 AM, Jakub Hrozek wrote:
 On Wed, Mar 18, 2015 at 11:01:35AM +0100, Sumit Bose wrote:
 On Fri, Mar 13, 2015 at 03:14:55PM +0100, Jakub Hrozek wrote:
 On Fri, Mar 13, 2015 at 11:56:46AM +0100, Sumit Bose wrote:
 On Wed, Mar 04, 2015 at 06:42:05PM +0100, Sumit Bose wrote:
 Hi,

 this is the first patch for https://fedorahosted.org/freeipa/ticket/4922
 which converts the check-based tests of the extdom plugin to cmocka.

 bye,
 Sumit

 Rebased version attached.

 bye,
 Sumit

 The test itself is fine, but did freeipa consider moving to cmocka-1.0+
 to avoid warnings like:
 ipa_extdom_cmocka_tests.c: In function ‘main’:
 ipa_extdom_cmocka_tests.c:408:5: warning: ‘_run_tests’ is deprecated
 (declared at /usr/include/cmocka.h:2001) [-Wdeprecated-declarations]
  return run_tests(tests);

 But I'm fine with ACKing this patch, the conversion should be done
 separately.

 yes, I found it more flexible to use the old style now because it works
 with all versions of cmocka. When I converted the remaining check based
 test to cmocka I will provide a patch which will switch all to the new
 version.

 bye,
 Sumit
 
 Sure, ACK
 
 (sorry, from my point of view it was obvious I was OK with pushing even
 the previous version. Hopefully it's even clearer now :-))
 

Thanks for this work guys! I would push it, but there is a conflict in 
ipa_extdom.

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [PATCH 140] extdom: migrate check-based test to cmocka

2015-03-18 Thread Sumit Bose
On Wed, Mar 18, 2015 at 12:53:04PM +0100, Martin Kosek wrote:
 On 03/18/2015 11:22 AM, Jakub Hrozek wrote:
  On Wed, Mar 18, 2015 at 11:01:35AM +0100, Sumit Bose wrote:
  On Fri, Mar 13, 2015 at 03:14:55PM +0100, Jakub Hrozek wrote:
  On Fri, Mar 13, 2015 at 11:56:46AM +0100, Sumit Bose wrote:
  On Wed, Mar 04, 2015 at 06:42:05PM +0100, Sumit Bose wrote:
  Hi,
 
  this is the first patch for https://fedorahosted.org/freeipa/ticket/4922
  which converts the check-based tests of the extdom plugin to cmocka.
 
  bye,
  Sumit
 
  Rebased version attached.
 
  bye,
  Sumit
 
  The test itself is fine, but did freeipa consider moving to cmocka-1.0+
  to avoid warnings like:
  ipa_extdom_cmocka_tests.c: In function ‘main’:
  ipa_extdom_cmocka_tests.c:408:5: warning: ‘_run_tests’ is deprecated
  (declared at /usr/include/cmocka.h:2001) [-Wdeprecated-declarations]
   return run_tests(tests);
 
  But I'm fine with ACKing this patch, the conversion should be done
  separately.
 
  yes, I found it more flexible to use the old style now because it works
  with all versions of cmocka. When I converted the remaining check based
  test to cmocka I will provide a patch which will switch all to the new
  version.
 
  bye,
  Sumit
  
  Sure, ACK
  
  (sorry, from my point of view it was obvious I was OK with pushing even
  the previous version. Hopefully it's even clearer now :-))
  
 
 Thanks for this work guys! I would push it, but there is a conflict in 
 ipa_extdom.

Rebased version attached.

bye,
Sumit

From cedaaba614dad266e5f5e90eafedf2b173b96c12 Mon Sep 17 00:00:00 2001
From: Sumit Bose sb...@redhat.com
Date: Mon, 9 Feb 2015 18:12:01 +0100
Subject: [PATCH] extdom: migrate check-based test to cmocka

Besides moving the existing tests to cmocka two new tests are added
which were missing from the old tests.

Related to https://fedorahosted.org/freeipa/ticket/4922
---
 .../ipa-slapi-plugins/ipa-extdom-extop/Makefile.am |  20 --
 .../ipa-extdom-extop/ipa_extdom.h  |  14 ++
 .../ipa-extdom-extop/ipa_extdom_cmocka_tests.c | 156 +++-
 .../ipa-extdom-extop/ipa_extdom_common.c   |  28 +--
 .../ipa-extdom-extop/ipa_extdom_tests.c| 203 -
 5 files changed, 176 insertions(+), 245 deletions(-)
 delete mode 100644 
daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_tests.c

diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am 
b/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
index 
a1679812ef3c5de8c6e18433cbb991a99ad0b6c8..9c2fa1c6a5f95ba06b33c0a5b560939863a88f0e
 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
@@ -38,11 +38,6 @@ libipa_extdom_extop_la_LIBADD =  \
 TESTS =
 check_PROGRAMS =
 
-if HAVE_CHECK
-TESTS += extdom_tests
-check_PROGRAMS += extdom_tests
-endif
-
 if HAVE_CMOCKA
 if HAVE_NSS_WRAPPER
 TESTS_ENVIRONMENT = . ./test_data/test_setup.sh;
@@ -51,21 +46,6 @@ check_PROGRAMS += extdom_cmocka_tests
 endif
 endif
 
-extdom_tests_SOURCES = \
-   ipa_extdom_tests.c  \
-   ipa_extdom_common.c \
-   $(NULL)
-extdom_tests_CFLAGS = $(CHECK_CFLAGS)
-extdom_tests_LDFLAGS = \
-   -rpath $(shell pkg-config --libs-only-L dirsrv | sed -e 's/-L//') \
-   $(NULL)
-extdom_tests_LDADD =   \
-   $(CHECK_LIBS)   \
-   $(LDAP_LIBS)\
-   $(DIRSRV_LIBS)  \
-   $(SSSNSSIDMAP_LIBS) \
-   $(NULL)
-
 extdom_cmocka_tests_SOURCES =  \
ipa_extdom_cmocka_tests.c   \
ipa_extdom_common.c \
diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h 
b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
index 
0d5d55d2fb0ece95466b0225b145a4edeef18efa..65dd43ea35726db6231386a0fcbba9be1bd71412
 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
@@ -185,5 +185,19 @@ int getgrnam_r_wrapper(size_t buf_max, const char *name,
struct group *grp, char **_buf, size_t *_buf_len);
 int getgrgid_r_wrapper(size_t buf_max, gid_t gid,
struct group *grp, char **_buf, size_t *_buf_len);
+int pack_ber_sid(const char *sid, struct berval **berval);
+int pack_ber_name(const char *domain_name, const char *name,
+  struct berval **berval);
+int pack_ber_user(struct ipa_extdom_ctx *ctx,
+  enum response_types response_type,
+  const char *domain_name, const char *user_name,
+  uid_t uid, gid_t gid,
+  const char *gecos, const char *homedir,
+  const char *shell, struct sss_nss_kv *kv_list,
+  struct berval **berval);
+int pack_ber_group(enum response_types response_type,
+   const char *domain_name, const char *group_name,
+   gid_t gid, char **members, struct sss_nss_kv 

Re: [Freeipa-devel] [PATCH 140] extdom: migrate check-based test to cmocka

2015-03-18 Thread Sumit Bose
On Wed, Mar 18, 2015 at 01:36:44PM +0100, Martin Kosek wrote:
 On 03/18/2015 01:32 PM, Sumit Bose wrote:
  On Wed, Mar 18, 2015 at 12:53:04PM +0100, Martin Kosek wrote:
  On 03/18/2015 11:22 AM, Jakub Hrozek wrote:
  On Wed, Mar 18, 2015 at 11:01:35AM +0100, Sumit Bose wrote:
  On Fri, Mar 13, 2015 at 03:14:55PM +0100, Jakub Hrozek wrote:
  On Fri, Mar 13, 2015 at 11:56:46AM +0100, Sumit Bose wrote:
  On Wed, Mar 04, 2015 at 06:42:05PM +0100, Sumit Bose wrote:
  Hi,
 
  this is the first patch for 
  https://fedorahosted.org/freeipa/ticket/4922
  which converts the check-based tests of the extdom plugin to cmocka.
 
  bye,
  Sumit
 
  Rebased version attached.
 
  bye,
  Sumit
 
  The test itself is fine, but did freeipa consider moving to cmocka-1.0+
  to avoid warnings like:
  ipa_extdom_cmocka_tests.c: In function ‘main’:
  ipa_extdom_cmocka_tests.c:408:5: warning: ‘_run_tests’ is deprecated
  (declared at /usr/include/cmocka.h:2001) [-Wdeprecated-declarations]
   return run_tests(tests);
 
  But I'm fine with ACKing this patch, the conversion should be done
  separately.
 
  yes, I found it more flexible to use the old style now because it works
  with all versions of cmocka. When I converted the remaining check based
  test to cmocka I will provide a patch which will switch all to the new
  version.
 
  bye,
  Sumit
 
  Sure, ACK
 
  (sorry, from my point of view it was obvious I was OK with pushing even
  the previous version. Hopefully it's even clearer now :-))
 
 
  Thanks for this work guys! I would push it, but there is a conflict in 
  ipa_extdom.
  
  Rebased version attached.
  
  bye,
  Sumit
  
 
 Thanks! Pushed to master: d0d79ada379ab809c26a7dc0bbc88b47ab85f744
 
 What are your next steps for https://fedorahosted.org/freeipa/ticket/4922,
 replace BuildRequires: check with cmocka BuildRequires in the FreeIPA
 referential spec file?

yes, the next patch here would be to migrate
ipa-kdb/tests/ipa_kdb_tests.c to cmocka and replace the BuildRequires.

As a last step, if no related issues have shown up on the SSSD side,
make the tests compile with cmocka 1.0 without warnings and add the
version to the BuildRequires.

bye,
Sumit

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [PATCH 140] extdom: migrate check-based test to cmocka

2015-03-13 Thread Sumit Bose
On Wed, Mar 04, 2015 at 06:42:05PM +0100, Sumit Bose wrote:
 Hi,
 
 this is the first patch for https://fedorahosted.org/freeipa/ticket/4922
 which converts the check-based tests of the extdom plugin to cmocka.
 
 bye,
 Sumit

Rebased version attached.

bye,
Sumit
From c801df101baa41146a06a70ff4075e308905577b Mon Sep 17 00:00:00 2001
From: Sumit Bose sb...@redhat.com
Date: Mon, 9 Feb 2015 18:12:01 +0100
Subject: [PATCH] extdom: migrate check-based test to cmocka

Besides moving the existing tests to cmocka two new tests are added
which were missing from the old tests.

Related to https://fedorahosted.org/freeipa/ticket/4922
---
 .../ipa-slapi-plugins/ipa-extdom-extop/Makefile.am |  20 --
 .../ipa-extdom-extop/ipa_extdom.h  |  14 ++
 .../ipa-extdom-extop/ipa_extdom_cmocka_tests.c | 156 +++-
 .../ipa-extdom-extop/ipa_extdom_common.c   |  28 +--
 .../ipa-extdom-extop/ipa_extdom_tests.c| 203 -
 5 files changed, 176 insertions(+), 245 deletions(-)
 delete mode 100644 
daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_tests.c

diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am 
b/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
index 
a1679812ef3c5de8c6e18433cbb991a99ad0b6c8..9c2fa1c6a5f95ba06b33c0a5b560939863a88f0e
 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
@@ -38,11 +38,6 @@ libipa_extdom_extop_la_LIBADD =  \
 TESTS =
 check_PROGRAMS =
 
-if HAVE_CHECK
-TESTS += extdom_tests
-check_PROGRAMS += extdom_tests
-endif
-
 if HAVE_CMOCKA
 if HAVE_NSS_WRAPPER
 TESTS_ENVIRONMENT = . ./test_data/test_setup.sh;
@@ -51,21 +46,6 @@ check_PROGRAMS += extdom_cmocka_tests
 endif
 endif
 
-extdom_tests_SOURCES = \
-   ipa_extdom_tests.c  \
-   ipa_extdom_common.c \
-   $(NULL)
-extdom_tests_CFLAGS = $(CHECK_CFLAGS)
-extdom_tests_LDFLAGS = \
-   -rpath $(shell pkg-config --libs-only-L dirsrv | sed -e 's/-L//') \
-   $(NULL)
-extdom_tests_LDADD =   \
-   $(CHECK_LIBS)   \
-   $(LDAP_LIBS)\
-   $(DIRSRV_LIBS)  \
-   $(SSSNSSIDMAP_LIBS) \
-   $(NULL)
-
 extdom_cmocka_tests_SOURCES =  \
ipa_extdom_cmocka_tests.c   \
ipa_extdom_common.c \
diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h 
b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
index 
0d5d55d2fb0ece95466b0225b145a4edeef18efa..65dd43ea35726db6231386a0fcbba9be1bd71412
 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
@@ -185,5 +185,19 @@ int getgrnam_r_wrapper(size_t buf_max, const char *name,
struct group *grp, char **_buf, size_t *_buf_len);
 int getgrgid_r_wrapper(size_t buf_max, gid_t gid,
struct group *grp, char **_buf, size_t *_buf_len);
+int pack_ber_sid(const char *sid, struct berval **berval);
+int pack_ber_name(const char *domain_name, const char *name,
+  struct berval **berval);
+int pack_ber_user(struct ipa_extdom_ctx *ctx,
+  enum response_types response_type,
+  const char *domain_name, const char *user_name,
+  uid_t uid, gid_t gid,
+  const char *gecos, const char *homedir,
+  const char *shell, struct sss_nss_kv *kv_list,
+  struct berval **berval);
+int pack_ber_group(enum response_types response_type,
+   const char *domain_name, const char *group_name,
+   gid_t gid, char **members, struct sss_nss_kv *kv_list,
+   struct berval **berval);
 void set_err_msg(struct extdom_req *req, const char *format, ...);
 #endif /* _IPA_EXTDOM_H_ */
diff --git 
a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c 
b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c
index 
586b58b0fd4c7610e9cb4643b6dae04f9d22b8ab..42d588d08a96f8a26345f85aade9523e05f6f56e
 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c
@@ -213,30 +213,46 @@ void test_getgrgid_r_wrapper(void **state)
 free(buf);
 }
 
+struct test_data {
+struct extdom_req *req;
+struct ipa_extdom_ctx *ctx;
+};
+
 void extdom_req_setup(void **state)
 {
-struct extdom_req *req;
+struct test_data *test_data;
 
-req = calloc(sizeof(struct extdom_req), 1);
-assert_non_null(req);
+test_data = calloc(sizeof(struct test_data), 1);
+assert_non_null(test_data);
 
-*state = req;
+test_data-req = calloc(sizeof(struct extdom_req), 1);
+assert_non_null(test_data-req);
+
+test_data-ctx = calloc(sizeof(struct ipa_extdom_ctx), 1);
+assert_non_null(test_data-req);
+
+*state = test_data;
 }
 
 void 

Re: [Freeipa-devel] [PATCH 140] extdom: migrate check-based test to cmocka

2015-03-13 Thread Jakub Hrozek
On Fri, Mar 13, 2015 at 11:56:46AM +0100, Sumit Bose wrote:
 On Wed, Mar 04, 2015 at 06:42:05PM +0100, Sumit Bose wrote:
  Hi,
  
  this is the first patch for https://fedorahosted.org/freeipa/ticket/4922
  which converts the check-based tests of the extdom plugin to cmocka.
  
  bye,
  Sumit
 
 Rebased version attached.
 
 bye,
 Sumit

The test itself is fine, but did freeipa consider moving to cmocka-1.0+
to avoid warnings like:
ipa_extdom_cmocka_tests.c: In function ‘main’:
ipa_extdom_cmocka_tests.c:408:5: warning: ‘_run_tests’ is deprecated
(declared at /usr/include/cmocka.h:2001) [-Wdeprecated-declarations]
 return run_tests(tests);

But I'm fine with ACKing this patch, the conversion should be done
separately.

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

[Freeipa-devel] [PATCH 140] extdom: migrate check-based test to cmocka

2015-03-04 Thread Sumit Bose
Hi,

this is the first patch for https://fedorahosted.org/freeipa/ticket/4922
which converts the check-based tests of the extdom plugin to cmocka.

bye,
Sumit
From e11c525d27ab19abbb16e12195a2ea9eb6421c80 Mon Sep 17 00:00:00 2001
From: Sumit Bose sb...@redhat.com
Date: Mon, 9 Feb 2015 18:12:01 +0100
Subject: [PATCH] extdom: migrate check-based test to cmocka

Besides moving the existing tests to cmocka two new tests are added
which were missing from the old tests.

Related to https://fedorahosted.org/freeipa/ticket/4922
---
 .../ipa-slapi-plugins/ipa-extdom-extop/Makefile.am |  20 --
 .../ipa-extdom-extop/ipa_extdom.h  |  14 ++
 .../ipa-extdom-extop/ipa_extdom_cmocka_tests.c | 156 +++-
 .../ipa-extdom-extop/ipa_extdom_common.c   |  28 +--
 .../ipa-extdom-extop/ipa_extdom_tests.c| 203 -
 5 files changed, 176 insertions(+), 245 deletions(-)
 delete mode 100644 
daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_tests.c

diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am 
b/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
index 
a1679812ef3c5de8c6e18433cbb991a99ad0b6c8..9c2fa1c6a5f95ba06b33c0a5b560939863a88f0e
 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/Makefile.am
@@ -38,11 +38,6 @@ libipa_extdom_extop_la_LIBADD =  \
 TESTS =
 check_PROGRAMS =
 
-if HAVE_CHECK
-TESTS += extdom_tests
-check_PROGRAMS += extdom_tests
-endif
-
 if HAVE_CMOCKA
 if HAVE_NSS_WRAPPER
 TESTS_ENVIRONMENT = . ./test_data/test_setup.sh;
@@ -51,21 +46,6 @@ check_PROGRAMS += extdom_cmocka_tests
 endif
 endif
 
-extdom_tests_SOURCES = \
-   ipa_extdom_tests.c  \
-   ipa_extdom_common.c \
-   $(NULL)
-extdom_tests_CFLAGS = $(CHECK_CFLAGS)
-extdom_tests_LDFLAGS = \
-   -rpath $(shell pkg-config --libs-only-L dirsrv | sed -e 's/-L//') \
-   $(NULL)
-extdom_tests_LDADD =   \
-   $(CHECK_LIBS)   \
-   $(LDAP_LIBS)\
-   $(DIRSRV_LIBS)  \
-   $(SSSNSSIDMAP_LIBS) \
-   $(NULL)
-
 extdom_cmocka_tests_SOURCES =  \
ipa_extdom_cmocka_tests.c   \
ipa_extdom_common.c \
diff --git a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h 
b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
index 
0d5d55d2fb0ece95466b0225b145a4edeef18efa..65dd43ea35726db6231386a0fcbba9be1bd71412
 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom.h
@@ -185,5 +185,19 @@ int getgrnam_r_wrapper(size_t buf_max, const char *name,
struct group *grp, char **_buf, size_t *_buf_len);
 int getgrgid_r_wrapper(size_t buf_max, gid_t gid,
struct group *grp, char **_buf, size_t *_buf_len);
+int pack_ber_sid(const char *sid, struct berval **berval);
+int pack_ber_name(const char *domain_name, const char *name,
+  struct berval **berval);
+int pack_ber_user(struct ipa_extdom_ctx *ctx,
+  enum response_types response_type,
+  const char *domain_name, const char *user_name,
+  uid_t uid, gid_t gid,
+  const char *gecos, const char *homedir,
+  const char *shell, struct sss_nss_kv *kv_list,
+  struct berval **berval);
+int pack_ber_group(enum response_types response_type,
+   const char *domain_name, const char *group_name,
+   gid_t gid, char **members, struct sss_nss_kv *kv_list,
+   struct berval **berval);
 void set_err_msg(struct extdom_req *req, const char *format, ...);
 #endif /* _IPA_EXTDOM_H_ */
diff --git 
a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c 
b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c
index 
0ca67030bf667ecd559443842cda166354ce54ce..87cb79aea38a901058de745fe986426479aa34b6
 100644
--- a/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c
+++ b/daemons/ipa-slapi-plugins/ipa-extdom-extop/ipa_extdom_cmocka_tests.c
@@ -213,30 +213,46 @@ void test_getgrgid_r_wrapper(void **state)
 free(buf);
 }
 
+struct test_data {
+struct extdom_req *req;
+struct ipa_extdom_ctx *ctx;
+};
+
 void extdom_req_setup(void **state)
 {
-struct extdom_req *req;
+struct test_data *test_data;
 
-req = calloc(sizeof(struct extdom_req), 1);
-assert_non_null(req);
+test_data = calloc(sizeof(struct test_data), 1);
+assert_non_null(test_data);
 
-*state = req;
+test_data-req = calloc(sizeof(struct extdom_req), 1);
+assert_non_null(test_data-req);
+
+test_data-ctx = calloc(sizeof(struct ipa_extdom_ctx), 1);
+assert_non_null(test_data-req);
+
+*state = test_data;
 }
 
 void extdom_req_teardown(void **state)
 {
-struct extdom_req *req;
+struct test_data *test_data;
 
-req =