Sha256: 2a6a8c5388645bc14695b364f93a65ac2117d706a90d8b31e718a948e1641771

Contents?: true

Size: 1.4 KB

Versions: 5

Compression:

Stored size: 1.4 KB

Contents

---
title: About the zfs_dataset Resource
platform: linux
---

# zfs_dataset

Use the `zfs_dataset` InSpec audit resource to test the ZFS datasets on FreeBSD systems.

<br>

## Syntax

A `zfs_dataset` resource block declares the ZFS dataset properties that should be tested:

    describe zfs_dataset('dataset') do
      it { should MATCHER 'value' }
    end

where

* `('dataset')` is the name of the ZFS dataset (eg: `'tank/tmp'`)
* `MATCHER` is a valid matcher for this resource
* `'value'` is the value to be tested

<br>

## Examples

The following examples show how to use this InSpec audit resource.

### Test a dataset of 'tank/tmp'

    describe zfs_dataset('tank/tmp') do
      it { should be_mounted }
      its('atime') { should eq  'on' }
      its('compression') { should eq  'lz4' }
      its('exec') { should eq  'off' }
      its('readonly') { should eq  'off' }
      its('setuid') { should eq  'off' }
    end

<br>

## Matchers

This InSpec audit resource has the matchers listed below, in addition to dynamically exposing all ZFS dataset properties available (see: `man zfs` for the list of supported properties). For a full list of available matchers, please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).

### be_mounted

The `be_mounted` matcher tests if the dataset is accessible from the file system:

    it { should be_mounted }

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
inspec-2.1.81 docs/resources/zfs_dataset.md.erb
inspec-2.1.21 docs/resources/zfs_dataset.md.erb
inspec-2.1.10 docs/resources/zfs_dataset.md.erb
inspec-2.0.32 docs/resources/zfs_dataset.md.erb
inspec-2.0.17 docs/resources/zfs_dataset.md.erb