]> git.cworth.org Git - notmuch/commitdiff
test: mark some tests as broken when run as root.
authorDavid Bremner <david@tethera.net>
Wed, 4 Jan 2023 12:41:42 +0000 (08:41 -0400)
committerDavid Bremner <david@tethera.net>
Fri, 6 Jan 2023 00:14:37 +0000 (20:14 -0400)
File permission errors e.g., are hard to trigger as root.

test/T050-new.sh
test/T150-tagging.sh
test/test-lib.sh

index cb67889c95f82d6a4d130d65560fb453ff8d5efe..240c181064ca4bc9006262aaf776430b90f3c2d9 100755 (executable)
@@ -384,6 +384,7 @@ EOF
 test_expect_equal_file EXPECTED OUTPUT
 
 test_begin_subtest "Xapian exception: read only files"
+test_subtest_broken_for_root
 chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.*
 output=$(NOTMUCH_NEW --debug 2>&1 | sed 's/: .*$//' )
 chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.*
index 1a2fd77e4853708580293c9695a61cab0398fe8e..ac3f25399dc0e9024c8606c70805703355392ec6 100755 (executable)
@@ -320,6 +320,7 @@ test_begin_subtest "Tag name beginning with -"
 test_expect_code 1 'notmuch tag +- One'
 
 test_begin_subtest "Xapian exception: read only files"
+test_subtest_broken_for_root
 chmod u-w ${MAIL_DIR}/.notmuch/xapian/*.*
 output=$(notmuch tag +something '*' 2>&1 | sed 's/: .*$//' )
 chmod u+w ${MAIL_DIR}/.notmuch/xapian/*.*
index eec5c5b4508c1224d7b2510fe3822ce13e374bc0..1a6525dfa0e0d508b5289ad67f77dba8809e1cb9 100644 (file)
@@ -740,6 +740,12 @@ test_subtest_known_broken () {
        test_subtest_known_broken_=t
 }
 
+test_subtest_broken_for_root () {
+   if [ "$EUID" = "0" ]; then
+       test_subtest_known_broken_=t
+    fi
+}
+
 test_expect_success () {
        exec 1>&6 2>&7          # Restore stdout and stderr
        if [ -z "$inside_subtest" ]; then