From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [IPv6:2a01:7e0:0:424::9]) by lore.proxmox.com (Postfix) with ESMTPS id 772D01FF165 for ; Thu, 23 Oct 2025 12:40:11 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id C16A4704E; Thu, 23 Oct 2025 12:40:33 +0200 (CEST) From: Nicolas Frey To: pve-devel@lists.proxmox.com Date: Thu, 23 Oct 2025 12:39:52 +0200 Message-ID: <20251023103953.305810-4-n.frey@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20251023103953.305810-1-n.frey@proxmox.com> References: <20251023103953.305810-1-n.frey@proxmox.com> MIME-Version: 1.0 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.035 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 KAM_LAZY_DOMAIN_SECURITY 1 Sending domain does not have any anti-forgery methods RDNS_NONE 0.793 Delivered to internal network by a host with no rDNS SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_NONE 0.001 SPF: sender does not publish an SPF Record Subject: [pve-devel] [PATCH proxmox v5 3/4] apt: add tests for POM release filenames X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Proxmox VE development discussion Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: pve-devel-bounces@lists.proxmox.com Sender: "pve-devel" Signed-off-by: Nicolas Frey --- proxmox-apt/src/repositories/repository.rs | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/proxmox-apt/src/repositories/repository.rs b/proxmox-apt/src/repositories/repository.rs index 5e386665..1b3f010e 100644 --- a/proxmox-apt/src/repositories/repository.rs +++ b/proxmox-apt/src/repositories/repository.rs @@ -430,3 +430,32 @@ fn test_uri_to_filename() { let filename = uri_to_filename("https://some_host/some/path"); assert_eq!(filename, "some%5fhost_some_path".to_string()); } + +#[test] +fn test_release_filename() { + let data = [ + // testcase for proxmox offline mirror (mounted) + ( + Path::new("/var/lib/apt/lists"), + "file:///mnt/mirror/pve-no-subscription/2025-10-16T08:07:41Z", + "trixie", + false, + // expected + "/var/lib/apt/lists/_mnt_mirror_pve-no-subscription_2025-10-16T08:07:41Z_dists_trixie_InRelease" + ), + // testcase for proxmox offline mirror (local http server) + ( + Path::new("/var/lib/apt/lists"), + "http://proxmox-offline-mirror.domain.example/pve-subscription/2025-10-16T08:07:41Z", + "trixie", + false, + // expected + "/var/lib/apt/lists/proxmox-offline-mirror.domain.example_pve-subscription_2025-10-16T08:07:41Z_dists_trixie_InRelease" + ), + ]; + + for d in data { + let filename = release_filename(d.0, d.1, d.2, d.3).display().to_string(); + assert_eq!(filename, d.4); + } +} -- 2.47.3 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel