From 4126a83e055726904de48273e4381a3aaac84e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= Date: Thu, 6 Jun 2024 11:32:19 +0200 Subject: [PATCH] apt: fix test output dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit under autopkgtest, the rundir is not writable, but cargo gives us a tmpdir that we can use in all cases. Signed-off-by: Fabian Grünbichler --- proxmox-apt/tests/repositories.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/proxmox-apt/tests/repositories.rs b/proxmox-apt/tests/repositories.rs index bb0014ac..ae92e51c 100644 --- a/proxmox-apt/tests/repositories.rs +++ b/proxmox-apt/tests/repositories.rs @@ -143,9 +143,13 @@ fn test_digest() -> Result<(), Error> { #[test] fn test_empty_write() -> Result<(), Error> { + let write_dir = PathBuf::from( + std::option_env!("CARGO_TARGET_TMPDIR").expect("no test target dir set by cargo!"), + ) + .join("tests") + .join("sources.list.d.remove"); let test_dir = std::env::current_dir()?.join("tests"); let read_dir = test_dir.join("sources.list.d"); - let write_dir = test_dir.join("sources.list.d.remove"); create_clean_directory(&write_dir)?;