diff --git a/tests/add.rs b/tests/add.rs index 28b60d12..3e4efaea 100644 --- a/tests/add.rs +++ b/tests/add.rs @@ -89,15 +89,17 @@ fn test_add() { .unwrap(); cmd.assert().code(0); - let output = Command::new("unsquashfs") - .args([ - "-lln", - "-UTC", - tmp_dir.path().join("out1").to_str().unwrap(), - ]) - .output() - .unwrap(); - let expected = r#"drwxr-xr-x 1000/1000 36 2022-10-14 03:02 squashfs-root + #[cfg(target_arch = "x86_64")] + { + let output = Command::new("unsquashfs") + .args([ + "-lln", + "-UTC", + tmp_dir.path().join("out1").to_str().unwrap(), + ]) + .output() + .unwrap(); + let expected = r#"drwxr-xr-x 1000/1000 36 2022-10-14 03:02 squashfs-root drwxr-xr-x 1000/1000 24 2022-10-14 03:02 squashfs-root/b drwxr-xr-x 1000/1000 24 2022-10-14 03:03 squashfs-root/b/c -rw-r--r-- 1000/1000 39 2022-10-14 03:03 squashfs-root/b/c/d @@ -105,5 +107,6 @@ dr----x--t 2/4242 26 1970-01-01 00:01 squashfs-root/test -rw-r--r-- 4242/2 4 1970-01-01 00:02 squashfs-root/test/new "#; - assert_eq!(expected, std::str::from_utf8(&output.stdout).unwrap()); + assert_eq!(expected, std::str::from_utf8(&output.stdout).unwrap()); + } } diff --git a/tests/mutate.rs b/tests/mutate.rs index beaef541..f9a7c024 100644 --- a/tests/mutate.rs +++ b/tests/mutate.rs @@ -102,7 +102,10 @@ fn test_add_00() { } // force output to drop, so buffer is written - // compare - let control_new_path = format!("{TEST_PATH}/control.squashfs"); - test_unsquashfs(&new_path, &control_new_path, None); + // compare when on x86 host + #[cfg(target_arch = "x86_64")] + { + let control_new_path = format!("{TEST_PATH}/control.squashfs"); + test_unsquashfs(&new_path, &control_new_path, None); + } } diff --git a/tests/raw.rs b/tests/raw.rs index 851a43b5..4ba8f706 100644 --- a/tests/raw.rs +++ b/tests/raw.rs @@ -102,6 +102,9 @@ fn test_raw_00() { ); // compare - let control_new_path = format!("{TEST_PATH}/control.squashfs"); - test_unsquashfs(&new_path, &control_new_path, None); + #[cfg(target_arch = "x86_64")] + { + let control_new_path = format!("{TEST_PATH}/control.squashfs"); + test_unsquashfs(&new_path, &control_new_path, None); + } } diff --git a/tests/replace.rs b/tests/replace.rs index f02a8625..3999a552 100644 --- a/tests/replace.rs +++ b/tests/replace.rs @@ -69,28 +69,31 @@ fn test_replace() { cmd.assert().code(0); // extract - let cmd = Command::cargo_bin("unsquashfs") - .unwrap() - .env("RUST_LOG", "none") - .args([ - "--path-filter", - r#"/b/c/d"#, - "-i", - tmp_dir.path().join("replaced").to_str().unwrap(), - "-d", - tmp_dir.path().join("squashfs-root-rust2").to_str().unwrap(), - ]) - .unwrap(); - cmd.assert().code(0); + #[cfg(target_arch = "x86_64")] + { + let cmd = Command::cargo_bin("unsquashfs") + .unwrap() + .env("RUST_LOG", "none") + .args([ + "--path-filter", + r#"/b/c/d"#, + "-i", + tmp_dir.path().join("replaced").to_str().unwrap(), + "-d", + tmp_dir.path().join("squashfs-root-rust2").to_str().unwrap(), + ]) + .unwrap(); + cmd.assert().code(0); - // assert the text changed! - let bytes = std::fs::read( - tmp_dir - .path() - .join("squashfs-root-rust2/b/c/d") - .to_str() - .unwrap(), - ) - .unwrap(); - assert_eq!(bytes, text); + // assert the text changed! + let bytes = std::fs::read( + tmp_dir + .path() + .join("squashfs-root-rust2/b/c/d") + .to_str() + .unwrap(), + ) + .unwrap(); + assert_eq!(bytes, text); + } } diff --git a/tests/test.rs b/tests/test.rs index 7479fc7d..6a336fe0 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -57,6 +57,7 @@ fn full_test( let new_comp_opts = written_new_filesystem.compression_options; assert_eq!(og_comp_opts, new_comp_opts); + #[cfg(target_arch = "x86_64")] match verify { Verify::Extract => { info!("starting squashfs-tools/unsquashfs test"); diff --git a/tests/unsquashfs.rs b/tests/unsquashfs.rs index 5df4cde0..88ee5c42 100644 --- a/tests/unsquashfs.rs +++ b/tests/unsquashfs.rs @@ -8,6 +8,7 @@ use test_assets::TestAssetDef; #[test] #[cfg(feature = "xz")] +#[cfg(target_arch = "x86_64")] fn test_unsquashfs_cli_path_filter() { const FILE_NAME: &str = "870D97.squashfs"; let asset_defs = [TestAssetDef { @@ -53,6 +54,7 @@ fn test_unsquashfs_cli_path_filter() { #[test] #[cfg(feature = "xz")] +#[cfg(target_arch = "x86_64")] fn test_unsquashfs_cli_auto_offset() { use tempfile::tempdir;