mirror of
https://github.com/inspec/inspec
synced 2024-11-14 00:47:10 +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
|
## 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
|
```ruby
|
||||||
describe zfs(zfs_pool_name) do
|
describe zfs(zfs_pool_name) do
|
||||||
it { should exist }
|
it { should exist }
|
||||||
it { should have_property({ "key1" => "value1", "key2" => "value2" }) }
|
it { should have_property({ "key1" => "VALUE1", "key2" => "VALUE2" }) }
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
||||||
> where
|
> where
|
||||||
>
|
>
|
||||||
> - `'zfs_pool_name'` is the name of a ZFS Pool
|
> - `'zfs_pool_name'` is the name of a ZFS Pool,
|
||||||
> - `exist` and `have_property` are matchers of this resource
|
> - `exist` and `have_property` are matchers of this resource,
|
||||||
> - `{ "key1" => "value1", "key2" => "value2" }` are properties of the ZFS Pool to test.
|
> - `{ "key1" => "value1", "key2" => "value2" }` are properties of the ZFS Pool to test.
|
||||||
|
|
||||||
## Matchers
|
## Matchers
|
||||||
|
|
||||||
For a full list of available matchers, please visit our [matchers page](https://docs.chef.io/inspec/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
|
### 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
|
```ruby
|
||||||
it { should exist }
|
it { should exist }
|
||||||
|
@ -51,31 +52,32 @@ The `exist` matcher tests if the ZFS Pool exist on the system.
|
||||||
|
|
||||||
### have_property
|
### 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
|
```ruby
|
||||||
it { should have_property({ "key1" => "value1", "key2" => "value2" }) }
|
it { should have_property({ "key1" => "VALUE1", "key2" => "VALUE2" }) }
|
||||||
```
|
```
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
The following examples show how to use this Chef InSpec audit resource.
|
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
|
```ruby
|
||||||
describe zfs("new-pool") do
|
describe zfs("POOL") do
|
||||||
it { should exist }
|
it { should exist }
|
||||||
end
|
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
|
```ruby
|
||||||
describe zfs("new-pool") do
|
describe zfs("POOL") do
|
||||||
it { should have_property({ "failmode" => "wait", "capacity" => "0" }) }
|
it { should have_property({ "failmode" => "WAIT", "capacity" => "0" }) }
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue