diff options
Diffstat (limited to 'tests/pkgtoolkit_funcs.rs')
| -rw-r--r-- | tests/pkgtoolkit_funcs.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/pkgtoolkit_funcs.rs b/tests/pkgtoolkit_funcs.rs index 4e7f877..9e92e21 100644 --- a/tests/pkgtoolkit_funcs.rs +++ b/tests/pkgtoolkit_funcs.rs @@ -4,8 +4,8 @@ use mesk::pkgtoolkit::pkgtools::{Archs, Package}; mod shared; use shared::create_test_config; +use serial_test::serial; use tempfile::TempDir; -use tokio; // Pkg toolkit tests #[cfg(test)] @@ -15,6 +15,7 @@ mod package_tests { use std::io::Write; #[test] + #[serial] fn test_archs_as_str() { assert_eq!(Archs::X86_64.as_str(), "x86_64"); assert_eq!(Archs::Aarch64.as_str(), "aarch64"); @@ -24,6 +25,7 @@ mod package_tests { } #[tokio::test] + #[serial] async fn test_extract_archive() { let temp_dir = TempDir::new().unwrap(); let _config = create_test_config(temp_dir.path().to_str().unwrap()); @@ -51,7 +53,6 @@ mod package_tests { assert_eq!(content, test_file_content); } Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => { - // допустимый исход для запуска без root return; } Err(e) => panic!("unexpected error in extract_archive: {e}"), @@ -59,6 +60,7 @@ mod package_tests { } #[tokio::test] + #[serial] async fn test_package_check_valid() { let temp_dir = TempDir::new().unwrap(); let _config = create_test_config(temp_dir.path().to_str().unwrap()); @@ -105,8 +107,10 @@ mode = "755" } #[tokio::test] + #[serial] async fn test_package_check_missing_install() { let temp_dir = TempDir::new().unwrap(); + let _config = create_test_config(temp_dir.path().to_str().unwrap()); let archive_path = temp_dir.path().join("test_pkg_without_install.tar.gz"); let file = fs::File::create(&archive_path).unwrap(); @@ -126,7 +130,6 @@ mode = "755" panic!("expected error, got Ok"); } Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => { - // допустимый исход для запуска без root return; } Err(err) => { @@ -137,8 +140,10 @@ mode = "755" } #[tokio::test] + #[serial] async fn test_package_check_empty_install() { let temp_dir = TempDir::new().unwrap(); + let _config = create_test_config(temp_dir.path().to_str().unwrap()); let install_path = temp_dir.path().join("INSTALL"); fs::write(&install_path, "").unwrap(); @@ -158,7 +163,6 @@ mode = "755" panic!("expected error, got Ok"); } Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => { - // допустимый исход для запуска без root return; } Err(err) => { @@ -169,6 +173,7 @@ mode = "755" } #[tokio::test] + #[serial] async fn test_package_check_arch_mismatch() { let temp_dir = TempDir::new().unwrap(); let _config = create_test_config(temp_dir.path().to_str().unwrap()); |
