2013-03-20 19:44:09 +00:00
|
|
|
Feature: thin_check
|
|
|
|
Scenario: print version (-V flag)
|
|
|
|
When I run `thin_check -V`
|
2013-06-25 11:11:50 +01:00
|
|
|
Then it should pass with version
|
2013-03-20 19:44:09 +00:00
|
|
|
|
|
|
|
Scenario: print version (--version flag)
|
|
|
|
When I run `thin_check --version`
|
2013-06-25 11:11:50 +01:00
|
|
|
Then it should pass with version
|
2013-03-20 19:44:09 +00:00
|
|
|
|
|
|
|
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 12:00:17 +00:00
|
|
|
{--clear-needs-check-flag}
|
2013-05-23 13:57:15 +01:00
|
|
|
{--ignore-non-fatal-errors}
|
2014-03-27 12:00:17 +00:00
|
|
|
{--skip-mappings}
|
|
|
|
{--super-block-only}
|
2013-03-20 19:44:09 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
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 12:00:17 +00:00
|
|
|
{--clear-needs-check-flag}
|
2013-05-23 11:57:02 +01:00
|
|
|
{--ignore-non-fatal-errors}
|
2014-03-27 12:00:17 +00:00
|
|
|
{--skip-mappings}
|
|
|
|
{--super-block-only}
|
2013-03-20 19:44:09 +00:00
|
|
|
"""
|
2013-04-11 13:40:47 +01:00
|
|
|
|
2013-04-23 15:21:44 +01:00
|
|
|
Scenario: Unrecognised option should cause failure
|
|
|
|
When I run `thin_check --hedeghogs-only`
|
|
|
|
Then it should fail
|
|
|
|
|
2013-04-11 13:40:47 +01:00
|
|
|
Scenario: --super-block-only check passes on valid metadata
|
2014-08-27 14:01:31 +01:00
|
|
|
Given valid thin metadata
|
2013-04-11 13:40:47 +01:00
|
|
|
When I run thin_check with --super-block-only
|
2013-04-23 15:21:44 +01:00
|
|
|
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
|
2013-05-22 14:55:28 +01:00
|
|
|
Then it should fail with:
|
|
|
|
"""
|
|
|
|
examining superblock
|
|
|
|
superblock is corrupt
|
|
|
|
bad checksum in superblock
|
2013-05-23 11:45:08 +01:00
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: --skip-mappings check passes on valid metadata
|
2014-08-27 14:01:31 +01:00
|
|
|
Given valid thin metadata
|
2013-05-23 11:45:08 +01:00
|
|
|
When I run thin_check with --skip-mappings
|
2013-05-23 11:57:02 +01:00
|
|
|
Then it should pass
|
|
|
|
|
|
|
|
Scenario: --ignore-non-fatal-errors check passes on valid metadata
|
2014-08-27 14:01:31 +01:00
|
|
|
Given valid thin metadata
|
2013-05-23 11:57:02 +01:00
|
|
|
When I run thin_check with --ignore-non-fatal-errors
|
2013-06-19 14:13:29 +01:00
|
|
|
Then it should pass
|
|
|
|
|
|
|
|
Scenario: -q should give no output
|
|
|
|
Given a corrupt superblock
|
|
|
|
When I run thin_check with --quiet
|
2013-06-19 14:36:09 +01:00
|
|
|
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 12:00:17 +00:00
|
|
|
|
|
|
|
Scenario: Accepts --clear-needs-check-flag
|
2014-08-27 14:01:31 +01:00
|
|
|
Given valid thin metadata
|
2014-03-27 12:00:17 +00:00
|
|
|
When I run thin_check with --clear-needs-check-flag
|
|
|
|
Then it should pass
|