From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id B75491FF141 for ; Fri, 30 Jan 2026 17:46:14 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id E2ECD2A0B; Fri, 30 Jan 2026 17:46:41 +0100 (CET) From: Robert Obkircher To: pbs-devel@lists.proxmox.com Subject: [PATCH v5 proxmox-backup 04/16] datastore: use temporary directory for chunk store test Date: Fri, 30 Jan 2026 17:45:28 +0100 Message-ID: <20260130164552.281581-5-r.obkircher@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260130164552.281581-1-r.obkircher@proxmox.com> References: <20260130164552.281581-1-r.obkircher@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1769791529077 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.063 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: JHDI5Y4NFATKPIUAESZDEJEC327OAOSV X-Message-ID-Hash: JHDI5Y4NFATKPIUAESZDEJEC327OAOSV X-MailFrom: r.obkircher@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Use the systems tmp directory instead of the package root, because the latter might not always be writeable and because the created files weren't even ignored by git. This reduced the tests runtime from 3.2 to 0.6 seconds. Signed-off-by: Robert Obkircher --- pbs-datastore/src/chunk_store.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pbs-datastore/src/chunk_store.rs b/pbs-datastore/src/chunk_store.rs index bd1dc353..a2763890 100644 --- a/pbs-datastore/src/chunk_store.rs +++ b/pbs-datastore/src/chunk_store.rs @@ -980,10 +980,7 @@ impl ChunkExt { #[test] fn test_chunk_store1() { - let mut path = std::fs::canonicalize(".").unwrap(); // we need absolute path - path.push(".testdir"); - - if let Err(_e) = std::fs::remove_dir_all(".testdir") { /* ignore */ } + let path = crate::temp_test_dir::TempTestDir::new(); let chunk_store = ChunkStore::open("test", &path, DatastoreFSyncLevel::None); assert!(chunk_store.is_err()); @@ -1007,6 +1004,4 @@ fn test_chunk_store1() { let chunk_store = ChunkStore::create("test", &path, user.uid, user.gid, DatastoreFSyncLevel::None); assert!(chunk_store.is_err()); - - if let Err(_e) = std::fs::remove_dir_all(".testdir") { /* ignore */ } } -- 2.47.3