From 8341b9932dc4e8a39dd30e247e534a61378a70cd Mon Sep 17 00:00:00 2001 From: Paul Delafosse Date: Wed, 18 Sep 2024 08:30:37 +0200 Subject: [PATCH] test: try to fix gpg --- src/dots.rs | 4 ++-- src/gpg.rs | 9 +++++---- tests/gpg/trust.txt | 1 + 3 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 tests/gpg/trust.txt diff --git a/src/dots.rs b/src/dots.rs index 48f91a16..51aec9f1 100644 --- a/src/dots.rs +++ b/src/dots.rs @@ -381,7 +381,6 @@ mod tests { Ok(()) } - #[cfg(target_os = "linux")] #[sealed_test(files = ["tests/dotfiles_with_multiple_nested_dir"], before = setup("dotfiles_with_multiple_nested_dir"))] fn copy() -> Result<()> { // Arrange @@ -412,7 +411,6 @@ mod tests { Ok(()) } - #[cfg(target_os = "linux")] #[sealed_test(files = ["tests/dotfiles_non_utf8"], before = setup("dotfiles_non_utf8"))] fn copy_non_utf8() -> Result<()> { let source = PathBuf::from("dotfiles_non_utf8/ferris.png"); @@ -425,6 +423,8 @@ mod tests { vars: Dot::default_vars(), }; + run_cmd!(ls - larth)?; + dot.traverse_and_copy( &source, &PathBuf::from("dotfiles_non_utf8/.dots/ferris.png"), diff --git a/src/gpg.rs b/src/gpg.rs index cf8fe675..6072ca5e 100644 --- a/src/gpg.rs +++ b/src/gpg.rs @@ -122,10 +122,11 @@ mod test { let crate_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); run_cmd!( - gpg --import $crate_dir/tests/gpg/public.gpg; - gpg --import $crate_dir/tests/gpg/private.gpg; - echo -e "5\ny\n" | gpg --no-tty --command-fd 0 --expert --edit-key test@toml.bombadil.org trust; - ).unwrap(); + gpg --batch --yes --import $crate_dir/tests/gpg/public.gpg; + gpg --batch --yes --import $crate_dir/tests/gpg/private.gpg; + gpg --batch --yes --import-ownertrust < $crate_dir/tests/gpg/trust.txt + ) + .unwrap(); } #[sealed_test(before = gpg_setup())] diff --git a/tests/gpg/trust.txt b/tests/gpg/trust.txt new file mode 100644 index 00000000..1a25e749 --- /dev/null +++ b/tests/gpg/trust.txt @@ -0,0 +1 @@ +F171AE59235901B583FAD3DBCA95EAE6059F541F:6: