From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 qPaVJZCktmNnNwAAbAwnHQ (envelope-from ) for ; Thu, 05 Jan 2023 11:21:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GLqjJZCktmMUeQEA9RJhRA (envelope-from ) for ; Thu, 05 Jan 2023 11:21:04 +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) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C569A2275D for ; Thu, 5 Jan 2023 11:21:03 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id EE3AE604A2; Thu, 5 Jan 2023 10:20:59 +0000 (UTC) X-Greylist: delayed 492 seconds by postgrey-1.36 at yantan; Thu, 05 Jan 2023 10:20:57 UTC Received: from meesny.iki.fi (meesny.iki.fi [IPv6:2001:67c:2b0:1c1::201]) by mail.notmuchmail.org (Postfix) with ESMTPS id CEDE45FC1C for ; Thu, 5 Jan 2023 10:20:57 +0000 (UTC) Received: from c53 (gw1.nor.fi [185.218.193.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: too) by meesny.iki.fi (Postfix) with ESMTPSA id 5E3B6211FC; Thu, 5 Jan 2023 12:12:09 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1672913529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gqRw5TjHn8xwNr2pKW4aljcGGYvPDodbDjgi5GiNNCU=; b=g2i37Z4+cmUq17SzXoRkS3zK8jwsBVMNJtDs0/koG2bR4FN8hTk6hH1rBUYOsdpBQvZEVF p0EkonwLTIzf6mG2ZcZZQ3kzpqhy2mir2THhtmpuUW3jEU8pM+R/Wr/IC6GhspDu/7pDmF pXyPndAMb6woC9aO1LTSS2DDS/Kdxbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1672913529; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gqRw5TjHn8xwNr2pKW4aljcGGYvPDodbDjgi5GiNNCU=; b=ovgO9rwuhxFKNeR/MxM8POodPX34ZL6ZLl/ekM98/VJ9PBusZVqiTxqwgo+2ooTgX4exzQ HwxLNh0F4V7OuIvw+8jCAjBVQ40UEfoe0mFxQf8ZgQQqPagBPpdgDRE7vKKKbkIjdunaVO LVOEe1cXLQS6JShEG+EdzTofV+6Giq8= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=meesny; d=iki.fi; t=1672913529; a=rsa-sha256; cv=none; b=g24VeY7zjOudHf/HuB/t2ExLlq3kM23r+kA+mFOC5ttxu1wBgomHw4heP35tWJtaEbM4FU BwZq/fdUqDsQ40W+f9kceeEDvih2u4ti7FZ0i3PwyFHlpe5mUVkg+SBP/wqwpqHKKJcQb5 wLL2z40I3E3Y+P48juKpwNiSu+0rhFM= From: Tomi Ollila To: David Bremner , notmuch@notmuchmail.org Subject: Re: [PATCH 1/4] test: mark some tests as broken when run as root. In-Reply-To: <20230104124145.2882983-2-david@tethera.net> References: <20230104124145.2882983-1-david@tethera.net> <20230104124145.2882983-2-david@tethera.net> User-Agent: Notmuch/0.37+27~gff8ef59 (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 Message-ID-Hash: 6S7FJLK7ODCWPBTMED4NGXRMMDNBCQPO X-Message-ID-Hash: 6S7FJLK7ODCWPBTMED4NGXRMMDNBCQPO X-MailFrom: tomi.ollila@iki.fi 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=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1672914064; 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:dkim-signature; bh=2Lm+nL0g6U6vDyPw6PJ8ogXQUQaxuI30QMeyT7vfzfo=; b=HHeRJGlFy2jiR8jGh2AIrFikm3Qiy51Q8K5NGfPPOqEZLLzGRAUPyxwJLFp7vNEPZq/ahm mUJzCobPidteKmOYMDvIbt879qSNWUGBMaJmGwboLDFQ+V0RCcWYO0XQBTBibh7d/8s5Tk g/5Bx/GJz31rBLvm2QhcBKxz506e4os/VmQ8NJb+ekHCUoYmPjldb0iezzNywMB+EqUlTu Hy1h57Hv9EXj8L51fOKokzBQMJz6kvMHN5ACBVxW9qHSVUOvf84bsL+/xwwRMjA1Rs5HW9 ss+/FZAgkFpXoEGpIQLY3yEq5jXUv9panYQ/DUjDl9iiMxy5YhIKHCRYbQ/fYA== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=meesny header.b=g2i37Z4+; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); 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=2; s=key1; d=yhetil.org; t=1672914064; a=rsa-sha256; cv=fail; b=kh/jppRPyzIVOMuIPgYy+lgQo/+eLpDTnhc5P+C+ZP10bXYlL8w/mPJ07CGesRqMka5ePC m2RTUl5SDhbcV++JKVqaHLiKsSxG8gPl+jZHA2B5KN0UAIYxsj8zCM4QPl0XUiZNzcZNq2 DOBUp/snyU2zeF7YQ+KAIiOYx7DlfExXyUC+iuBqA7cvbjlpBlGilhV2LOCqq0Iyudjuoc Lfr/FjCZeJXOEsH0CMuxky4m3d/Mc8gJHY4a7foZLcW01b3SOzYeP4KNJh3UO15FpCZA69 jMAdHdGKxor1hg0x21G++CTivpicyDf7I7i4Vf8YCVW4RZkDdbiaF0ViX2jFFA== X-Spam-Score: 3.53 X-Migadu-Queue-Id: C569A2275D Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=meesny header.b=g2i37Z4+; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); 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: 3.53 X-TUID: K7uNYuTP9o2m On Wed, Jan 04 2023, David Bremner wrote: > 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 Good progress -- bash has: $ bash -c 'set' | grep UID EUID=1001 UID=1001 $ podman run --rm -it debian:10.9 bash -c 'set' | grep UID EUID=0 UID=0 i.e. EUID as builtin variable ( man id says id -u prints "only the effective user ID" ) another question is whether test_subtest_broken_for_root is good name. perhaps it is tolerable enough Tomi > + fi > +} > + > test_expect_success () { > exec 1>&6 2>&7 # Restore stdout and stderr > if [ -z "$inside_subtest" ]; then > -- > 2.39.0