From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id QK6oIjN0tWMaQgEAbAwnHQ (envelope-from ) for ; Wed, 04 Jan 2023 13:42:27 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id YMNzIjN0tWOMkwAAauVa8A (envelope-from ) for ; Wed, 04 Jan 2023 13:42:27 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 636D32724E for ; Wed, 4 Jan 2023 13:42:27 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 225D8604CD; Wed, 4 Jan 2023 12:42:03 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id B2E965FBED for ; Wed, 4 Jan 2023 12:41:57 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id F11B05FB9E; Wed, 4 Jan 2023 07:41:56 -0500 (EST) Received: (nullmailer pid 2883278 invoked by uid 1000); Wed, 04 Jan 2023 12:41:50 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 1/4] test: mark some tests as broken when run as root. Date: Wed, 4 Jan 2023 08:41:42 -0400 Message-Id: <20230104124145.2882983-2-david@tethera.net> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230104124145.2882983-1-david@tethera.net> References: <20230104124145.2882983-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: LHHLTWUL4MIEMOWIMQVOXKA5TTS7KRJQ X-Message-ID-Hash: LHHLTWUL4MIEMOWIMQVOXKA5TTS7KRJQ X-MailFrom: bremner@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Country: DE X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672836147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=RSr5Ip6PDYFzuYhDdDCMY9eRawKtiVooQTIlmOigQM4=; b=Oqt5f0ygnCbu3P8QYREy0YKMDxbpqpTRuhlm7tMNuyRl3l6aL1m4zJKZEL03wA9Gyw9ZQf +Rdo5VInJxZknGeuDkYr9OGoHY81HnQ8ZGWtNM6fHYk4yY78sx9ZjDux1e3SleY0WKpK95 be6k0U9sDavuGrTjawQeaUtVCliLSB3rKREBD+qMcncR/XCHv7lM7vfxrlmHlJT6PUi9LX Ery9ZmfH5/dcKEC+9tKZSneXM0Tax05MC3MTaZGfOn00l4fytxAqX+qCDtlYyh4QzOqm4o PnynhhPYhCE9J2k7m0hkzvMDbKq7FFfsE0ffMVwKlTw0OHYFIvi7pqnuSVloIA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1672836147; a=rsa-sha256; cv=none; b=o5Ny5WvN/w4NM/Y16FUYNHssIeRws07kC/LuCsx/NMwtK7FGqP1c3NQNOKMNxfr/95Z1uU aZhzzq34Gaez4MUpn49KSi2MzLVaihZUe5P1A99IDp44wnqvBi0jGG5KcodyymZMarssK+ A8PGchC3fvyVaCHgCGhG+WE/X7DrUqzpmmtym1+BqpgVrKIVB2UgriDt0R58v/5xb8ydu8 X6RUIiSgguDH+XQQchtvYOlPFEBbXPV/g02EJRn7FBVfVg5dF+00uqK6Bsi5S8JS7WP6xy KwrgXCEXGoHNCmcPt5PyIT8wHN52KWjb4Db/q0Se99o314q17wKlIlmnqu3juQ== X-Spam-Score: -0.63 X-Migadu-Queue-Id: 636D32724E Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -0.63 X-TUID: tfdUmQhHkl7j 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 cb67889c..240c1810 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 1a2fd77e..ac3f2539 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 eec5c5b4..c2b8cd8d 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 [ "$(id -u)" = "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 -- 2.39.0