summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit/v2/test_shell.py
diff options
context:
space:
mode:
Diffstat (limited to 'cinderclient/tests/unit/v2/test_shell.py')
-rw-r--r--cinderclient/tests/unit/v2/test_shell.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/cinderclient/tests/unit/v2/test_shell.py b/cinderclient/tests/unit/v2/test_shell.py
index 3a88691..d183564 100644
--- a/cinderclient/tests/unit/v2/test_shell.py
+++ b/cinderclient/tests/unit/v2/test_shell.py
@@ -496,6 +496,25 @@ class ShellTest(utils.TestCase):
expected = {'os-reset_status': {'status': 'error'}}
self.assert_called('POST', '/volumes/1234/action', body=expected)
+ def test_reset_state_with_attach_status(self):
+ self.run_command('reset-state --attach-status detached 1234')
+ expected = {'os-reset_status': {'status': 'available',
+ 'attach_status': 'detached'}}
+ self.assert_called('POST', '/volumes/1234/action', body=expected)
+
+ def test_reset_state_with_attach_status_with_flag(self):
+ self.run_command('reset-state --state in-use '
+ '--attach-status attached 1234')
+ expected = {'os-reset_status': {'status': 'in-use',
+ 'attach_status': 'attached'}}
+ self.assert_called('POST', '/volumes/1234/action', body=expected)
+
+ def test_reset_state_with_reset_migration_status(self):
+ self.run_command('reset-state --reset-migration-status 1234')
+ expected = {'os-reset_status': {'status': 'available',
+ 'migration_status': 'none'}}
+ self.assert_called('POST', '/volumes/1234/action', body=expected)
+
def test_reset_state_multiple(self):
self.run_command('reset-state 1234 5678 --state error')
expected = {'os-reset_status': {'status': 'error'}}