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_openims"""
15 from functest.core import vnf
16 from functest.opnfv_tests.vnf.ims import orchestra_openims
19 class OrchestraOpenImsTesting(unittest.TestCase):
20 """Test class for orchestra_openims"""
23 self.tenant = 'orchestra_openims'
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',
88 with mock.patch('functest.opnfv_tests.vnf.ims.orchestra_openims.'
90 mock.patch('functest.opnfv_tests.vnf.ims.orchestra_openims.'
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'],
100 self.mano['requirements']['os_image'],
102 self.mano['requirements']['flavor'],
103 'url': self.mano['bootstrap']['url'],
104 'config': self.mano['bootstrap']['config'],
105 'tenant_images': self.tenant_images,
107 'orchestra_openims': self.openims}):
108 self.ims_vnf = orchestra_openims.OpenImsVnf()
110 self.details = {'orchestrator': {'status': 'PASS', 'duration': 120},
114 def test_prepare_missing_param(self):
115 """Testing prepare function with missing param"""
116 with self.assertRaises(vnf.VnfPreparationException):
117 self.ims_vnf.prepare()
120 if __name__ == "__main__":
121 logging.disable(logging.CRITICAL)
122 unittest.main(verbosity=2)