thin-provisioning-tools/features/thin_restore.feature

102 lines
2.5 KiB
Gherkin
Raw Normal View History

2013-06-27 14:10:43 +05:30
Feature: thin_restore
Scenario: print version (-V flag)
When I run thin_restore with -V
Then it should pass with version
Scenario: print version (--version flag)
When I run thin_restore with --version
Then it should pass with version
Scenario: print help (-h)
When I run thin_restore with -h
Then it should pass with:
"""
Usage: thin_restore [options]
Options:
{-h|--help}
{-i|--input} <input xml file>
{-o|--output} <output device or file>
{-q|--quiet}
2013-06-27 14:10:43 +05:30
{-V|--version}
"""
Scenario: print help (--help)
When I run thin_restore with -h
Then it should pass with:
"""
Usage: thin_restore [options]
Options:
{-h|--help}
{-i|--input} <input xml file>
{-o|--output} <output device or file>
{-q|--quiet}
2013-06-27 14:10:43 +05:30
{-V|--version}
"""
Scenario: missing input file
Given the dev file metadata.bin
2013-06-27 14:10:43 +05:30
When I run thin_restore with -o metadata.bin
Then it should fail with:
"""
No input file provided.
2013-06-28 16:49:24 +05:30
"""
2013-09-16 17:36:23 +05:30
Scenario: input file not found
Given the dev file metadata.bin
2013-09-16 17:36:23 +05:30
When I run thin_restore with -i foo.xml -o metadata.bin
Then it should fail
Scenario: missing output file
When I run thin_restore with -i metadata.xml
Then it should fail with:
"""
No output file provided.
"""
Scenario: tiny output file
Given a tiny file
When I run thin_restore with -i metadata.xml -o tiny
Then it should fail with:
"""
Output file too small.
The output file should either be a block device,
or an existing file. The file needs to be large
enough to hold the metadata.
"""
Scenario: --quiet is accepted
2014-08-27 18:31:31 +05:30
Given valid thin metadata
When I run thin_restore with -i metadata.xml -o metadata.bin --quiet
Then it should pass
And the output should contain exactly:
"""
"""
Scenario: -q is accepted
2014-08-27 18:31:31 +05:30
Given valid thin metadata
When I run thin_restore with -i metadata.xml -o metadata.bin -q
Then it should pass
And the output should contain exactly:
"""
"""
2013-06-28 16:49:24 +05:30
Scenario: dump/restore is a noop
2014-08-27 18:31:31 +05:30
Given valid thin metadata
2013-06-28 16:49:24 +05:30
When I dump
And I restore
And I dump
Then dumps 1 and 2 should be identical
Scenario: dump matches original metadata
2014-08-27 18:31:31 +05:30
Given valid thin metadata
When I dump
Then dumps 0 and 1 should be identical
Scenario: dump matches original metadata (small)
2014-08-27 18:31:31 +05:30
Given small thin metadata
When I dump
Then dumps 0 and 1 should be identical