Sha256: 10d369a9d2faddbcfa4728b65dd9defe94ae5166262413ab37316514dab33b75

Contents?: true

Size: 1.59 KB

Versions: 20

Compression:

Stored size: 1.59 KB

Contents

---
title: About the mount Resource
---

# mount

Use the `mount` InSpec audit resource to test the mount points on Linux systems.

## Syntax

An `mount` resource block declares the synchronization settings that should be tested:

    describe mount('path') do
      it { should MATCHER 'value' }
    end

where

* `('path')` is the path to the mounted directory
* `MATCHER` is a valid matcher for this resource
* `'value'` is the value to be tested


## Matchers

This InSpec audit resource has the following matchers:

### be

<%= partial "/shared/matcher_be" %>

### be_mounted

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

    it { should be_mounted }

### cmp

<%= partial "/shared/matcher_cmp" %>

### device

The `device` matcher tests the device from the `fstab` table:

    its('device') { should eq  '/dev/mapper/VolGroup-lv_root' }

### eq

<%= partial "/shared/matcher_eq" %>

### include

<%= partial "/shared/matcher_include" %>

### match

<%= partial "/shared/matcher_match" %>

### options

The `options` matcher tests the mount options for the file system from the `fstab` table:

    its('options') { should eq ['rw', 'mode=620'] }

### type

The `type` matcher tests the file system type:

    its('type') { should eq  'ext4' }

## Examples

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

### Test a the mount point on '/'

    describe mount('/') do
      it { should be_mounted }
      its('device') { should eq  '/dev/mapper/VolGroup-lv_root' }
      its('type') { should eq  'ext4' }
      its('options') { should eq ['rw', 'mode=620'] }
    end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
inspec-1.15.0 docs/resources/mount.md.erb
inspec-1.14.1 docs/resources/mount.md.erb
inspec-1.14.0 docs/resources/mount.md.erb
inspec-1.13.0 docs/resources/mount.md.erb
inspec-1.12.0 docs/resources/mount.md.erb
inspec-1.11.0 docs/resources/mount.md.erb
inspec-1.10.0 docs/resources/mount.md.erb
inspec-1.9.0 docs/resources/mount.md.erb
inspec-1.8.0 docs/resources/mount.md.erb
inspec-1.7.2 docs/resources/mount.md.erb
inspec-1.7.1 docs/resources/mount.md.erb
inspec-1.7.0 docs/resources/mount.md.erb
inspec-1.6.0 docs/resources/mount.md.erb
inspec-1.5.0 docs/resources/mount.md.erb
inspec-1.4.1 docs/resources/mount.md.erb
inspec-1.4.0 docs/resources/mount.md.erb
inspec-1.3.0 docs/resources/mount.md.erb
inspec-1.2.1 docs/resources/mount.md.erb
inspec-1.2.0 docs/resources/mount.md.erb
inspec-1.1.0 docs/resources/mount.md.erb