2013-06-27 09:40:43 +01:00
|
|
|
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>
|
2014-08-05 12:10:34 +01:00
|
|
|
{-q|--quiet}
|
2013-06-27 09:40:43 +01:00
|
|
|
{-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>
|
2014-08-05 12:10:34 +01:00
|
|
|
{-q|--quiet}
|
2013-06-27 09:40:43 +01:00
|
|
|
{-V|--version}
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: missing input file
|
2013-09-16 13:41:55 +01:00
|
|
|
Given the dev file metadata.bin
|
2013-06-27 09:40:43 +01:00
|
|
|
When I run thin_restore with -o metadata.bin
|
|
|
|
Then it should fail with:
|
|
|
|
"""
|
|
|
|
No input file provided.
|
2013-06-28 12:19:24 +01:00
|
|
|
"""
|
|
|
|
|
2013-09-16 13:06:23 +01:00
|
|
|
Scenario: input file not found
|
2013-09-16 13:41:55 +01:00
|
|
|
Given the dev file metadata.bin
|
2013-09-16 13:06:23 +01:00
|
|
|
When I run thin_restore with -i foo.xml -o metadata.bin
|
|
|
|
Then it should fail
|
|
|
|
|
2013-08-16 16:28:25 +01:00
|
|
|
Scenario: missing output file
|
|
|
|
When I run thin_restore with -i metadata.xml
|
|
|
|
Then it should fail with:
|
|
|
|
"""
|
|
|
|
No output file provided.
|
|
|
|
"""
|
|
|
|
|
2014-08-26 13:05:21 +01:00
|
|
|
Scenario: --quiet is accepted
|
2014-08-27 14:01:31 +01:00
|
|
|
Given valid thin metadata
|
2014-08-26 13:05:21 +01:00
|
|
|
When I run thin_restore with -i metadata.xml -o metadata.bin --quiet
|
2014-08-28 14:00:08 +01:00
|
|
|
Then it should pass
|
|
|
|
And the output should contain exactly:
|
2014-08-26 13:05:21 +01:00
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
Scenario: -q is accepted
|
2014-08-27 14:01:31 +01:00
|
|
|
Given valid thin metadata
|
2014-08-26 13:05:21 +01:00
|
|
|
When I run thin_restore with -i metadata.xml -o metadata.bin -q
|
2014-08-28 14:00:08 +01:00
|
|
|
Then it should pass
|
|
|
|
And the output should contain exactly:
|
2014-08-26 13:05:21 +01:00
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
2013-06-28 12:19:24 +01:00
|
|
|
Scenario: dump/restore is a noop
|
2014-08-27 14:01:31 +01:00
|
|
|
Given valid thin metadata
|
2013-06-28 12:19:24 +01:00
|
|
|
When I dump
|
|
|
|
And I restore
|
|
|
|
And I dump
|
2013-06-28 12:28:02 +01:00
|
|
|
Then dumps 1 and 2 should be identical
|
|
|
|
|
|
|
|
Scenario: dump matches original metadata
|
2014-08-27 14:01:31 +01:00
|
|
|
Given valid thin metadata
|
2013-06-28 12:28:02 +01:00
|
|
|
When I dump
|
2013-07-09 13:06:18 +01:00
|
|
|
Then dumps 0 and 1 should be identical
|
|
|
|
|
|
|
|
Scenario: dump matches original metadata (small)
|
2014-08-27 14:01:31 +01:00
|
|
|
Given small thin metadata
|
2013-07-09 13:06:18 +01:00
|
|
|
When I dump
|
|
|
|
Then dumps 0 and 1 should be identical
|