[ARVADOS] updated: b7a664f09052ac048e506bed9bb48b54bc2a9bd4

Git user git at public.curoverse.com
Fri Mar 24 16:00:43 EDT 2017


Summary of changes:
 services/fuse/arvados_fuse/command.py | 23 +++++++-----------
 services/fuse/tests/test_mount.py     | 17 ++++----------
 services/fuse/tests/test_unmount.py   | 44 +++++++++++++++++++++++++++++++++++
 3 files changed, 58 insertions(+), 26 deletions(-)
 create mode 100644 services/fuse/tests/test_unmount.py

       via  b7a664f09052ac048e506bed9bb48b54bc2a9bd4 (commit)
       via  b3fe30840e96e7fa77de047fae2488d703a49d89 (commit)
       via  2d0872f936df8c357bbbf9ec2aa8e35cccb2c5bd (commit)
      from  cebc9af013fbe65d83cb4a60813e3d1871f7ca3a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b7a664f09052ac048e506bed9bb48b54bc2a9bd4
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Mar 24 15:59:56 2017 -0400

    11209: Remove unused imports.

diff --git a/services/fuse/tests/test_mount.py b/services/fuse/tests/test_mount.py
index f623ae5..52d1e02 100644
--- a/services/fuse/tests/test_mount.py
+++ b/services/fuse/tests/test_mount.py
@@ -1,22 +1,15 @@
-import arvados
-import arvados.safeapi
-import arvados_fuse as fuse
-import glob
 import json
 import llfuse
+import logging
+import mock
 import os
-import shutil
 import subprocess
-import sys
-import tempfile
-import threading
 import time
 import unittest
-import logging
-import multiprocessing
+
+import arvados
+import arvados_fuse as fuse
 import run_test_server
-import mock
-import re
 
 from mount_test_base import MountTestBase
 

commit b3fe30840e96e7fa77de047fae2488d703a49d89
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Mar 24 15:59:26 2017 -0400

    11209: Add tests for --unmount and --replace flags.

diff --git a/services/fuse/tests/test_unmount.py b/services/fuse/tests/test_unmount.py
new file mode 100644
index 0000000..9e2ebd7
--- /dev/null
+++ b/services/fuse/tests/test_unmount.py
@@ -0,0 +1,44 @@
+import os
+import subprocess
+
+from integration_test import IntegrationTest
+
+class UnmountTest(IntegrationTest):
+    def setUp(self):
+        super(UnmountTest, self).setUp()
+        self.tmp = self.mnt
+        self.to_delete = []
+
+    def tearDown(self):
+        for d in self.to_delete:
+            os.rmdir(d)
+        super(UnmountTest, self).tearDown()
+
+    def test_replace(self):
+        subprocess.check_call(
+            ['arv-mount', '--subtype', 'test', '--replace',
+             self.mnt])
+        subprocess.check_call(
+            ['arv-mount', '--subtype', 'test', '--replace',
+             '--unmount-timeout', '10',
+             self.mnt])
+        subprocess.check_call(
+            ['arv-mount', '--subtype', 'test', '--replace',
+             '--unmount-timeout', '10',
+             self.mnt,
+             '--exec', 'true'])
+        for m in subprocess.check_output(['mount']).splitlines():
+            self.assertNotIn(' '+self.mnt+' ', m)
+
+    def test_unmount_children(self):
+        for d in ['foo', 'foo/bar', 'bar']:
+            mnt = self.tmp+'/'+d
+            os.mkdir(mnt)
+            self.to_delete.insert(0, mnt)
+        for d in ['bar', 'foo/bar']:
+            mnt = self.tmp+'/'+d
+            subprocess.check_call(
+                ['arv-mount', '--subtype', 'test', mnt])
+        subprocess.check_call(['arv-mount', '--unmount', self.tmp+'/...'])
+        for m in subprocess.check_output(['mount']).splitlines():
+            self.assertNotIn(' '+self.tmp+'/', m)

commit 2d0872f936df8c357bbbf9ec2aa8e35cccb2c5bd
Author: Tom Clegg <tom at curoverse.com>
Date:   Fri Mar 24 15:55:24 2017 -0400

    11209: Fix missing import. Use context handler for standalone mode.

diff --git a/services/fuse/arvados_fuse/command.py b/services/fuse/arvados_fuse/command.py
index fff0c99..ea81051 100644
--- a/services/fuse/arvados_fuse/command.py
+++ b/services/fuse/arvados_fuse/command.py
@@ -12,6 +12,7 @@ import time
 
 import arvados.commands._util as arv_cmd
 from arvados_fuse import *
+from arvados_fuse.unmount import unmount, unmount_all
 from arvados_fuse._version import __version__
 
 class ArgumentParser(argparse.ArgumentParser):
@@ -345,20 +346,14 @@ From here, the following directories are available:
 
     def _run_standalone(self):
         try:
-            llfuse.init(self.operations, self.args.mountpoint, self._fuse_options())
-
-            if not self.args.foreground:
-                self.daemon_ctx = daemon.DaemonContext(
-                    working_directory=os.path.dirname(self.args.mountpoint),
-                    files_preserve=range(
-                        3, resource.getrlimit(resource.RLIMIT_NOFILE)[1]))
-                self.daemon_ctx.open()
-
-            # Subscribe to change events from API server
-            if self.listen_for_events and not self.args.disable_event_listening:
-                self.operations.listen_for_events()
-
-            self._llfuse_main()
+            with self:
+                if not self.args.foreground:
+                    self.daemon_ctx = daemon.DaemonContext(
+                        working_directory=os.path.dirname(self.args.mountpoint),
+                        files_preserve=range(
+                            3, resource.getrlimit(resource.RLIMIT_NOFILE)[1]))
+                    self.daemon_ctx.open()
+                self.llfuse_thread.join(timeout=None)
         except Exception as e:
             self.logger.exception('arv-mount: exception during mount: %s', e)
             exit(getattr(e, 'errno', 1))

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list