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
10 # pylint: disable=missing-docstring
17 from functest.core import vnf
18 from functest.opnfv_tests.vnf.router import cloudify_vrouter
21 class CloudifyVrouterTesting(unittest.TestCase):
25 self.tenant = 'cloudify_vrouter'
26 self.creds = {'username': 'user',
28 self.orchestrator = {'name': 'cloudify',
31 'requirements': {'flavor': {'name': 'm1.medium',
33 'os_image': 'manager_4.0'}}
35 self.vnf = {'name': 'vrouter',
36 'descriptor': {'version': '100',
37 'file_name': 'function-test-' +
38 'openstack-blueprint.yaml',
39 'name': 'vrouter-opnfv',
41 'requirements': {'flavor':
45 # pylint: disable=bad-continuation
47 'functest.opnfv_tests.vnf.router.cloudify_vrouter.Utilvnf'), \
48 mock.patch('functest.opnfv_tests.vnf.router.'
49 'cloudify_vrouter.vrouter_base.Utilvnf'), \
50 mock.patch('os.makedirs'), \
52 'functest.utils.functest_utils.get_parameter_from_yaml',
54 'tenant_images': 'foo',
55 'orchestrator': self.orchestrator,
56 'vnf': self.vnf, 'vnf_test_suite': '',
57 'version': 'whatever'}):
59 self.router_vnf = cloudify_vrouter.CloudifyVrouter()
61 self.images = {'image1': 'url1',
63 self.details = {'orchestrator': {'status': 'PASS', 'duration': 120},
67 def test_prepare_missing_param(self):
68 with self.assertRaises(vnf.VnfPreparationException):
69 self.router_vnf.prepare()
72 if __name__ == "__main__":
73 logging.disable(logging.CRITICAL)
74 unittest.main(verbosity=2)