Skip to content

Commit

Permalink
Merge pull request #144 from hufman/fix-netdev
Browse files Browse the repository at this point in the history
Adds _netdev for fuse mounts in fstab
  • Loading branch information
hufman committed Sep 16, 2014
2 parents 4771bd2 + 2496ccf commit 6a9071e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion providers/cephfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/cookbooks/ceph_test/recipes/cephfs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 7 additions & 1 deletion test/integration/aio/bats/cephfs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6a9071e

Please sign in to comment.