[ARVADOS] created: fa8c5cdb36fa89af92087d6465b207d65ffc9618

Git user git at public.curoverse.com
Thu Mar 9 14:54:11 EST 2017


        at  fa8c5cdb36fa89af92087d6465b207d65ffc9618 (commit)


commit fa8c5cdb36fa89af92087d6465b207d65ffc9618
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Mar 9 14:53:51 2017 -0500

    5036: Add "--subtype foo" flag to set mounted filesystem type to "fuse.foo".

diff --git a/services/fuse/arvados_fuse/command.py b/services/fuse/arvados_fuse/command.py
index ca77cfc..66f8a4d 100644
--- a/services/fuse/arvados_fuse/command.py
+++ b/services/fuse/arvados_fuse/command.py
@@ -31,6 +31,8 @@ class ArgumentParser(argparse.ArgumentParser):
         self.add_argument('mountpoint', type=str, help="""Mount point.""")
         self.add_argument('--allow-other', action='store_true',
                             help="""Let other users read the mount""")
+        self.add_argument('--subtype', type=str, metavar='STRING',
+                            help="""Report mounted filesystem type as "fuse.STRING", instead of just "fuse".""")
 
         mode = self.add_mutually_exclusive_group()
 
@@ -148,6 +150,8 @@ class Mount(object):
                 if getattr(self.args, optname)]
         # Increase default read/write size from 4KiB to 128KiB
         opts += ["big_writes", "max_read=131072"]
+        if self.args.subtype:
+            opts += ["subtype="+self.args.subtype]
         return opts
 
     def _setup_logging(self):
diff --git a/services/fuse/tests/test_mount_type.py b/services/fuse/tests/test_mount_type.py
new file mode 100644
index 0000000..f6a3e89
--- /dev/null
+++ b/services/fuse/tests/test_mount_type.py
@@ -0,0 +1,23 @@
+import logging
+import subprocess
+
+from .integration_test import IntegrationTest
+
+logger = logging.getLogger('arvados.arv-mount')
+
+
+class MountTypeTest(IntegrationTest):
+    @IntegrationTest.mount(argv=["--subtype=arv-mount-test"])
+    def test_mount_type(self):
+        self.pool_test(self.mnt)
+
+    @staticmethod
+    def _test_mount_type(self, mnt):
+        self.assertEqual(["fuse.arv-mount-test"], [
+            toks[4]
+            for toks in [
+                line.split(' ')
+                for line in subprocess.check_output("mount").split("\n")
+            ]
+            if len(toks) > 4 and toks[2] == mnt
+        ])

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list