3 # Copyright (c) 2017 Rebaca 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 """ Unit test testcase for JuJu EPC Implementation"""
17 from functest.opnfv_tests.vnf.epc import juju_epc
20 class JujuEpcTesting(unittest.TestCase):
21 # pylint: disable=missing-docstring
22 """Unittest for ABoT EPC with juju orchestrator"""
26 self.tenant = 'juju_epc'
27 self.creds = {'username': 'user',
29 self.orchestrator = {'name': 'juju',
32 'requirements': {'flavor': {'name': 'm1.small',
35 'repo_link': 'ppa:juju/stable',
36 'dep_package': 'software-'
39 'pip3_packages': 'juju-wait'}}
40 self.vnf = {'name': 'juju_epc',
41 'descriptor': {'version': '1',
42 'file_name': '/src/epc-test/'
45 'epc-bundle/bundle.yaml',
46 'name': 'abot-oai-epc',
47 'requirements': {'flavor':
50 with mock.patch('functest.opnfv_tests.vnf.epc.juju_epc.os.makedirs'), \
51 mock.patch('functest.opnfv_tests.vnf.epc.juju_epc.get_config',
52 return_value={'tenant_images': 'foo',
53 'orchestrator': self.orchestrator,
54 'vnf': self.vnf, 'vnf_test_suite': '',
55 'version': 'whatever'}):
56 self.epc_vnf = juju_epc.JujuEpc()
58 self.images = {'image1': 'url1',
60 self.details = {'orchestrator': {'status': 'PASS', 'duration': 120},
64 @unittest.skip("It must be fixed. Please see JIRA FUNCTEST-915")
65 @mock.patch('os.system')
66 def test_prepare_default(self, *args):
67 """ Unittest for Prepare testcase """
68 self.epc_vnf.orchestrator = self.orchestrator
69 self.assertIsNone(self.epc_vnf.prepare())
70 args[4].assert_called_once_with('test',
76 if __name__ == "__main__":
77 logging.disable(logging.CRITICAL)
78 unittest.main(verbosity=2)