mirror of
https://github.com/inspec/inspec
synced 2024-11-23 21:23:29 +00:00
55abdebdc9
* adding df resource Signed-off-by: Vern Burton <me@vernburton.com> * adding unit tests and required mocks for them, created integration test Signed-off-by: Vern Burton <me@vernburton.com> * cleaning up skip test to include only the filename and not full path Signed-off-by: Vern Burton <me@vernburton.com> * adding docs Signed-off-by: Vern Burton <me@vernburton.com> * size makes more sense than space Signed-off-by: Vern Burton <me@vernburton.com> * removing unneeded author lines Signed-off-by: Vern Burton <me@vernburton.com> * as the command changed, changing mock to the new sha Signed-off-by: Vern Burton <me@vernburton.com> * updating to address comments from #2441 * removing author lines * using attr_reader functions * using ruby string functions rather than pipe to sed * adding os family detection * using ResourceFailed as the pattern already existed for OS family detection * using if for future case support for unix and unix-like (FreeBSD) Signed-off-by: Vern Burton <me@vernburton.com> * adding supports to resource metadata, and adding tests that show that resource says that it is not supported on windows/unix. Signed-off-by: Vern Burton <me@vernburton.com> * focusing on linux os family and removing logic for assumed future cases Signed-off-by: Vern Burton <me@vernburton.com> * changing df to filesystem Signed-off-by: Vern Burton <me@vernburton.com>
39 lines
798 B
Text
39 lines
798 B
Text
---
|
|
title: About the filesystem Resource
|
|
---
|
|
|
|
# filesystem
|
|
|
|
Use the `filesystem` InSpec resource to audit filesystem disk space usage
|
|
<br>
|
|
|
|
## Syntax
|
|
|
|
A `filesystem` resource block declares tests for disk space in a partion:
|
|
|
|
describe filesystem('/') do
|
|
its('size') { should be >= 32000 }
|
|
end
|
|
|
|
where
|
|
|
|
* `filesystem('/')` states that it will be looking at the root (/) partition
|
|
* `size` is measured in megabytes (MB)
|
|
|
|
<br>
|
|
|
|
## Examples
|
|
|
|
The following examples show how to use this InSpec audit resource.
|
|
|
|
### Test if the root partition is greater thank 32000 MB
|
|
|
|
describe filesystem('/') do
|
|
its('size') { should be >= 32000 }
|
|
end
|
|
|
|
<br>
|
|
|
|
## Matchers
|
|
|
|
For a full list of available matchers please visit our [matchers page](https://www.inspec.io/docs/reference/matchers/).
|