3 # Copyright (c) 2017 Okinawa Open Laboratory and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
15 from functest.core import vnf
16 from functest.opnfv_tests.vnf.router import cloudify_vrouter
19 class CloudifyVrouterTesting(unittest.TestCase):
23 self.tenant = 'cloudify_vrouter'
24 self.creds = {'username': 'user',
26 self.orchestrator = {'name': 'cloudify',
29 'requirements': {'flavor': {'name': 'm1.medium',
31 'os_image': 'manager_4.0'}}
33 self.vnf = {'name': 'vrouter',
34 'descriptor': {'version': '100',
35 'file_name': 'function-test-' +
36 'openstack-blueprint.yaml',
37 'name': 'vrouter-opnfv',
39 'requirements': {'flavor':
43 with mock.patch('functest.opnfv_tests.vnf.router.cloudify_vrouter.'
45 mock.patch('functest.opnfv_tests.vnf.router.cloudify_vrouter.'
46 'get_config', return_value={
47 'tenant_images': 'foo',
48 'orchestrator': self.orchestrator,
51 'version': 'whatever'}):
53 self.router_vnf = cloudify_vrouter.CloudifyVrouter()
55 self.images = {'image1': 'url1',
57 self.details = {'orchestrator': {'status': 'PASS', 'duration': 120},
61 def test_prepare_missing_param(self):
62 with self.assertRaises(vnf.VnfPreparationException):
63 self.router_vnf.prepare()
66 if __name__ == "__main__":
67 logging.disable(logging.CRITICAL)
68 unittest.main(verbosity=2)