Commits

evhan committed 10f354c

Add test for unmount with fusermount

  • Participants
  • Parent commits 68873cf

Comments (0)

Files changed (2)

               (else "fuse (interpreted)"))
   (test-group "the filesystem record type" (include "fuse.scm"))
   (test-group "an empty filesystem" (include "empty.scm"))
+  (test-group "unmounting a filesystem" (include "unmount.scm"))
   (test-group "a hello world filesystem" (include "hello.scm"))
   (test-group "directory manipulation" (include "dirs.scm"))
   (test-group "exception handling" (include "exn.scm")))

tests/unmount.scm

+(use fuse posix srfi-18 setup-api test)
+
+(cond-expand
+  ((not linux)
+   (test-assert "No fusermount on this platform" #t))
+  (else
+   (let ((fs (make-filesystem)))
+     (test-assert (create-directory "path" #t))
+     (test-assert (not (filesystem-running? path fs)))
+     (thread-start! (lambda () (start-filesystem path fs)))
+     (thread-sleep! 1)
+     (test-assert (filesystem-running? path fs))
+     (test-assert (zero? (system (format "fusermount -u ~a" path))))
+     (test-assert (not (filesystem-running? path fs)))
+     (test-assert (stop-filesystem path fs))
+     (test-assert (not (stop-filesystem path fs)))
+     (test-assert (delete-directory "path" #t)))))