summaryrefslogtreecommitdiffstats
path: root/ocaml
diff options
context:
space:
mode:
authorRichard W.M. Jones <rjones@redhat.com>2012-07-20 08:34:46 +0100
committerRichard W.M. Jones <rjones@redhat.com>2012-07-20 08:35:13 +0100
commit184b9d7c11f771a74c981f739c28fa0713f3e3e7 (patch)
treebcfcb468aea54a7488913ee7b329ac266f97839d /ocaml
parent9d314c7c3f4a22a21d2a2f5b8efe01dd7c43cbe8 (diff)
downloadlibguestfs-184b9d7c11f771a74c981f739c28fa0713f3e3e7.tar.gz
libguestfs-184b9d7c11f771a74c981f739c28fa0713f3e3e7.tar.xz
libguestfs-184b9d7c11f771a74c981f739c28fa0713f3e3e7.zip
ocaml: Skip mount-local test if /dev/fuse is not writable.
Diffstat (limited to 'ocaml')
-rw-r--r--ocaml/t/guestfs_500_mount_local.ml8
1 files changed, 8 insertions, 0 deletions
diff --git a/ocaml/t/guestfs_500_mount_local.ml b/ocaml/t/guestfs_500_mount_local.ml
index fb22d026..3047544b 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.
*)