mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
review changes
Signed-off-by: Deepa Kumaraswamy <dkumaras@progress.com>
This commit is contained in:
parent
ca952c00bb
commit
a63f4049e3
1 changed files with 17 additions and 15 deletions
|
@ -21,29 +21,30 @@ Chef Inspec distributes this resource.
|
|||
|
||||
## Syntax
|
||||
|
||||
A `zfs` Chef InSpec audit resource allows to test if the named ZFS Pool is present and/or has certain properties.
|
||||
A `zfs` Chef InSpec audit resource allows you to test if the ZFS Pool is present and has specific properties.
|
||||
|
||||
```ruby
|
||||
describe zfs(zfs_pool_name) do
|
||||
it { should exist }
|
||||
it { should have_property({ "key1" => "value1", "key2" => "value2" }) }
|
||||
it { should have_property({ "key1" => "VALUE1", "key2" => "VALUE2" }) }
|
||||
end
|
||||
```
|
||||
|
||||
> where
|
||||
>
|
||||
> - `'zfs_pool_name'` is the name of a ZFS Pool
|
||||
> - `exist` and `have_property` are matchers of this resource
|
||||
> - `'zfs_pool_name'` is the name of a ZFS Pool,
|
||||
> - `exist` and `have_property` are matchers of this resource,
|
||||
> - `{ "key1" => "value1", "key2" => "value2" }` are properties of the ZFS Pool to test.
|
||||
|
||||
## Matchers
|
||||
|
||||
For a full list of available matchers, please visit our [matchers page](https://docs.chef.io/inspec/matchers/).
|
||||
|
||||
The specific matchers of this resource are: `exist` and `have_property`
|
||||
The specific matchers of this resource are: `exist` and `have_property`.
|
||||
|
||||
### exist
|
||||
|
||||
The `exist` matcher tests if the ZFS Pool exist on the system.
|
||||
The `exist` matcher tests if the ZFS Pool exists on the system.
|
||||
|
||||
```ruby
|
||||
it { should exist }
|
||||
|
@ -51,31 +52,32 @@ The `exist` matcher tests if the ZFS Pool exist on the system.
|
|||
|
||||
### have_property
|
||||
|
||||
The `have_property` matcher accepts properties in hash format and tests if the given properties are valid ZFS Pool properties.
|
||||
The `have_property` matcher accepts properties in hash format and tests if the specified properties are valid ZFS Pool properties.
|
||||
|
||||
```ruby
|
||||
it { should have_property({ "key1" => "value1", "key2" => "value2" }) }
|
||||
it { should have_property({ "key1" => "VALUE1", "key2" => "VALUE2" }) }
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
The following examples show how to use this Chef InSpec audit resource.
|
||||
|
||||
### Test if the ZFS Pool exist on the system
|
||||
### Test if the ZFS Pool exists on the system
|
||||
|
||||
`exist` matcher allows to test if the ZFS Pool exist on the system.
|
||||
`exist` matcher allows to test if the ZFS Pool exists on the system.
|
||||
|
||||
```ruby
|
||||
describe zfs("new-pool") do
|
||||
describe zfs("POOL") do
|
||||
it { should exist }
|
||||
end
|
||||
```
|
||||
|
||||
### Test if the given properties are valid ZFS Pool properties.
|
||||
### Test if the specified properties are valid ZFS Pool properties
|
||||
|
||||
`have_property` matcher allows to test if the given properties are valid ZFS Pool properties.
|
||||
`have_property` matcher allows you to test if the specified properties are valid ZFS Pool properties.
|
||||
|
||||
```ruby
|
||||
describe zfs("new-pool") do
|
||||
it { should have_property({ "failmode" => "wait", "capacity" => "0" }) }
|
||||
describe zfs("POOL") do
|
||||
it { should have_property({ "failmode" => "WAIT", "capacity" => "0" }) }
|
||||
end
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue