summaryrefslogtreecommitdiff
path: root/troveclient/tests/test_instances.py
diff options
context:
space:
mode:
authorAndrey Shestakov <ashestakov@mirantis.com>2013-12-11 17:21:36 +0200
committerAndrey Shestakov <ashestakov@mirantis.com>2014-01-29 19:42:39 +0200
commitb62c7da0a9681c51bdf8dd01402f8b1e2abd2b0f (patch)
treea45ab15956171316295a8ca9251d1d2b0b57d2ec /troveclient/tests/test_instances.py
parent11c45de9e0474e14f787f2e5e2bf26283fcb02f0 (diff)
downloadpython-troveclient-b62c7da0a9681c51bdf8dd01402f8b1e2abd2b0f.tar.gz
Add Neutron support
Currently create instance doesnt work in OS installation with Neutron. To get it work, additional parameter 'nics' should be specified in Nova 'create' call. This change allows user to pass 'nics' parameter when create instance. Syntax to specify '--nic' parameter is same as in novaclient. --nic <net-id=net-uuid,v4-fixed-ip=ip-addr,port-id=port-uuid> This parameter can be specified multiple times, to attach multiple network interfaces to instance. Closes-Bug: #1257838 Change-Id: I76fb0d99512b1ee70441c924835a900ba0b7acd1
Diffstat (limited to 'troveclient/tests/test_instances.py')
-rw-r--r--troveclient/tests/test_instances.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/troveclient/tests/test_instances.py b/troveclient/tests/test_instances.py
index 36eceda..03efa35 100644
--- a/troveclient/tests/test_instances.py
+++ b/troveclient/tests/test_instances.py
@@ -89,10 +89,12 @@ class InstancesTest(testtools.TestCase):
return path, body, inst
self.instances._create = mock.Mock(side_effect=side_effect_func)
+ nics = [{'net-id': '000'}]
p, b, i = self.instances.create("test-name", 103, "test-volume",
['db1', 'db2'], ['u1', 'u2'],
datastore="datastore",
- datastore_version="datastore-version")
+ datastore_version="datastore-version",
+ nics=nics)
self.assertEqual("/instances", p)
self.assertEqual("instance", i)
self.assertEqual(['db1', 'db2'], b["instance"]["databases"])
@@ -102,6 +104,7 @@ class InstancesTest(testtools.TestCase):
self.assertEqual("datastore", b["instance"]["datastore"]["type"])
self.assertEqual("datastore-version",
b["instance"]["datastore"]["version"])
+ self.assertEqual(nics, b["instance"]["nics"])
self.assertEqual(103, b["instance"]["flavorRef"])
def test_list(self):