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:
|
|
|
|
|
|
|
|
"""
|
|
|
|
0.1.5
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: print version (--version flag)
|
|
|
|
When I run `thin_check --version`
|
|
|
|
Then it should pass with:
|
|
|
|
|
|
|
|
"""
|
|
|
|
0.1.5
|
|
|
|
"""
|
|
|
|
|
|
|
|
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}
|
2013-05-23 18:27:15 +05:30
|
|
|
{--super-block-only}
|
|
|
|
{--skip-mappings}
|
|
|
|
{--ignore-non-fatal-errors}
|
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}
|
2013-04-11 18:10:47 +05:30
|
|
|
{--super-block-only}
|
2013-05-23 16:15:08 +05:30
|
|
|
{--skip-mappings}
|
2013-05-23 16:27:02 +05:30
|
|
|
{--ignore-non-fatal-errors}
|
2013-03-21 01:14:09 +05:30
|
|
|
"""
|
2013-04-11 18:10:47 +05:30
|
|
|
|
2013-04-23 19:51:44 +05:30
|
|
|
Scenario: Unrecognised option should cause failure
|
|
|
|
When I run `thin_check --hedeghogs-only`
|
|
|
|
Then it should fail
|
|
|
|
|
2013-04-11 18:10:47 +05:30
|
|
|
Scenario: --super-block-only check passes on valid metadata
|
|
|
|
Given valid metadata
|
|
|
|
When I run thin_check with --super-block-only
|
2013-04-23 19:51:44 +05:30
|
|
|
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 19:25:28 +05:30
|
|
|
Then it should fail with:
|
|
|
|
"""
|
|
|
|
examining superblock
|
|
|
|
superblock is corrupt
|
|
|
|
bad checksum in superblock
|
2013-05-23 16:15:08 +05:30
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: --skip-mappings check passes on valid metadata
|
|
|
|
Given valid 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
|
|
|
|
Given valid metadata
|
|
|
|
When I run thin_check with --ignore-non-fatal-errors
|
2013-05-23 16:15:08 +05:30
|
|
|
Then it should pass
|