f8633da296
A flag that deliberately causes the wrong metadata version to be written. Useful for testing the kernel module.
75 lines
1.9 KiB
Gherkin
75 lines
1.9 KiB
Gherkin
Feature: thin_restore
|
|
Scenario: print version (-V flag)
|
|
When I run cache_restore with -V
|
|
Then it should pass with version
|
|
|
|
Scenario: print version (--version flag)
|
|
When I run cache_restore with --version
|
|
Then it should pass with version
|
|
|
|
Scenario: print help (-h)
|
|
When I run cache_restore with -h
|
|
Then it should pass
|
|
And the output should contain exactly:
|
|
|
|
"""
|
|
Usage: cache_restore [options]
|
|
Options:
|
|
{-h|--help}
|
|
{-i|--input} <input xml file>
|
|
{-o|--output} <output device or file>
|
|
{-V|--version}
|
|
|
|
{--debug-override-metadata-version} <integer>
|
|
|
|
"""
|
|
|
|
Scenario: print help (--help)
|
|
When I run cache_restore with -h
|
|
Then it should pass
|
|
And the output should contain exactly:
|
|
|
|
"""
|
|
Usage: cache_restore [options]
|
|
Options:
|
|
{-h|--help}
|
|
{-i|--input} <input xml file>
|
|
{-o|--output} <output device or file>
|
|
{-V|--version}
|
|
|
|
{--debug-override-metadata-version} <integer>
|
|
|
|
"""
|
|
|
|
Scenario: missing input file
|
|
Given the dev file metadata.bin
|
|
When I run cache_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 cache_restore with -i foo.xml -o metadata.bin
|
|
Then it should fail
|
|
|
|
Scenario: missing output file
|
|
When I run cache_restore with -i metadata.xml
|
|
Then it should fail with:
|
|
"""
|
|
No output file provided.
|
|
"""
|
|
|
|
Scenario: successfully restores a valid xml file
|
|
Given a small xml file
|
|
And an empty dev file
|
|
When I run cache_restore with -i metadata.xml -o metadata.bin
|
|
Then it should pass
|
|
|
|
Scenario: accepts --debug-override-metadata-version
|
|
Given a small xml file
|
|
And an empty dev file
|
|
When I run cache_restore with -i metadata.xml -o metadata.bin --debug-override-metadata-version 10298
|
|
Then it should pass
|