![Chris Yeoh](/assets/img/avatar_default.png)
Adds "nova cloudpipe-configure" command Adds shell tests for cloudpipe-list and cloudpipe-create commands which already exist This patch depends on https://review.openstack.org/#/c/15854/ Change-Id: I784f5bf0f25a2d8cae4b7c2c6ccf345842ffe352 Implements: blueprint apis-for-nova-manage
29 lines
903 B
Python
29 lines
903 B
Python
from novaclient import exceptions
|
|
from novaclient.v1_1 import cloudpipe
|
|
from tests import utils
|
|
from tests.v1_1 import fakes
|
|
|
|
|
|
cs = fakes.FakeClient()
|
|
|
|
|
|
class CloudpipeTest(utils.TestCase):
|
|
|
|
def test_list_cloudpipes(self):
|
|
cp = cs.cloudpipe.list()
|
|
cs.assert_called('GET', '/os-cloudpipe')
|
|
[self.assertTrue(isinstance(c, cloudpipe.Cloudpipe)) for c in cp]
|
|
|
|
def test_create(self):
|
|
project = "test"
|
|
cp = cs.cloudpipe.create(project)
|
|
body = {'cloudpipe': {'project_id': project}}
|
|
cs.assert_called('POST', '/os-cloudpipe', body)
|
|
self.assertTrue(isinstance(cp, str))
|
|
|
|
def test_update(self):
|
|
cs.cloudpipe.update("192.168.1.1", 2345)
|
|
body = {'configure_project': {'vpn_ip': "192.168.1.1",
|
|
'vpn_port': 2345}}
|
|
cs.assert_called('PUT', '/os-cloudpipe/configure-project', body)
|