From ec576100ef8aad9b181b7d34a5c17a1329c422b6 Mon Sep 17 00:00:00 2001 From: Simon Grondin Date: Sun, 25 Feb 2024 11:16:55 -0600 Subject: [PATCH] Make posix open_beneath test idempotent --- lib_eio_posix/test/open_beneath.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_eio_posix/test/open_beneath.ml b/lib_eio_posix/test/open_beneath.ml index f4f0588fa..3b85adebf 100644 --- a/lib_eio_posix/test/open_beneath.ml +++ b/lib_eio_posix/test/open_beneath.ml @@ -40,7 +40,7 @@ let test base path = check ~mode:0 base (path ^ "/") L.Open_flags.rdonly; check ~mode:0 base (path ^ "/.") L.Open_flags.rdonly ) - + let test_denied base path = match L.Open_flags.resolve_beneath with | Some some_resolve_beneath -> @@ -57,7 +57,8 @@ let test_denied base path = let () = try - Eio_posix.run @@ fun _env -> + Eio_posix.run @@ fun env -> + Eio.Path.(rmtree ~missing_ok:true (Eio.Stdenv.cwd env / "test_beneath")); Unix.mkdir "test_beneath" 0o700; Unix.mkdir "test_beneath/subdir" 0o700; Unix.symlink "subdir" "test_beneath/link_subdir";