From 184b9d7c11f771a74c981f739c28fa0713f3e3e7 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 20 Jul 2012 08:34:46 +0100 Subject: [PATCH] ocaml: Skip mount-local test if /dev/fuse is not writable. --- ocaml/t/guestfs_500_mount_local.ml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ocaml/t/guestfs_500_mount_local.ml b/ocaml/t/guestfs_500_mount_local.ml index fb22d0266..3047544b0 100644 --- a/ocaml/t/guestfs_500_mount_local.ml +++ b/ocaml/t/guestfs_500_mount_local.ml @@ -30,6 +30,14 @@ let debug = true (* overview debugging messages *) let rec main () = Random.self_init (); + let fuse_writable = + try access "/dev/fuse" [W_OK]; true with Unix_error _ -> false in + if not fuse_writable then ( + printf "%s: test skipped because /dev/fuse is not writable.\n" + Sys.executable_name; + exit 77 + ); + (* Allow the test to be skipped by setting this environment variable. * This is for RHEL 5, where FUSE doesn't work very reliably. *)