Bug 666: Fix window_size overflow with Paramiko
[osm/N2VC.git] / tests / integration / test_no_initial_config_primitive.py
1 """
2 Test N2VC when the VNF descriptor does not contain an initial-config-primitive.
3 """
4 import asyncio
5 import logging
6 import pytest
7 from .. import base
8
9
10 # @pytest.mark.serial
11 class TestCharm(base.TestN2VC):
12
13 NSD_YAML = """
14 nsd:nsd-catalog:
15 nsd:
16 - id: noinitconfig-ns
17 name: noinitconfig-ns
18 short-name: noinitconfig-ns
19 description: NS with 1 VNFs noinitconfig-vnf connected by datanet and mgmtnet VLs
20 version: '1.0'
21 logo: osm.png
22 constituent-vnfd:
23 - vnfd-id-ref: noinitconfig-vnf
24 member-vnf-index: '1'
25 vld:
26 - id: mgmtnet
27 name: mgmtnet
28 short-name: mgmtnet
29 type: ELAN
30 mgmt-network: 'true'
31 vim-network-name: mgmt
32 vnfd-connection-point-ref:
33 - vnfd-id-ref: noinitconfig-vnf
34 member-vnf-index-ref: '1'
35 vnfd-connection-point-ref: vnf-mgmt
36 - vnfd-id-ref: noinitconfig-vnf
37 member-vnf-index-ref: '2'
38 vnfd-connection-point-ref: vnf-mgmt
39 - id: datanet
40 name: datanet
41 short-name: datanet
42 type: ELAN
43 vnfd-connection-point-ref:
44 - vnfd-id-ref: noinitconfig-vnf
45 member-vnf-index-ref: '1'
46 vnfd-connection-point-ref: vnf-data
47 - vnfd-id-ref: noinitconfig-vnf
48 member-vnf-index-ref: '2'
49 vnfd-connection-point-ref: vnf-data
50 """
51
52 VNFD_YAML = """
53 vnfd:vnfd-catalog:
54 vnfd:
55 - id: noinitconfig-vnf
56 name: noinitconfig-vnf
57 short-name: noinitconfig-vnf
58 version: '1.0'
59 description: A VNF consisting of 2 VDUs w/charms connected to an internal VL, and one VDU with cloud-init
60 logo: osm.png
61 connection-point:
62 - id: vnf-mgmt
63 name: vnf-mgmt
64 short-name: vnf-mgmt
65 type: VPORT
66 - id: vnf-data
67 name: vnf-data
68 short-name: vnf-data
69 type: VPORT
70 mgmt-interface:
71 cp: vnf-mgmt
72 internal-vld:
73 - id: internal
74 name: internal
75 short-name: internal
76 type: ELAN
77 internal-connection-point:
78 - id-ref: mgmtVM-internal
79 - id-ref: dataVM-internal
80 vdu:
81 - id: mgmtVM
82 name: mgmtVM
83 image: xenial
84 count: '1'
85 vm-flavor:
86 vcpu-count: '1'
87 memory-mb: '1024'
88 storage-gb: '10'
89 interface:
90 - name: mgmtVM-eth0
91 position: '1'
92 type: EXTERNAL
93 virtual-interface:
94 type: VIRTIO
95 external-connection-point-ref: vnf-mgmt
96 - name: mgmtVM-eth1
97 position: '2'
98 type: INTERNAL
99 virtual-interface:
100 type: VIRTIO
101 internal-connection-point-ref: mgmtVM-internal
102 internal-connection-point:
103 - id: mgmtVM-internal
104 name: mgmtVM-internal
105 short-name: mgmtVM-internal
106 type: VPORT
107 cloud-init-file: cloud-config.txt
108 vdu-configuration:
109 juju:
110 charm: native-ci
111 proxy: false
112 config-primitive:
113 - name: test
114
115 """
116
117 # @pytest.mark.serial
118 @pytest.mark.asyncio
119 async def test_charm_no_initial_config_primitive(self, event_loop):
120 """Deploy and execute the initial-config-primitive of a VNF."""
121
122 if self.nsd and self.vnfd:
123 vnf_index = 0
124
125 for config in self.get_config():
126 juju = config['juju']
127 charm = juju['charm']
128
129 await self.deploy(
130 vnf_index,
131 charm,
132 config,
133 event_loop,
134 )
135
136 while await self.running():
137 print("Waiting for test to finish...")
138 await asyncio.sleep(15)
139
140 logging.debug("test_charm_no_initial_config_primitive stopped")
141
142 return 'ok'