forked from jthornber/thin-provisioning-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathera_restore.feature
95 lines (80 loc) · 2.33 KB
/
era_restore.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Feature: era_restore
Scenario: print version (-V flag)
When I run era_restore with -V
Then it should pass with version
Scenario: print version (--version flag)
When I run era_restore with --version
Then it should pass with version
Scenario: print help (-h)
When I run era_restore with -h
Then it should pass
And the output should contain exactly:
"""
Usage: era_restore [options]
Options:
{-h|--help}
{-i|--input} <input xml file>
{-o|--output} <output device or file>
{-q|--quiet}
{-V|--version}
"""
Scenario: print help (--help)
When I run era_restore with -h
Then it should pass
And the output should contain exactly:
"""
Usage: era_restore [options]
Options:
{-h|--help}
{-i|--input} <input xml file>
{-o|--output} <output device or file>
{-q|--quiet}
{-V|--version}
"""
Scenario: missing input file
Given the dev file metadata.bin
When I run era_restore with -o metadata.bin
Then it should fail with:
"""
No input file provided.
"""
Scenario: input file not found
Given the dev file metadata.bin
When I run era_restore with -i foo.xml -o metadata.bin
Then it should fail
Scenario: missing output file
When I run era_restore with -i metadata.xml
Then it should fail with:
"""
No output file provided.
"""
Scenario: successfully restores a valid xml file
Given a small era xml file
And an empty dev file
When I run era_restore with -i metadata.xml -o metadata.bin
Then it should pass
And the metadata should be valid
Scenario: --quiet is accepted
Given valid era metadata
When I run era_restore with -i metadata.xml -o metadata.bin --quiet
Then it should pass
And the output should contain exactly:
"""
"""
Scenario: -q is accepted
Given valid era metadata
When I run era_restore with -i metadata.xml -o metadata.bin -q
Then it should pass
And the output should contain exactly:
"""
"""
Scenario: dump/restore is a noop
Given valid era metadata
When I era dump
And I era restore
And I era dump
Then dumps 1 and 2 should be identical
Scenario: dump matches original metadata
Given valid era metadata
When I era dump
Then dumps 0 and 1 should be identical