From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OFpKDw7GdmHgMQAAgWs5BA (envelope-from ) for ; Mon, 25 Oct 2021 16:58:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id q1j4Cg7GdmEPRQAAB5/wlQ (envelope-from ) for ; Mon, 25 Oct 2021 14:58:22 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E455ECFE8 for ; Mon, 25 Oct 2021 16:58:21 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 5606F1F52B; Mon, 25 Oct 2021 10:58:07 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id 3444A1F4B0 for ; Mon, 25 Oct 2021 10:58:00 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id C42755FC50; Mon, 25 Oct 2021 10:57:59 -0400 (EDT) Received: (nullmailer pid 3031439 invoked by uid 1000); Mon, 25 Oct 2021 14:57:55 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 3/3] test: mark some tests as broken when run as root. Date: Mon, 25 Oct 2021 11:57:53 -0300 Message-Id: <20211025145753.3031094-4-david@tethera.net> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211025145753.3031094-1-david@tethera.net> References: <20211025145753.3031094-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: TTISUETNRUT4FAMWPGVPIKUQKGAUVOZN X-Message-ID-Hash: TTISUETNRUT4FAMWPGVPIKUQKGAUVOZN 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-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635173902; 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=McKyTixvYtWQZWEHLWqkCEhjUJJpLobgtGzLbn5st+k=; b=kDbvB7j8kvwjCGSFRXrzvP6gz9LrEnJMieSOcOS6e1fsSh18B9ejfWVcsgmcyPOHPWfpUi ZJotw4U4hFWmAY/z9YyDD4W9QECkNeI67IPCSY/fUld/KK8V4EUXc2/5oeE/a9ycOnQw6F lYnJtrqXpZ/36hODFMyki9w0uXY2Ij/ukTBdpj8EM/BaqRzd/zwO+PuTzuJ9Ss9Kn7oDCh 0Rn7d34hmaJV7AVcIzYLo69q5B2n72aGAFo1G+hySH4ZanY8gpWouePoR558Nl8IdJPndX PwhAyLkaqsrQv3cNsKGOk+IUPRKRMC4bN6n3rWTOKNCOzWDpwVQ8TLwK4fu2zA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635173902; a=rsa-sha256; cv=none; b=hVwNfNZzIcNL0jFwQ6Wg8AO8Bl2kNqShltCH5UKHb3K4mLMYaj0VQcA2V0gLmoLY+g79pT oyNziz0qFtgpO50YSxukClC3KvQtxp7DEyTUVRU5f1RtykWIM9W5/RDpDwHGxm3Pdgea0+ HRf/vagRzbbW7veXUHCp9qHLfql+mQfyx6sHcLRzR6+0MyS7khcsb1yqX9DouyROb8+8a+ 2k/gsrcMbxR/ws6on8j7cftX6LVwfpaoWmZ+17w8v6z4UFZGGdGvI9amD+oYDK444R6pt/ 54PuLU2pRM0pxQkXYOj3u8FO/PsM42ZFO+kiOrRvWlhlCXpg2wnUbHyIYJtx0w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -1.15 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: E455ECFE8 X-Spam-Score: -1.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3DpgEDsXgHuC 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 5a03998b..c75021bc 100755 --- a/test/T050-new.sh +++ b/test/T050-new.sh @@ -362,6 +362,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 6713275f..4bacc9b1 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -779,6 +779,12 @@ test_subtest_broken_for_installed () { fi } +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.33.0