Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CentOS8 build fail: error: 'SOFTHSM2_PATH' undeclared #5397

Closed
minfrin opened this issue Nov 15, 2020 · 13 comments
Closed

CentOS8 build fail: error: 'SOFTHSM2_PATH' undeclared #5397

minfrin opened this issue Nov 15, 2020 · 13 comments

Comments

@minfrin
Copy link
Contributor

minfrin commented Nov 15, 2020

When building on CentOS8 as follows, "make check" fails.

./configure --prefix=/tmp/sssd-trunk --disable-cifs-idmap-plugin --without-samba --without-nfsv4-idmapd-plugin --without-secrets --without-kcm

There is missing configure.ac checks to ensure the SOFTHSM2_PATH is declared.

In file included from ./src/tests/cmocka/common_mock.h:42,
                 from src/tests/cmocka/test_pam_srv.c:27:
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert_check_gdm_smartcard':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:674:42: note: in expansion of macro 'TEST_MODULE_NAME'
                                 + sizeof(TEST_MODULE_NAME)
                                          ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: note: each undeclared identifier is reported only once for each function it appears in
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:674:42: note: in expansion of macro 'TEST_MODULE_NAME'
                                 + sizeof(TEST_MODULE_NAME)
                                          ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert_check_ex':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:741:37: note: in expansion of macro 'TEST_MODULE_NAME'
                                     TEST_MODULE_NAME,
                                     ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: initialization of 'const char *' from incompatible pointer type 'const char **' [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:750:38: note: in expansion of macro 'TEST_MODULE_NAME'
                                      TEST_MODULE_NAME,
                                      ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: note: (near initialization for 'check2_strings[2]')
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:750:38: note: in expansion of macro 'TEST_MODULE_NAME'
                                      TEST_MODULE_NAME,
                                      ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:800:33: error: invalid operands to binary + (have 'char *' and 'const char **')
             && strncmp((char *) body + rp + strlen(name) + 1
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                 + sizeof(TEST_TOKEN_NAME)
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~
                                 + sizeof(TEST_MODULE_NAME),
                                 ^
src/tests/cmocka/test_pam_srv.c:798:24: warning: passing argument 1 of 'strncmp' from incompatible pointer type [-Wincompatible-pointer-types]
             && strncmp((char *) body + rp + strlen(name) + 1
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                 + sizeof(TEST_TOKEN_NAME)
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~
                                 + sizeof(TEST_MODULE_NAME),
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./src/shared/safealign.h:31,
                 from ./src/util/util.h:42,
                 from ./src/tests/common.h:31,
                 from ./src/tests/cmocka/common_mock.h:44,
                 from src/tests/cmocka/test_pam_srv.c:27:
/usr/include/string.h:139:33: note: expected 'const char *' but argument is of type 'const char **'
 extern int strncmp (const char *__s1, const char *__s2, size_t __n)
                     ~~~~~~~~~~~~^~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert2_token2_check_ex':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:844:38: note: in expansion of macro 'TEST_MODULE_NAME'
                                      TEST_MODULE_NAME,
                                      ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: initialization of 'const char *' from incompatible pointer type 'const char **' [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:844:38: note: in expansion of macro 'TEST_MODULE_NAME'
                                      TEST_MODULE_NAME,
                                      ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: note: (near initialization for 'check2_strings[2]')
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:844:38: note: in expansion of macro 'TEST_MODULE_NAME'
                                      TEST_MODULE_NAME,
                                      ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert5_check':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:947:38: note: in expansion of macro 'TEST_MODULE_NAME'
                                      TEST_MODULE_NAME,
                                      ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: initialization of 'const char *' from incompatible pointer type 'const char **' [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:947:38: note: in expansion of macro 'TEST_MODULE_NAME'
                                      TEST_MODULE_NAME,
                                      ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: note: (near initialization for 'check5_strings[2]')
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:947:38: note: in expansion of macro 'TEST_MODULE_NAME'
                                      TEST_MODULE_NAME,
                                      ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert_auth':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2254:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: passing argument 5 of 'mock_input_pam_cert' from incompatible pointer type [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2254:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:538:45: note: expected 'const char *' but argument is of type 'const char **'
                                 const char *module_name, const char *key_id,
                                 ~~~~~~~~~~~~^~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_ecc_cert_auth':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2291:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: passing argument 5 of 'mock_input_pam_cert' from incompatible pointer type [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2291:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:538:45: note: expected 'const char *' but argument is of type 'const char **'
                                 const char *module_name, const char *key_id,
                                 ~~~~~~~~~~~~^~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert_auth_no_logon_name':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2326:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: passing argument 5 of 'mock_input_pam_cert' from incompatible pointer type [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2326:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:538:45: note: expected 'const char *' but argument is of type 'const char **'
                                 const char *module_name, const char *key_id,
                                 ~~~~~~~~~~~~^~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert_auth_no_logon_name_no_key_id':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2363:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME, NULL, NULL,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: passing argument 5 of 'mock_input_pam_cert' from incompatible pointer type [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2363:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME, NULL, NULL,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:538:45: note: expected 'const char *' but argument is of type 'const char **'
                                 const char *module_name, const char *key_id,
                                 ~~~~~~~~~~~~^~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert_auth_double_cert':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2389:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: passing argument 5 of 'mock_input_pam_cert' from incompatible pointer type [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2389:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:538:45: note: expected 'const char *' but argument is of type 'const char **'
                                 const char *module_name, const char *key_id,
                                 ~~~~~~~~~~~~^~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c: In function 'test_pam_cert_auth_2certs_one_mapping':
src/tests/cmocka/test_pam_srv.c:65:26: error: 'SOFTHSM2_PATH' undeclared (first use in this function); did you mean 'TESTS_PATH'?
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2466:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:65:26: warning: passing argument 5 of 'mock_input_pam_cert' from incompatible pointer type [-Wincompatible-pointer-types]
 #define TEST_MODULE_NAME SOFTHSM2_PATH
                          ^~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:2466:25: note: in expansion of macro 'TEST_MODULE_NAME'
                         TEST_MODULE_NAME,
                         ^~~~~~~~~~~~~~~~
src/tests/cmocka/test_pam_srv.c:538:45: note: expected 'const char *' but argument is of type 'const char **'
                                 const char *module_name, const char *key_id,
                                 ~~~~~~~~~~~~^~~~~~~~~~~
make[3]: *** [Makefile:28768: src/tests/cmocka/pam_srv_tests-test_pam_srv.o] Error 1
make[3]: Leaving directory '/home/minfrin/src/sssd/sssd-ldapi'
make[2]: *** [Makefile:40987: check-am] Error 2
make[2]: Leaving directory '/home/minfrin/src/sssd/sssd-ldapi'
make[1]: *** [Makefile:39896: check-recursive] Error 1
make[1]: Leaving directory '/home/minfrin/src/sssd/sssd-ldapi'
make: *** [Makefile:40990: check] Error 2
@alexey-tikhonov
Copy link
Member

Please install softhsm and re-configure project.

@sumit-bose
Copy link
Contributor

Hi,

although installing softhsm is a valid workaround I think it is not necessary to require it.

Please try if with the following patch make test works without installing softhsm.

bye,
Sumit

diff --git a/src/tests/cmocka/test_pam_srv.c b/src/tests/cmocka/test_pam_srv.c
index ba97d59..8aabd79 100644
--- a/src/tests/cmocka/test_pam_srv.c
+++ b/src/tests/cmocka/test_pam_srv.c
@@ -42,12 +42,18 @@
 #include "tests/test_CA/SSSD_test_cert_x509_0005.h"
 
 #include "tests/test_ECC_CA/SSSD_test_ECC_cert_x509_0001.h"
+
+#define TEST_MODULE_NAME SOFTHSM2_PATH
+
 #else
 #define SSSD_TEST_CERT_0001 ""
 #define SSSD_TEST_CERT_0002 ""
 #define SSSD_TEST_CERT_0005 ""
 
 #define SSSD_TEST_ECC_CERT_0001 ""
+
+#define TEST_MODULE_NAME ""
+
 #endif
 
 #define TESTS_PATH "tp_" BASE_FILE_STEM
@@ -63,7 +69,6 @@
 #define TEST_TOKEN2_NAME "SSSD Test Token Number 2"
 #define TEST_KEY_ID "C554C9F82C2A9D58B70921C143304153A8A42F17"
 #define TEST_LABEL "SSSD test cert 0001"
-#define TEST_MODULE_NAME SOFTHSM2_PATH
 #define TEST_PROMPT "SSSD test cert 0001\nCN=SSSD test cert 0001,OU=SSSD test,O=SSSD"
 #define TEST2_PROMPT "SSSD test cert 0002\nCN=SSSD test cert 0002,OU=SSSD test,O=SSSD"
 #define TEST5_PROMPT "SSSD test cert 0005\nCN=SSSD test cert 0005,OU=SSSD test,O=SSSD"

@alexey-tikhonov
Copy link
Member

Wouldn't it be better to handle this closer to https://github.com/SSSD/sssd/blob/master/src/external/test_ca.m4#L38 ?

And perhaps this could be handled together with #5329

@sumit-bose
Copy link
Contributor

Wouldn't it be better to handle this closer to https://github.com/SSSD/sssd/blob/master/src/external/test_ca.m4#L38 ?

Hi,

how would you like to handle it in the configure check? I think not setting SOFTHSM2_PATH is a good way to indicate that the SoftHSM PKCS#11 module was not found and the configure run will already print a warning that some tests will be skipped.

How the missing module should be handled depends imo on the individual use case and should be handled where it is needed, so in this case in test_pam_srv.c.

And perhaps this could be handled together with #5329

Sure, did we already come to a solution what a suitable fix for #5329 would be? E.g. grep p11-kit list-modules output and fall back to the current check?

bye,
Sumit

@minfrin
Copy link
Contributor Author

minfrin commented Nov 16, 2020

although installing softhsm is a valid workaround I think it is not necessary to require it.

Please try if with the following patch make test works without installing softhsm.

Alas the patch doesn't apply for me to master:

patching file src/tests/cmocka/test_pam_srv.c
Hunk #2 FAILED at 69.
1 out of 2 hunks FAILED -- saving rejects to file src/tests/cmocka/test_pam_srv.c.rej

@alexey-tikhonov
Copy link
Member

Wouldn't it be better to handle this closer to https://github.com/SSSD/sssd/blob/master/src/external/test_ca.m4#L38 ?

Hi,

how would you like to handle it in the configure check? I think not setting SOFTHSM2_PATH is a good way to indicate that the SoftHSM PKCS#11 module was not found and the configure run will already print a warning that some tests will be skipped.

Ok, agree.

How the missing module should be handled depends imo on the individual use case and should be handled where it is needed, so in this case in test_pam_srv.c.

But I don't fully understand your patch either.
+#define TEST_MODULE_NAME ""

Missing SOFTHSM2_PATH doesn't undef HAVE_TEST_CA, right?

So tests still will be run but with "" as a path? How is it expected to work?

And perhaps this could be handled together with #5329

Well, taken above into consideration, I revoke this assumption.

@sumit-bose
Copy link
Contributor

How the missing module should be handled depends imo on the individual use case and should be handled where it is needed, so in this case in test_pam_srv.c.

But I don't fully understand your patch either.
+#define TEST_MODULE_NAME ""

Missing SOFTHSM2_PATH doesn't undef HAVE_TEST_CA, right?

No, it does. In https://github.com/SSSD/sssd/blob/master/src/external/test_ca.m4#L61 BUILD_TEST_CA is only defined if SOFTHSM2_PATH is set and in the following lines HAVE_TEST_CA is only set if BUILD_TEST_CA is set.

bye,
Sumit

@sumit-bose
Copy link
Contributor

although installing softhsm is a valid workaround I think it is not necessary to require it.
Please try if with the following patch make test works without installing softhsm.

Alas the patch doesn't apply for me to master:

patching file src/tests/cmocka/test_pam_srv.c
Hunk #2 FAILED at 69.
1 out of 2 hunks FAILED -- saving rejects to file src/tests/cmocka/test_pam_srv.c.rej

ah, sorry, I didn't took the patch from plain master but from some working branch which also modified the file. Please try:

diff --git a/src/tests/cmocka/test_pam_srv.c b/src/tests/cmocka/test_pam_srv.c
index 326deaf1f..8dfb0bae8 100644
--- a/src/tests/cmocka/test_pam_srv.c
+++ b/src/tests/cmocka/test_pam_srv.c
@@ -42,12 +42,18 @@
 #include "tests/test_CA/SSSD_test_cert_x509_0005.h"
 
 #include "tests/test_ECC_CA/SSSD_test_ECC_cert_x509_0001.h"
+
+#define TEST_MODULE_NAME SOFTHSM2_PATH
+
 #else
 #define SSSD_TEST_CERT_0001 ""
 #define SSSD_TEST_CERT_0002 ""
 #define SSSD_TEST_CERT_0005 ""
 
 #define SSSD_TEST_ECC_CERT_0001 ""
+
+#define TEST_MODULE_NAME ""
+
 #endif
 
 #define TESTS_PATH "tp_" BASE_FILE_STEM
@@ -62,7 +68,6 @@
 #define TEST_TOKEN_NAME "SSSD Test Token"
 #define TEST_TOKEN2_NAME "SSSD Test Token Number 2"
 #define TEST_KEY_ID "C554C9F82C2A9D58B70921C143304153A8A42F17"
-#define TEST_MODULE_NAME SOFTHSM2_PATH
 #define TEST_PROMPT "SSSD test cert 0001\nCN=SSSD test cert 0001,OU=SSSD test,O=SSSD"
 #define TEST2_PROMPT "SSSD test cert 0002\nCN=SSSD test cert 0002,OU=SSSD test,O=SSSD"
 #define TEST5_PROMPT "SSSD test cert 0005\nCN=SSSD test cert 0005,OU=SSSD test,O=SSSD"

HTH

bye,
Sumit

@alexey-tikhonov
Copy link
Member

But I don't fully understand your patch either.
+#define TEST_MODULE_NAME ""
Missing SOFTHSM2_PATH doesn't undef HAVE_TEST_CA, right?

No, it does. In https://github.com/SSSD/sssd/blob/master/src/external/test_ca.m4#L61 BUILD_TEST_CA is only defined if SOFTHSM2_PATH is set and in the following lines HAVE_TEST_CA is only set if BUILD_TEST_CA is set.

Then perhaps it's cleaner to wrap corresponding test functions into #ifdef HAVE_TEST_CA (to exclude entirely its compilation) instead of stub TEST_MODULE_NAME definition?

@minfrin
Copy link
Contributor Author

minfrin commented Nov 17, 2020

ah, sorry, I didn't took the patch from plain master but from some working branch which also modified the file. Please try:

Just tried, and have a clean build and all (non skipped) tests pass!

============================================================================
Testsuite summary for sssd 2.4.1
============================================================================
# TOTAL: 88
# PASS:  86
# SKIP:  2
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

@sumit-bose
Copy link
Contributor

ah, sorry, I didn't took the patch from plain master but from some working branch which also modified the file. Please try:

Just tried, and have a clean build and all (non skipped) tests pass!

============================================================================
Testsuite summary for sssd 2.4.1
============================================================================
# TOTAL: 88
# PASS:  86
# SKIP:  2
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0

Hi,

thanks for the confirmation.

bye,
Sumit

@sumit-bose
Copy link
Contributor

But I don't fully understand your patch either.
+#define TEST_MODULE_NAME ""
Missing SOFTHSM2_PATH doesn't undef HAVE_TEST_CA, right?

No, it does. In https://github.com/SSSD/sssd/blob/master/src/external/test_ca.m4#L61 BUILD_TEST_CA is only defined if SOFTHSM2_PATH is set and in the following lines HAVE_TEST_CA is only set if BUILD_TEST_CA is set.

Then perhaps it's cleaner to wrap corresponding test functions into #ifdef HAVE_TEST_CA (to exclude entirely its compilation) instead of stub TEST_MODULE_NAME definition?

Hi,

yes, that would be possible. Currently only the cmocka_unit_test_setup_teardown calls are enclosed with #ifdefs mainly because I found it easier to just do this since some of the other calls and checks might be reused by other tests which do not depend on the test CA and as a result it might be quite a number of #ifdefs spread through the whole file.

As an alternative all code which depends on the presence of the test CA can be move into a separate file or even in a separate test.

bye,
Sumit

3v1n0 added a commit to 3v1n0/sssd that referenced this issue Dec 16, 2020
…ded paths

Right now building SSSD in archs different from amd64 (at least in
debian and derivatives) won't ever get the test_CA built because
libsofthsm2 won't be found (leading also to SSSD#5397 at times).

As per this, until they won't provide a pkg-config file:
 - Prioritize looking for libsofthsm2 in configured libdir (will help
   the developer case when using custom prefixes with custom softhsm2)
 - Fallback to /usr prefixes, supporting any arch (not only x86_64)
3v1n0 added a commit to 3v1n0/sssd that referenced this issue Dec 16, 2020
…ded paths

Right now building SSSD in archs different from amd64 (at least in
debian and derivatives) won't ever get the test_CA built because
libsofthsm2 won't be found (leading also to SSSD#5397 at times).

As per this, until they won't provide a pkg-config file:
 - Prioritize looking for libsofthsm2 in configured libdir (will help
   the developer case when using custom prefixes with custom softhsm2)
 - Fallback to /usr prefixes, supporting any arch (not only x86_64)
3v1n0 added a commit to 3v1n0/sssd that referenced this issue Dec 16, 2020
…ded paths

Right now building SSSD in archs different from amd64 (at least in
debian and derivatives) won't ever get the test_CA built because
libsofthsm2 won't be found (leading also to SSSD#5397 at times).

As per this, until they won't provide a pkg-config file:
 - Prioritize looking for libsofthsm2 in configured libdir (will help
   the developer case when using custom prefixes with custom softhsm2)
 - Fallback to /usr prefixes, supporting any arch (not only x86_64)
3v1n0 added a commit to 3v1n0/sssd that referenced this issue Jan 20, 2021
…ded paths

Right now building SSSD in archs different from amd64 (at least in
debian and derivatives) won't ever get the test_CA built because
libsofthsm2 won't be found (leading also to SSSD#5397 at times).

As per this, until they won't provide a pkg-config file:
 - Prioritize looking for libsofthsm2 in configured libdir (will help
   the developer case when using custom prefixes with custom softhsm2)
 - Fallback to /usr prefixes, supporting any arch (not only x86_64)
pbrezina pushed a commit that referenced this issue Jan 21, 2021
…ded paths

Right now building SSSD in archs different from amd64 (at least in
debian and derivatives) won't ever get the test_CA built because
libsofthsm2 won't be found (leading also to #5397 at times).

As per this, until they won't provide a pkg-config file:
 - Prioritize looking for libsofthsm2 in configured libdir (will help
   the developer case when using custom prefixes with custom softhsm2)
 - Fallback to /usr prefixes, supporting any arch (not only x86_64)

Reviewed-by: Sumit Bose <sbose@redhat.com>
akuster pushed a commit to akuster/sssd that referenced this issue May 18, 2021
…ded paths

Right now building SSSD in archs different from amd64 (at least in
debian and derivatives) won't ever get the test_CA built because
libsofthsm2 won't be found (leading also to SSSD#5397 at times).

As per this, until they won't provide a pkg-config file:
 - Prioritize looking for libsofthsm2 in configured libdir (will help
   the developer case when using custom prefixes with custom softhsm2)
 - Fallback to /usr prefixes, supporting any arch (not only x86_64)

Reviewed-by: Sumit Bose <sbose@redhat.com>
@andreboscatto
Copy link
Contributor

Fixed: #5438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants