From 2631e57d20b6d40cb68f4ed2ee666aee7831e41c Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Tue, 13 Apr 2021 14:02:37 +0200 Subject: [PATCH] fix regression tests --- src/tape/media_catalog.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tape/media_catalog.rs b/src/tape/media_catalog.rs index 04eb50b2..aff91c43 100644 --- a/src/tape/media_catalog.rs +++ b/src/tape/media_catalog.rs @@ -261,6 +261,11 @@ impl MediaCatalog { .truncate(true) .open(&tmp_path)?; + if cfg!(test) { + // We cannot use chown inside test environment (no permissions) + return Ok(file); + } + let backup_user = crate::backup::backup_user()?; fchown(file.as_raw_fd(), Some(backup_user.uid), Some(backup_user.gid)) .map_err(|err| format_err!("fchown failed - {}", err))?;