mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
1fdecc6680
The following new resources have been added; however, they presently only support FreeBSD and similar. * `zfs_dataset`: tests if a named ZFS dataset is present and/or has certain properties. * `zfs_pool`: tests if a named ZFS pool is present and/or has certain properties. Additionally, the `mount` resource has been reworked to include support for FreeBSD; while the existing class was renamed to LinuxMountParser. Unit-tests were added for all of the above. Signed-off-by: Joseph Benden <joe@benden.us>
27 lines
687 B
Ruby
27 lines
687 B
Ruby
# encoding: utf-8
|
|
# author: Joseph Benden
|
|
|
|
require 'helper'
|
|
|
|
describe BsdMountParser do
|
|
let (:parser) { Class.new() { include BsdMountParser }.new }
|
|
|
|
describe '#parse_mount_options' do
|
|
it 'parses nil content' do
|
|
parser.parse_mount_options(nil).must_equal({})
|
|
end
|
|
|
|
it 'parses an empty mount line' do
|
|
parser.parse_mount_options('').must_equal({})
|
|
end
|
|
|
|
it 'parses a valid mount line' do
|
|
info = {
|
|
:device => 'tank/tmp',
|
|
:type => 'zfs',
|
|
:options => ['local', 'noexec', 'nosuid', 'nfsv4acls'],
|
|
}
|
|
parser.parse_mount_options('tank/tmp on /tmp (zfs, local, noexec, nosuid, nfsv4acls)').must_equal(info)
|
|
end
|
|
end
|
|
end
|