Merge "Added test descriptors for vCMTS testcase"
[yardstick.git] / yardstick / tests / unit / network_services / vnf_generic / vnf / test_agnostic_vnf.py
1 # Copyright (c) 2018-2019 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
17 from yardstick.network_services.vnf_generic.vnf import agnostic_vnf
18
19 NAME = 'vnf__0'
20
21 VNFD = {
22     'vnfd:vnfd-catalog': {
23         'vnfd': [{
24             'id': 'AgnosticVnf',  # NSB python class mapping
25             'name': 'AgnosticVnf',
26             'short-name': 'AgnosticVnf',
27             'description': 'AgnosticVnf',
28             'mgmt-interface': {
29                 'vdu-id': 'vepcvnf-baremetal',
30                 'user': 'user',
31                 'password': 'password',
32                 'ip': 'ip'
33             },
34             'vdu': [{
35                 'id': 'vepcvnf-baremetal',
36                 'name': 'vepc-vnf-baremetal',
37                 'description': 'vAgnosticVnf workload',
38                 'external-interface': []}],
39             'benchmark': {
40                 'kpi': []}}]}}
41
42
43 class TestAgnosticVnf(unittest.TestCase):
44
45     def setUp(self):
46         self.vnfd = VNFD['vnfd:vnfd-catalog']['vnfd'][0]
47         self.agnostic_vnf = agnostic_vnf.AgnosticVnf(NAME, self.vnfd)
48
49     def test_instantiate(self):
50         self.assertIsNone(self.agnostic_vnf.instantiate({}, {}))
51
52     def test_wait_for_instantiate(self):
53         self.assertIsNone(self.agnostic_vnf.wait_for_instantiate())
54
55     def test_terminate(self):
56         self.assertIsNone(self.agnostic_vnf.terminate())
57
58     def test_scale(self):
59         self.assertIsNone(self.agnostic_vnf.scale())
60
61     def test_collect_kpi(self):
62         self.assertIsNone(self.agnostic_vnf.collect_kpi())
63
64     def test_start_collect(self):
65         self.assertIsNone(self.agnostic_vnf.start_collect())
66
67     def test_stop_collect(self):
68         self.assertIsNone(self.agnostic_vnf.stop_collect())