summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2019-06-03 03:33:05 +0200
committerDaiki Ueno <ueno@gnu.org>2019-06-18 14:17:28 +0200
commit9c2022d292c00ccbe2413b53b7c91cf4ba4d7c14 (patch)
tree5509bf26790ef18b8a4b85d8d0847fad34d0b835
parentfd908a787cc868043067f5fab492f8e05b6d99ce (diff)
tests: Skip tests calling getauxval(AT_SECURE) if binary is on /tmp
-rw-r--r--common/test-compat.c5
-rw-r--r--p11-kit/test-conf.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/common/test-compat.c b/common/test-compat.c
index 77a0c31..8b5d2e6 100644
--- a/common/test-compat.c
+++ b/common/test-compat.c
@@ -133,8 +133,9 @@ main (int argc,
{
p11_test (test_strndup, "/compat/strndup");
#ifdef OS_UNIX
- /* Don't run this test when under fakeroot */
- if (!getenv ("FAKED_MODE")) {
+ /* Don't run this test when under fakeroot, or the binary is
+ * written under /tmp */
+ if (!getenv ("FAKED_MODE") && strncmp (BUILDDIR, "/tmp/", 5) != 0) {
p11_test (test_getauxval, "/compat/getauxval");
p11_test (test_secure_getenv, "/compat/secure_getenv");
}
diff --git a/p11-kit/test-conf.c b/p11-kit/test-conf.c
index 94b8b01..a140aaa 100644
--- a/p11-kit/test-conf.c
+++ b/p11-kit/test-conf.c
@@ -447,8 +447,9 @@ main (int argc,
p11_test (test_load_modules_user_none, "/conf/test_load_modules_user_none");
p11_test (test_parse_boolean, "/conf/test_parse_boolean");
#ifdef OS_UNIX
- /* Don't run this test when under fakeroot */
- if (!getenv ("FAKED_MODE")) {
+ /* Don't run this test when under fakeroot, or the binary is
+ * written under /tmp */
+ if (!getenv ("FAKED_MODE") && strncmp (BUILDDIR, "/tmp/", 5) != 0) {
p11_test (test_setuid, "/conf/setuid");
}
#endif