Sha256: 5e41f044fa601a8bf7fb23ac76d9b37c948d64aa282a41bd6db0a450bfb8af8a

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

---
title: About the kernel_module Resource
---

# kernel_module

Use the `kernel_module` InSpec audit resource to test kernel modules on Linux platforms. These parameters are located under `/lib/modules`. Any submodule may be tested using this resource.

# Syntax

A `kernel_module` resource block declares a module name, and then tests if that module is a loadable kernel module:

    describe kernel_module('module_name') do
      it { should be_loaded }
    end

where

* `'module_name'` must specify a kernel module, such as `'bridge'`
* `{ should be_loaded }` tests if the module is a loadable kernel module

# Matchers

This InSpec audit resource has the following matchers:

## be

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

## be_loaded

The `be_loaded` matcher tests if the module is a loadable kernel module:

    it { should be_loaded }

## cmp

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

## eq

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

## include

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

## match

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

# Examples

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

## Test if a module is loaded

    describe kernel_module('bridge') do
      it { should be_loaded }
    end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
inspec-1.0.0 docs/resources/kernel_module.md.erb
inspec-1.0.0.beta3 docs/resources/kernel_module.md.erb