3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
8 """Test module for orchestra_clearwaterims"""
15 from functest.core import vnf
16 from functest.opnfv_tests.vnf.ims import orchestra_clearwaterims
19 class OrchestraClearwaterImsTesting(unittest.TestCase):
20 """Test class for orchestra_clearwaterims"""
23 self.tenant = 'orchestra_clearwaterims'
24 self.creds = {'username': 'mocked_username',
25 'password': 'mocked_password'}
26 self.tenant_images = {
27 'image1': 'mocked_image_url_1',
28 'image2': 'mocked_image_url_2'
36 'name': 'mocked_flavor',
41 'os_image': 'mocked_image'
44 'url': 'mocked_bootstrap_url',
46 'url': 'mocked_config_url'}
50 'url': 'mocked_userdata_url'
54 'username': 'mocked_username',
55 'password': 'mocked_password'
61 'url': 'mocked_descriptor_url'
65 'name': 'mocked_flavor',
71 self.clearwaterims = {
88 with mock.patch('functest.opnfv_tests.vnf.ims.orchestra_clearwaterims.'
90 mock.patch('functest.opnfv_tests.vnf.ims.orchestra_clearwaterims.'
91 'get_config', return_value={
92 'orchestrator': self.mano,
93 'name': self.mano['name'],
94 'version': self.mano['version'],
95 'requirements': self.mano['requirements'],
96 'credentials': self.mano['credentials'],
97 'bootstrap': self.mano['bootstrap'],
98 'gvnfm': self.mano['gvnfm'],
99 'os_image': self.mano['requirements']['os_image'],
100 'flavor': self.mano['requirements']['flavor'],
101 'url': self.mano['bootstrap']['url'],
102 'config': self.mano['bootstrap']['config'],
103 'tenant_images': self.tenant_images,
105 'orchestra_clearwaterims': self.clearwaterims}):
106 self.ims_vnf = orchestra_clearwaterims.ClearwaterImsVnf()
108 self.details = {'orchestrator': {'status': 'PASS', 'duration': 120},
112 def test_prepare_missing_param(self):
113 """Testing prepare function with missing param"""
114 with self.assertRaises(vnf.VnfPreparationException):
115 self.ims_vnf.prepare()
118 if __name__ == "__main__":
119 logging.disable(logging.CRITICAL)
120 unittest.main(verbosity=2)