]> granicus.if.org Git - p11-kit/commitdiff
tests: Skip tests calling getauxval(AT_SECURE) if binary is on /tmp
authorDaiki Ueno <dueno@redhat.com>
Mon, 3 Jun 2019 01:33:05 +0000 (03:33 +0200)
committerDaiki Ueno <ueno@gnu.org>
Tue, 18 Jun 2019 12:17:28 +0000 (14:17 +0200)
common/test-compat.c
p11-kit/test-conf.c

index 77a0c31bec017cb789af735590704335f7dbacda..8b5d2e6464449d2a700a7b63a88ec7de847296f7 100644 (file)
@@ -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");
        }
index 94b8b013fd310bac7af1dd1af6e79fcf812a3712..a140aaa67327eb28aaa2271831ccd2c492a9195e 100644 (file)
@@ -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