summaryrefslogtreecommitdiffstats
path: root/vio
diff options
context:
space:
mode:
authorEthan Lynn <ethanlynnl@vmware.com>2018-06-13 15:03:54 +0800
committerEthan Lynn <ethanlynnl@vmware.com>2018-06-13 15:03:54 +0800
commitbccba0b9435bfdbcd37c11b89b4a6b1e0653fedb (patch)
tree3a120c7ddaf4cd0dc2f6c84fdcf171366aa0f348 /vio
parent9e63b89acf9acdc4afed49b453a5047aa5d28be4 (diff)
Add test_operate_server_reboot
Add test_operate_server_reboot Change-Id: If0fb7e4a754c7c1ac1d0df14939cdd0ddcc30c1e Issue-ID: MULTICLOUD-199 Signed-off-by: Ethan Lynn <ethanlynnl@vmware.com>
Diffstat (limited to 'vio')
-rw-r--r--vio/vio/tests/test_fake_nova_view.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/vio/vio/tests/test_fake_nova_view.py b/vio/vio/tests/test_fake_nova_view.py
index b97435a..e126e32 100644
--- a/vio/vio/tests/test_fake_nova_view.py
+++ b/vio/vio/tests/test_fake_nova_view.py
@@ -139,6 +139,19 @@ class TestFakeNovaServer(unittest.TestCase):
self.assertEqual(
"ACTIVE", fakeResponse.serverMapps[Server]['status'])
+ def test_operate_server_reboot(self):
+ req = mock.Mock()
+ req.META = {
+ "HTTP_X_AUTH_TOKEN": Token
+ }
+ req.body = json.dumps({
+ "reboot": {}
+ })
+ resp = self.view.post(req, "abcd", Server)
+ self.assertEqual(202, resp.status_code)
+ self.assertEqual(
+ "REBOOTING", fakeResponse.serverMapps[Server]['status'])
+
class TestFakeNovaHypervisors(unittest.TestCase):