From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id EB+PGVqetGGwRgAAgWs5BA (envelope-from ) for ; Sat, 11 Dec 2021 13:49:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id YOgpFVqetGFNRgAAbx9fmQ (envelope-from ) for ; Sat, 11 Dec 2021 12:49:30 +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 25AC72F173 for ; Sat, 11 Dec 2021 13:49:30 +0100 (CET) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id DBC63296FC; Sat, 11 Dec 2021 07:49:21 -0500 (EST) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id 041EA290EC for ; Sat, 11 Dec 2021 07:49:17 -0500 (EST) Received: by fethera.tethera.net (Postfix, from userid 1001) id A3BDE5FC42; Sat, 11 Dec 2021 07:49:17 -0500 (EST) Received: (nullmailer pid 1823572 invoked by uid 1000); Sat, 11 Dec 2021 12:49:16 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 1/2] test/libconfig: save and restore config file Date: Sat, 11 Dec 2021 08:49:11 -0400 Message-Id: <20211211124912.1823559-1-david@tethera.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Message-ID-Hash: 2UYKRYPLJW3M2EFVKIH25TJ3S5PT6M45 X-Message-ID-Hash: 2UYKRYPLJW3M2EFVKIH25TJ3S5PT6M45 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=1639226970; 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:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=p3+x5col7HTh6u5E4JdCZ9vVaxw1OQX0rX2Am9unZlo=; b=BJJMTjqiKyxyCpxsSuFribtGCPJwg8ml0wd49rcYABmWedsJWlD866cCrTrXD8Es3/YpgB SeLYYDCFsITzcrGl5jqpYV0q6OuvHPjq26b4y4r3G/EL+INTw4lH4ouw9UbolFIqFppE5a 1TdQ3wKyYPQ5DWOlq+vuqwwToAGoRKN/og6Npat4Fl8YXYyIVaMsLUc3C0fh1czAT/qFCR xAut2Cnw0/rKGwUCqFI/GazdblWnM6tH4a0tFLirZrukW9j344PVm/vSzmuThNvyubEEos pTlFRyclLwGbRxDOARYhA/IloJviW9edZhSlvyzB8wcLhxAXUtW5i91UMpJg3w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639226970; a=rsa-sha256; cv=none; b=U5FxSGCvrOpXe1rCmueLx4J/J2QyTOvM62t7KTmzGrpi7i1xh1nKygTAZsMXPJAR8RxIIB FrI7xCgoBWONoWtf9aDJO08p/xkU0GqGzfPP00zS83xR9IGx23xuywyKtcdpXvaU/2oXkq lkWg4YoheBSEieT6k2qpaokF/VKE0mVNmm8RwQLWU4XlaaxGABeVgdqIx/RqrbdlzNYXN+ XMy6jJWGN3vrCS0q98Hkh6AaIU5AYZrxKMZ40y/kzEIE0Da1mbgCISOohdvpLqPNEiHgPQ 7CQZT2OXQjYgmK/BPvQesFwA5WLR+3wGFD0vXcDNY5oWIUL3oYSD18TlrkaPjQ== 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: -0.95 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: 25AC72F173 X-Spam-Score: -0.95 X-Migadu-Scanner: scn1.migadu.com X-TUID: UCIQ33fqcLx/ Currently the config file is unusable for further tests requiring a valid database path. --- test/T590-libconfig.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/T590-libconfig.sh b/test/T590-libconfig.sh index eb303444..089b4e58 100755 --- a/test/T590-libconfig.sh +++ b/test/T590-libconfig.sh @@ -972,6 +972,7 @@ EOF test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "open: database parameter overrides implicit config" +cp $NOTMUCH_CONFIG ${NOTMUCH_CONFIG}.bak notmuch config set database.path ${MAIL_DIR}/nonexistent cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR} const char *path = NULL; @@ -982,6 +983,7 @@ cat c_head3 - c_tail3 <<'EOF' | test_C ${MAIL_DIR} path = notmuch_database_get_path (db); printf ("path: %s\n", path ? path : "(null)"); EOF +cp ${NOTMUCH_CONFIG}.bak ${NOTMUCH_CONFIG} cat < EXPECTED == stdout == status: 0 -- 2.33.0