diff options
Diffstat (limited to 'novaclient/tests/unit/v2/test_shell.py')
-rw-r--r-- | novaclient/tests/unit/v2/test_shell.py | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/novaclient/tests/unit/v2/test_shell.py b/novaclient/tests/unit/v2/test_shell.py index a57c3794..ad233c5e 100644 --- a/novaclient/tests/unit/v2/test_shell.py +++ b/novaclient/tests/unit/v2/test_shell.py @@ -240,42 +240,42 @@ class ShellTest(utils.TestCase): }}, ) - def test_boot_config_drive(self): + def test_boot_access_ip(self): self.run_command( - 'boot --flavor 1 --image %s --config-drive 1 some-server' % - FAKE_UUID_1) + 'boot --flavor 1 --image %s --access-ip-v4 10.10.10.10 ' + '--access-ip-v6 ::1 some-server' % FAKE_UUID_1) self.assert_called_anytime( 'POST', '/servers', {'server': { 'flavorRef': '1', 'name': 'some-server', 'imageRef': FAKE_UUID_1, - 'min_count': 1, + 'accessIPv4': '10.10.10.10', + 'accessIPv6': '::1', 'max_count': 1, - 'config_drive': True + 'min_count': 1 }}, ) - def test_boot_access_ip(self): + def test_boot_config_drive(self): self.run_command( - 'boot --flavor 1 --image %s --access-ip-v4 10.10.10.10 ' - '--access-ip-v6 ::1 some-server' % FAKE_UUID_1) + 'boot --flavor 1 --image %s --config-drive 1 some-server' % + FAKE_UUID_1) self.assert_called_anytime( 'POST', '/servers', {'server': { 'flavorRef': '1', 'name': 'some-server', 'imageRef': FAKE_UUID_1, - 'accessIPv4': '10.10.10.10', - 'accessIPv6': '::1', + 'min_count': 1, 'max_count': 1, - 'min_count': 1 + 'config_drive': True }}, ) - def test_boot_config_drive_custom(self): + def test_boot_config_drive_false(self): self.run_command( - 'boot --flavor 1 --image %s --config-drive /dev/hda some-server' % + 'boot --flavor 1 --image %s --config-drive false some-server' % FAKE_UUID_1) self.assert_called_anytime( 'POST', '/servers', @@ -285,10 +285,17 @@ class ShellTest(utils.TestCase): 'imageRef': FAKE_UUID_1, 'min_count': 1, 'max_count': 1, - 'config_drive': '/dev/hda' }}, ) + def test_boot_config_drive_invalid_value(self): + ex = self.assertRaises( + exceptions.CommandError, self.run_command, + 'boot --flavor 1 --image %s --config-drive /dev/hda some-server' % + FAKE_UUID_1) + self.assertIn("The value of the '--config-drive' option must be " + "a boolean value.", six.text_type(ex)) + def test_boot_invalid_user_data(self): invalid_file = os.path.join(os.path.dirname(__file__), 'no_such_file') |