From 2496ccfefd5fd0d500a559db002a051d72c85b4b Mon Sep 17 00:00:00 2001 From: Walter Huf Date: Wed, 3 Sep 2014 16:36:11 -0500 Subject: [PATCH] Adds _netdev for fuse mounts in fstab --- providers/cephfs.rb | 2 +- test/cookbooks/ceph_test/recipes/cephfs.rb | 4 ++++ test/integration/aio/bats/cephfs.bats | 8 +++++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/providers/cephfs.rb b/providers/cephfs.rb index 7396183..a781f5b 100644 --- a/providers/cephfs.rb +++ b/providers/cephfs.rb @@ -25,7 +25,7 @@ def manage_mount(directory, subdir, use_fuse, action) fstype 'fuse.ceph' # needs two slashes to indicate a network mount to chef device "conf=//etc/ceph/ceph.conf,id=#{client_name},keyfile=#{filename}" - options 'defaults' + options 'defaults,_netdev' dump 0 pass 0 action action diff --git a/test/cookbooks/ceph_test/recipes/cephfs.rb b/test/cookbooks/ceph_test/recipes/cephfs.rb index 3ad328b..c4589a8 100644 --- a/test/cookbooks/ceph_test/recipes/cephfs.rb +++ b/test/cookbooks/ceph_test/recipes/cephfs.rb @@ -39,6 +39,10 @@ use_fuse true action [:mount] end +ceph_cephfs '/ceph.fstab' do + use_fuse true + action [:mount, :enable] +end directory '/ceph/subdir' file '/ceph/subdir/file' do content "It works\n" diff --git a/test/integration/aio/bats/cephfs.bats b/test/integration/aio/bats/cephfs.bats index 8dd3cbe..b5d2a99 100644 --- a/test/integration/aio/bats/cephfs.bats +++ b/test/integration/aio/bats/cephfs.bats @@ -8,13 +8,19 @@ @test "/ceph.fuse is mounted" { grep -q -E '^\S+\s+/ceph\.fuse\s+fuse' /proc/mounts } +@test "/ceph.fstab is mounted" { + grep -q -E '^\S+\s+/ceph\.fstab\s+fuse' /proc/mounts +} @test "/ceph is in fstab" { - grep -q -E '^\S+\s+/ceph\s+' /etc/fstab + grep -q -E '^\S+\s+/ceph\s+\S+\s+\S*_netdev\S*\s' /etc/fstab } @test "/ceph.fuse is NOT in fstab" { grep -v -q -E '^\S+\s+/ceph.fuse\s+' /etc/fstab } +@test "/ceph.fstab is in fstab" { + grep -q -E '^\S+\s+/ceph.fstab\s+\S+\s+\S*_netdev\S*\s' /etc/fstab +} @test "test file exists in /ceph" { test -e /ceph/subdir/file