emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/notmuch f4dc32e71b: test: mark some tests as broken when r


From: ELPA Syncer
Subject: [nongnu] elpa/notmuch f4dc32e71b: test: mark some tests as broken when run as root.
Date: Thu, 5 Jan 2023 19:59:50 -0500 (EST)

branch: elpa/notmuch
commit f4dc32e71b6fbaca933e0c7edd6d08b65feed0ec
Author: David Bremner <david@tethera.net>
Commit: David Bremner <david@tethera.net>

    test: mark some tests as broken when run as root.
    
    File permission errors e.g., are hard to trigger as root.
---
 test/T050-new.sh     | 1 +
 test/T150-tagging.sh | 1 +
 test/test-lib.sh     | 6 ++++++
 3 files changed, 8 insertions(+)

diff --git a/test/T050-new.sh b/test/T050-new.sh
index cb67889c95..240c181064 100755
--- a/test/T050-new.sh
+++ b/test/T050-new.sh
@@ -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/*.*
diff --git a/test/T150-tagging.sh b/test/T150-tagging.sh
index 1a2fd77e48..ac3f25399d 100755
--- a/test/T150-tagging.sh
+++ b/test/T150-tagging.sh
@@ -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/*.*
diff --git a/test/test-lib.sh b/test/test-lib.sh
index eec5c5b450..1a6525dfa0 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]