how to set HAVE_CMOCKA

Andrew Bartlett abartlet at
Wed Feb 21 05:50:20 UTC 2018

On Wed, 2018-02-21 at 12:01 +1300, Andrew Bartlett via samba-technical

> Thanks,
> Clearly this shows that we must avoid having tests conditional in this
> way, it is just too easy to think we are testing when we don't.  Also,
> this is a really good argument for having patches create tests with a
> knownfail and then remove it, because it shows the tests actually did
> something in the first place.
> Andreas,
> Douglas has a patch for this under test, he will send it in once he is
> happy with it. 


Attached is Douglas' patch (on top of his rfc1738 patches).  As I
feared, the not-run tests no longer pass!

So we we start actually running the tests it causes make test to fail

[1(0)/6 at 0s] samba.unittests.krb5samba
[2(4)/6 at 0s] samba.unittests.sambafs_srv_pipe
[3(6)/6 at 0s] samba.unittests.lib_util_modules
REASON: Exception: Exception: reason (failure) interrupted

I think this was your test.  Could you take a look at it?

(Just to make life more complex we can't push the rfc1738 patches as-is 
they fail the -O3 build, but I'm sure that can be sorted tomorrow).


Andrew Bartlett
Andrew Bartlett             
Authentication Developer, Samba Team
Samba Developer, Catalyst IT
-------------- next part --------------
From 37f8352f0fec28b88f310a2319929229ae42de42 Mon Sep 17 00:00:00 2001
From: Douglas Bagnall <douglas.bagnall at>
Date: Wed, 21 Feb 2018 11:56:09 +1300
Subject: [PATCH] selftest/ remove always-needed, never-set
 with_cmocka flag

We have cmocka in third_party, so we are never without it.

Signed-off-by: Douglas Bagnall <douglas.bagnall at>
 selftest/ | 26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/selftest/ b/selftest/
index 42bec446064..beb73f27016 100644
--- a/selftest/
+++ b/selftest/
@@ -38,7 +38,6 @@ finally:
 have_man_pages_support = ("XSLTPROC_MANPAGES" in config_hash)
-with_cmocka = ("HAVE_CMOCKA" in config_hash)
 with_pam = ("WITH_PAM" in config_hash)
@@ -170,17 +169,16 @@ if with_pam:
                    valgrindify(python), pam_wrapper_so_path,
                    "$DOMAIN", "alice", "Secret007"])
-if with_cmocka:
-    plantestsuite("samba.unittests.krb5samba", "none",
-                  [os.path.join(bindir(), "default/testsuite/unittests/test_krb5samba")])
-    plantestsuite("samba.unittests.sambafs_srv_pipe", "none",
-                  [os.path.join(bindir(), "default/testsuite/unittests/test_sambafs_srv_pipe")])
-    plantestsuite("samba.unittests.lib_util_modules", "none",
-                  [os.path.join(bindir(), "default/testsuite/unittests/test_lib_util_modules")])
+plantestsuite("samba.unittests.krb5samba", "none",
+              [os.path.join(bindir(), "default/testsuite/unittests/test_krb5samba")])
+plantestsuite("samba.unittests.sambafs_srv_pipe", "none",
+              [os.path.join(bindir(), "default/testsuite/unittests/test_sambafs_srv_pipe")])
+plantestsuite("samba.unittests.lib_util_modules", "none",
+              [os.path.join(bindir(), "default/testsuite/unittests/test_lib_util_modules")])
-    plantestsuite("samba.unittests.smb1cli_session", "none",
-                  [os.path.join(bindir(), "default/libcli/smb/test_smb1cli_session")])
-    plantestsuite("samba.unittests.tldap", "none",
-                  [os.path.join(bindir(), "default/source3/test_tldap")])
-    plantestsuite("samba.unittests.rfc1738", "none",
-                  [os.path.join(bindir(), "default/lib/util/test_rfc1738")])
+plantestsuite("samba.unittests.smb1cli_session", "none",
+              [os.path.join(bindir(), "default/libcli/smb/test_smb1cli_session")])
+plantestsuite("samba.unittests.tldap", "none",
+              [os.path.join(bindir(), "default/source3/test_tldap")])
+plantestsuite("samba.unittests.rfc1738", "none",
+              [os.path.join(bindir(), "default/lib/util/test_rfc1738")])

More information about the samba-technical mailing list