thin-provisioning-tools/features/thin_check.feature

87 lines
2.3 KiB
Gherkin
Raw Normal View History

2013-03-21 01:14:09 +05:30
Feature: thin_check
Scenario: print version (-V flag)
When I run `thin_check -V`
Then it should pass with version
2013-03-21 01:14:09 +05:30
Scenario: print version (--version flag)
When I run `thin_check --version`
Then it should pass with version
2013-03-21 01:14:09 +05:30
Scenario: print help
When I run `thin_check --help`
Then it should pass with:
"""
Usage: thin_check [options] {device|file}
Options:
{-q|--quiet}
{-h|--help}
{-V|--version}
2014-03-27 17:30:17 +05:30
{--clear-needs-check-flag}
2013-05-23 18:27:15 +05:30
{--ignore-non-fatal-errors}
2014-03-27 17:30:17 +05:30
{--skip-mappings}
{--super-block-only}
2013-03-21 01:14:09 +05:30
"""
Scenario: print help
When I run `thin_check -h`
Then it should pass with:
"""
Usage: thin_check [options] {device|file}
Options:
{-q|--quiet}
{-h|--help}
{-V|--version}
2014-03-27 17:30:17 +05:30
{--clear-needs-check-flag}
2013-05-23 16:27:02 +05:30
{--ignore-non-fatal-errors}
2014-03-27 17:30:17 +05:30
{--skip-mappings}
{--super-block-only}
2013-03-21 01:14:09 +05:30
"""
Scenario: Unrecognised option should cause failure
When I run `thin_check --hedeghogs-only`
Then it should fail
Scenario: --super-block-only check passes on valid metadata
2014-08-27 18:31:31 +05:30
Given valid thin metadata
When I run thin_check with --super-block-only
Then it should pass
Scenario: --super-block-only check fails with corrupt superblock
Given a corrupt superblock
When I run thin_check with --super-block-only
Then it should fail with:
"""
examining superblock
superblock is corrupt
bad checksum in superblock
"""
Scenario: --skip-mappings check passes on valid metadata
2014-08-27 18:31:31 +05:30
Given valid thin metadata
When I run thin_check with --skip-mappings
2013-05-23 16:27:02 +05:30
Then it should pass
Scenario: --ignore-non-fatal-errors check passes on valid metadata
2014-08-27 18:31:31 +05:30
Given valid thin metadata
2013-05-23 16:27:02 +05:30
When I run thin_check with --ignore-non-fatal-errors
Then it should pass
Scenario: -q should give no output
Given a corrupt superblock
When I run thin_check with --quiet
Then it should fail
And it should give no output
Scenario: --quiet should give no output
Given a corrupt superblock
When I run thin_check with --quiet
Then it should fail
And it should give no output
2014-03-27 17:30:17 +05:30
Scenario: Accepts --clear-needs-check-flag
2014-08-27 18:31:31 +05:30
Given valid thin metadata
2014-03-27 17:30:17 +05:30
When I run thin_check with --clear-needs-check-flag
Then it should pass