From 071a41f1d052bd01b181e4ae5d6e9aa5f0b39b8b Mon Sep 17 00:00:00 2001 From: Hans Lindgren Date: Tue, 12 Mar 2013 14:42:36 +0100 Subject: Fix: nova-manage throws uncaught exception on invalid host/service Add a test case for this too. Fix bug 1154089. Change-Id: I3a60e581a9fac945fddf72c4f037ca5cae0005fc --- nova/tests/test_nova_manage.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'nova') diff --git a/nova/tests/test_nova_manage.py b/nova/tests/test_nova_manage.py index b1d1958f0..49f9f3256 100644 --- a/nova/tests/test_nova_manage.py +++ b/nova/tests/test_nova_manage.py @@ -382,3 +382,17 @@ class DBCommandsTestCase(test.TestCase): def test_archive_deleted_rows_negative(self): self.assertRaises(SystemExit, self.commands.archive_deleted_rows, -1) + + +class ServiceCommandsTestCase(test.TestCase): + def setUp(self): + super(ServiceCommandsTestCase, self).setUp() + self.commands = nova_manage.ServiceCommands() + + def test_service_enable_invalid_params(self): + self.assertRaises(SystemExit, + self.commands.enable, 'nohost', 'noservice') + + def test_service_disable_invalid_params(self): + self.assertRaises(SystemExit, + self.commands.disable, 'nohost', 'noservice') -- cgit