Merge "Remove duplicated Firewall Concurrency testcases"
[yardstick.git] / yardstick / tests / unit / network_services / vnf_generic / vnf / test_agnostic_vnf.py
1 # Copyright (c) 2018 Intel Corporation
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #      http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 import unittest
16 import uuid
17
18 from yardstick.network_services.vnf_generic.vnf import agnostic_vnf
19
20 NAME = 'vnf__0'
21
22 VNFD = {
23     'vnfd:vnfd-catalog': {
24         'vnfd': [{
25             'id': 'AgnosticVnf',  # NSB python class mapping
26             'name': 'AgnosticVnf',
27             'short-name': 'AgnosticVnf',
28             'description': 'AgnosticVnf',
29             'mgmt-interface': {
30                 'vdu-id': 'vepcvnf-baremetal',
31                 'user': 'user',
32                 'password': 'password',
33                 'ip': 'ip'
34             },
35             'vdu': [{
36                 'id': 'vepcvnf-baremetal',
37                 'name': 'vepc-vnf-baremetal',
38                 'description': 'vAgnosticVnf workload',
39                 'external-interface': []}],
40             'benchmark': {
41                 'kpi': []}}]}}
42
43
44 class TestAgnosticVnf(unittest.TestCase):
45
46     def setUp(self):
47         self._id = uuid.uuid1().int
48         self.vnfd = VNFD['vnfd:vnfd-catalog']['vnfd'][0]
49         self.agnostic_vnf = agnostic_vnf.AgnosticVnf(NAME, self.vnfd, self._id)
50
51     def test_instantiate(self):
52         self.assertIsNone(self.agnostic_vnf.instantiate({}, {}))
53
54     def test_wait_for_instantiate(self):
55         self.assertIsNone(self.agnostic_vnf.wait_for_instantiate())
56
57     def test_terminate(self):
58         self.assertIsNone(self.agnostic_vnf.terminate())
59
60     def test_scale(self):
61         self.assertIsNone(self.agnostic_vnf.scale())
62
63     def test_collect_kpi(self):
64         self.assertIsNone(self.agnostic_vnf.collect_kpi())
65
66     def test_start_collect(self):
67         self.assertIsNone(self.agnostic_vnf.start_collect())
68
69     def test_stop_collect(self):
70         self.assertIsNone(self.agnostic_vnf.stop_collect())