blob: bb15b0bcc5bb96af358e4b9a602b2adad72a8a8e [file] [log] [blame]
Matteo Scandolo48d3d2d2017-08-08 13:05:27 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -070017#
18# Copyright 2016-present Ciena Corporation
19#
20# Licensed under the Apache License, Version 2.0 (the "License");
21# you may not use this file except in compliance with the License.
22# You may obtain a copy of the License at
23#
24# http://www.apache.org/licenses/LICENSE-2.0
25#
26# Unless required by applicable law or agreed to in writing, software
27# distributed under the License is distributed on an "AS IS" BASIS,
28# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29# See the License for the specific language governing permissions and
30# limitations under the License.
31#
32import unittest
33import subprocess
34from docker import Client
35from itertools import chain
36from nose.tools import *
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -070037from CordContainer import *
A R Karthick76a497a2017-04-12 10:59:39 -070038from CordTestUtils import log_test as log
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -070039import threading
40import time
41import os
42import json
43import pexpect
ChetanGaonkerc220e0d2016-10-05 05:06:25 -070044import urllib
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -070045log.setLevel('INFO')
46
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -070047flatten = lambda l: chain.from_iterable(l)
48
49class xos_exchange(unittest.TestCase):
50
51 dckr = Client()
52 test_path = os.path.dirname(os.path.realpath(__file__))
53 XOS_BASE_CONTAINER_IMAGE = 'xosproject/xos-base:latest'
54 XOS_BASE_CONTAINER_NAME = 'xos-base'
55 XOS_BASE_CONTAINER_PORTS = [8000]
56 XOS_SYN_OPENSTACK_CONTAINER_IMAGE = 'xosproject/xos-synchronizer-openstack'
ChetanGaonkerc220e0d2016-10-05 05:06:25 -070057 XOS_SYN_OPENSTACK_CONTAINER_NAME = 'xos-synchronizer'
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -070058 XOS_SYN_OPENSTACK_CONTAINER_PORTS = [8000]
ChetanGaonkerc220e0d2016-10-05 05:06:25 -070059 XOS_POSTGRESQL_CONTAINER_IMAGE = 'xosproject/xos-postgres'
60 XOS_POSTGRESQL_CONTAINER_NAME = 'xos-db-postgres'
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -070061 XOS_POSTGRESQL_CONTAINER_PORTS = [5432]
ChetanGaonkerc220e0d2016-10-05 05:06:25 -070062 XOS_SYNDICATE_MS_CONTAINER_IMAGE = 'xosproject/syndicate-ms'
63 XOS_SYNDICATE_MS_CONTAINER_NAME = 'xos-syndicate-ms'
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -070064 XOS_SYNDICATE_MS_CONTAINER_PORTS = [8080]
65 XOS_SYNCHRONIZER_VTR_CONTAINER_IMAGE = 'xosproject/xos-synchronizer-vtr'
66 XOS_SYNCHRONIZER_VTR_CONTAINER_NAME = 'xos-synchronizer-vtr'
67 XOS_SYNCHRONIZER_VTR_CONTAINER_PORTS = [8080]
68 XOS_SYNCHRONIZER_VSG_CONTAINER_IMAGE = 'xosproject/xos-synchronizer-vsg'
69 XOS_SYNCHRONIZER_VSG_CONTAINER_NAME = 'xos-synchronizer-vsg'
70 XOS_SYNCHRONIZER_VSG_CONTAINER_PORTS = [8080]
71 XOS_SYNCHRONIZER_ONOS_CONTAINER_IMAGE = 'xosproject/xos-synchronizer-onos'
72 XOS_SYNCHRONIZER_ONOS_CONTAINER_NAME = 'xos-synchronizer-onos'
73 XOS_SYNCHRONIZER_ONOS_CONTAINER_PORTS = [8080]
74 XOS_SYNCHRONIZER_FABRIC_CONTAINER_IMAGE = 'xosproject/xos-synchronizer-fabric'
75 XOS_SYNCHRONIZER_FABRIC_CONTAINER_NAME = 'xos-synchronizer-fabric'
76 XOS_SYNCHRONIZER_FABRIC_CONTAINER_PORTS = [8080]
77 XOS_SYNCHRONIZER_VTN_CONTAINER_IMAGE = 'xosproject/xos-synchronizer-vtn'
78 XOS_SYNCHRONIZER_VTN_CONTAINER_NAME = 'xos-synchronizer-vtn'
79 XOS_SYNCHRONIZER_VTN_CONTAINER_PORTS = [8080]
80 XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_IMAGE = 'xosproject/xos-synchronizer-onboarding'
81 XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_NAME = 'xos-synchronizer-onboarding'
82 XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_PORTS = [8080]
ChetanGaonkerc220e0d2016-10-05 05:06:25 -070083 XOS_API_ERROR_STRING_MATCH_1 = 'The resource you\'re looking for doesn\'t exist'
84 XOS_API_ERROR_STRING_MATCH_2 = 'Application Error'
85 XOS_API_UTILS_POST_LOGIN = 'https://private-anon-873978896e-xos.apiary-mock.com/api/utility/login/'
86 #XOS_API_UTILS_GET_PORTFORWARDING = 'https://private-anon-873978896e-xos.apiary-mock.com/api/portforwarding/port'
87 XOS_API_UTILS_GET_PORT_FORWARDING = 'https://private-anon-873978896e-xos.apiary-mock.com/api/utility/portforwarding/'
88 XOS_API_UTILS_GET_SLICES_PLUS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/utility/slicesplus/'
89 XOS_API_UTILS_GET_SYNCHRONIZER = 'https://private-anon-873978896e-xos.apiary-mock.com/api/utility/synchronizer/'
90 XOS_API_UTILS_GET_ONBOARDING_STATUS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/utility/onboarding/service/ready'
91 XOS_API_UTILS_POST_TOSCA_RECIPE = 'https://private-anon-873978896e-xos.apiary-mock.com/api/utility/tosca/run/'
92 XOS_API_UTILS_GET_SSH_KEYS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/utility/sshkeys/'
93 XOS_API_TENANT_GET_ALL_SUBSCRIBERS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/'
94 XOS_API_TENANT_GET_SUBSCRIBER_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/'
95 XOS_API_TENANT_DELETE_SUBSCRIBER = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/'
96 XOS_API_TENANT_GET_SUBSCRIBER_FEATURE_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/'
97 XOS_API_TENANT_GET_READ_SUBSCRIBER_UPLINK_SPEED = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/uplink_speed/'
98 XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_UPLINK_SPEED = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/uplink_speed/'
99 XOS_API_TENANT_GET_READ_SUBSCRIBER_DOWNLINK_SPEED = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/downlink_speed/'
100 XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_DOWNLINK_SPEED = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/downlink_speed/'
101 XOS_API_TENANT_GET_READ_SUBSCRIBER_FEATURE_CDN = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/cdn/'
102 XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_FEATURE_CDN = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/cdn/'
103 XOS_API_TENANT_GET_READ_SUBSCRIBER_FEATURE_UVERSE = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/uverse/'
104 XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_FEATURE_UVERSE = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/uverse/'
105 XOS_API_TENANT_GET_READ_SUBSCRIBER_FEATURE_STATUS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/status/'
106 XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_FEATURE_STATUS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/subscriber/subscriber_id/features/status/'
107 XOS_API_TENANT_GET_ALL_TRUCKROLL = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/truckroll/truckroll_id/'
108 XOS_API_TENANT_POST_CREATE_TRUCKROLL = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/truckroll/truckroll_id/'
109 XOS_API_TENANT_GET_TRUCKROLL_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/truckroll/truckroll_id/'
110 XOS_API_TENANT_DELETE_TRUCKROLL_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/truckroll/truckroll_id/'
111 XOS_API_TENANT_GET_ALL_vOLT = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/volt/volt_id/'
112 XOS_API_TENANT_POST_CREATE_vOLT = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/volt/volt_id/'
113 XOS_API_TENANT_GET_vOLT_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/cord/volt/volt_id/'
114 XOS_API_TENANT_GET_ALL_ONOS_APPS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/tenant/onos/app/'
115 XOS_API_SERVICE_GET_ALL_EXAMPLE_SERVICE = 'https://private-anon-873978896e-xos.apiary-mock.com/api/service/exampleservice/'
116 XOS_API_SERVICE_GET_ALL_ONOS_SERVICE = 'https://private-anon-873978896e-xos.apiary-mock.com/api/service/onos/'
117 XOS_API_SERVICE_GET_ALL_vSG = 'https://private-anon-873978896e-xos.apiary-mock.com/api/service/vsg/'
118 XOS_API_CORE_GET_ALL_DEPLOYMENTS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/deployments/id/'
119 XOS_API_CORE_POST_CREATE_DEPLOYMENTS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/deployments/id/'
120 XOS_API_CORE_GET_DEPLOYMENT_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/deployments/id/'
121 XOS_API_CORE_DELETE_DEPLOYMENTS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/deployments/id/'
122 XOS_API_CORE_GET_ALL_FLAVORS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/flavoryys/id/'
123 XOS_API_CORE_POST_CREATE_FLAVORS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/flavors/id/'
124 XOS_API_CORE_GET_FLAVOR_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/flavors/id/'
125 XOS_API_CORE_DELETE_FLAVORS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/flavors/id/'
126 XOS_API_CORE_GET_ALL_INSTANCES = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/instances/'
127 XOS_API_CORE_POST_CREATE_INSTANCES = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/instances/?no_hyperlinks=1'
128 XOS_API_CORE_GET_INSTANCE_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/instances/id/'
129 XOS_API_CORE_DELETE_INSTANCES= 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/instances/id/'
130 XOS_API_CORE_GET_ALL_NODES = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/nodes/id/'
131 XOS_API_CORE_GET_ALL_SERVICES = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/services/id/'
132 XOS_API_CORE_POST_CREATE_SERVICE = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/services/id/'
133 XOS_API_CORE_GET_SERVICE_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/services/id/'
134 XOS_API_CORE_DELETE_SERVICE = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/services/id/'
135 XOS_API_CORE_GET_ALL_SITES = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/sites/'
136 XOS_API_CORE_GET_SITES_DETAILS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/sites/id/'
137 XOS_API_CORE_GET_ALL_SLICES = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/slices/id/'
138 XOS_API_CORE_GET_ALL_USERS = 'https://private-anon-873978896e-xos.apiary-mock.com/api/core/users/id/'
139
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700140
141 def setUp(self):
142 ''' Activate the XOS containers'''
143 self.maxDiff = None ##for assert_equal compare outputs on failure
144
145 def tearDown(self):
146 '''Deactivate the xos containers'''
147 log.info('Tear down setup')
148 self.CURRENT_PORT_NUM = 4
149
150 def exists(self, name):
151 return '/{0}'.format(name) in list(flatten(n['Names'] for n in self.dckr.containers()))
152
153
154 def img_exists(self, image):
155 cnt = filter(lambda c: c['Image'] == image, self.dckr.containers())
156 return image in [ctn['RepoTags'][0] if ctn['RepoTags'] else '' for ctn in self.dckr.images()]
157
158 def xos_containers_check(self, name, image):
159 if self.exists(name) != True:
160 if name == self.XOS_BASE_CONTAINER_NAME:
161 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
162 xosBase = Xos_base(prefix = Container.IMAGE_PREFIX, update = False)
163 if name == self.XOS_SYN_OPENSTACK_CONTAINER_NAME:
164 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700165 xosSynOpenstack = XosSynchronizerOpenstack(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700166 if name == self.XOS_POSTGRESQL_CONTAINER_NAME:
167 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700168 xosPostgresql = XosPostgresql(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700169 if name == self.XOS_SYNDICATE_MS_CONTAINER_NAME:
170 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700171 xosSyndicateMs = XosSyndicateMs(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700172 if name == self.XOS_SYNCHRONIZER_VTR_CONTAINER_NAME:
173 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700174 xosSynOpenstack = XosSyncVtr(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700175 if name == self.XOS_SYNCHRONIZER_VSG_CONTAINER_NAME:
176 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700177 xosSynOpenstack = XosSyncVsg(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700178 if name == self.XOS_SYNCHRONIZER_ONOS_CONTAINER_NAME:
179 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700180 xosSynOpenstack = XosSyncOnos(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700181 if name == self.XOS_SYNCHRONIZER_FABRIC_CONTAINER_NAME:
182 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700183 xosSynOpenstack = XosSyncFabric(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700184 if name == self.XOS_SYNCHRONIZER_VTN_CONTAINER_NAME:
185 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700186 xosSynOpenstack = XosSyncVtn(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700187 if name == self.XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_NAME:
188 log.info('%s container is not running, hence build and run it, waiting until container is up' %name)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700189 xosSynOpenstack = XosSynchronizerOnboarding(prefix = Container.IMAGE_PREFIX, update = False)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700190 if self.img_exists(image) != True:
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700191 log.info('%s container image is not built on host' %name)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700192 assert_equal(False, True)
193 if self.exists(name) != True:
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700194 log.info('%s container image is build on host' %name)
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700195 assert_equal(False, True)
196
197 def container_status(self, image, name):
198 ''' This function is checking that container is up and running'''
199 self.xos_containers_check(name, image)
200 container_info = self.dckr.containers(filters ={'name':name, 'status':'running'})
201 log.info('Xos container info= %s' %container_info)
202
203 if not container_info:
204 ## forcely failing test case
205 log.info('%s container is not running, container info %s' %(name,container_info))
206 assert_equal(False, True)
207 else:
208 container_status = container_info[0]['Status']
209 log.info('Xos container status= %s' %container_status)
210 assert_equal(container_status.split(' ')[0], 'Up')
211 return container_info
212
213 def container_ping(self, image, name):
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700214 ''' This function is checking if container is reachable '''
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700215 container_info = self.container_status(image= image, name= name)
216 container_ip = container_info[0]['NetworkSettings']['Networks']['bridge']['IPAddress']
217 ping_status = os.system('ping {} -c 3'.format(container_ip))
218 if ping_status != 0:
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700219 log.info('%s container is not reachable, response %s = '%(name,ping_status))
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700220 assert_equal(ping_status, 0)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700221 log.info('%s container is not reachable, response = %s'%(name,ping_status))
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700222 assert_equal(ping_status, 0)
223
224 def container_listening_ports_info(self, image, name, ports_list):
225 ''' This function is checking that container ports are as excpeted '''
226 container_public_ports = []
227 container_info = self.container_status(image= image, name= name)
228 container_ports = container_info[0]['Ports']
229 container_public_ports.append(container_ports[0]['PublicPort'])
230 log.info('%s container is listening on these ports = %s'%(name,container_ports))
231 log.info('%s container is listening on these public ports = %s'%(name,container_public_ports))
232 for n in range(0,len(ports_list)):
233 port = ports_list[n]
234 if port in container_public_ports:
235 assert_equal(True, True)
236 else:
237 log.info('%s container is not listening on %s port which is not expected' %(name,n))
238 assert_equal(False, True)
239
240 def container_stop_start(self):
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700241 ''' This function is checking if container is stopped and started running again'''
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700242
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700243 def validate_url_response_data(self, url):
244 ''' This function is checking url responce and cross check errors on it output '''
245 response = urllib.urlopen(url)
246 data = response.read()
247 log.info('This is PORT FORWARDING URL reponse data {}'.format(data))
248 if not data:
249 log.info('{} Url did not returned any output from opencloud setup'.format(url))
250 assert_equal(True, False)
251 if self.XOS_API_ERROR_STRING_MATCH_1 in data:
252 log.info('Not an expected output from url'.format(url))
253 assert_equal(True, False)
254 if self.XOS_API_ERROR_STRING_MATCH_2 in data:
255 log.info('Not an expected output from url'.format(url))
256 assert_equal(True, False)
257
258 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700259 def test_xos_base_container_status(self):
260 self.container_status(image = self.XOS_BASE_CONTAINER_IMAGE, name = self.XOS_BASE_CONTAINER_NAME)
261
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700262 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700263 def test_xos_base_container_ping(self):
264 self.container_ping(image = self.XOS_BASE_CONTAINER_IMAGE, name = self.XOS_BASE_CONTAINER_NAME)
265
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700266 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700267 def test_xos_base_container_listening_ports(self):
268 self.container_listening_ports_info(image = self.XOS_BASE_CONTAINER_IMAGE, name = self.XOS_BASE_CONTAINER_NAME,
269 ports_list = self.XOS_BASE_CONTAINER_PORTS)
270
271 def test_xos_sync_openstack_container_status(self):
272 self.container_status(image = self.XOS_SYN_OPENSTACK_CONTAINER_IMAGE, name = self.XOS_SYN_OPENSTACK_CONTAINER_NAME)
273
274 def test_xos_sync_openstack_container_ping(self):
275 self.container_ping(image = self.XOS_SYN_OPENSTACK_CONTAINER_IMAGE, name = self.XOS_SYN_OPENSTACK_CONTAINER_NAME)
276
277 def test_xos_sync_openstack_container_listening_ports(self):
278 self.container_listening_ports_info(image = self.XOS_SYN_OPENSTACK_CONTAINER_IMAGE,
279 name = self.XOS_SYN_OPENSTACK_CONTAINER_NAME,
280 ports_list = self.XOS_SYN_OPENSTACK_CONTAINER_PORTS)
281
282 def test_xos_postgresql_container_status(self):
283 self.container_status(image = self.XOS_POSTGRESQL_CONTAINER_IMAGE, name = self.XOS_POSTGRESQL_CONTAINER_NAME)
284
285 def test_xos_postgresql_container_ping(self):
286 self.container_ping(image = self.XOS_POSTGRESQL_CONTAINER_IMAGE, name = self.XOS_POSTGRESQL_CONTAINER_NAME)
287
288 def test_xos_postgresql_container_listening_ports(self):
289 self.container_listening_ports_info(image = self.XOS_POSTGRESQL_CONTAINER_IMAGE,
290 name = self.XOS_POSTGRESQL_CONTAINER_NAME,
291 ports_list = self.XOS_POSTGRESQL_CONTAINER_PORTS)
292
293 def test_xos_syndicate_ms_container_status(self):
294 self.container_status(image = self.XOS_SYNDICATE_MS_CONTAINER_IMAGE, name = self.XOS_SYNDICATE_MS_CONTAINER_NAME)
295
296 def test_xos_syndicate_ms_container_ping(self):
297 self.container_ping(image = self.XOS_SYNDICATE_MS_CONTAINER_IMAGE, name = self.XOS_SYNDICATE_MS_CONTAINER_NAME)
298
299 def test_xos_syndicate_ms_container_listening_ports(self):
300 self.container_listening_ports_info(image = self.XOS_SYNDICATE_MS_CONTAINER_IMAGE,
301 name = self.XOS_SYNDICATE_MS_CONTAINER_NAME,
302 ports_list = self.XOS_SYNDICATE_MS_CONTAINER_PORTS)
303
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700304 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700305 def test_xos_sync_vtr_container_status(self):
306 self.container_status(image = self.XOS_SYNCHRONIZER_VTR_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_VTR_CONTAINER_NAME)
307
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700308 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700309 def test_xos_sync_vtr_container_ping(self):
310 self.container_ping(image = self.XOS_SYNCHRONIZER_VTR_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_VTR_CONTAINER_NAME)
311
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700312 @nottest
313 def ztest_xos_sync_vtr_container_listening_ports(self):
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700314 self.container_listening_ports_info(image = self.XOS_SYNCHRONIZER_VTR_CONTAINER_IMAGE,
315 name = self.XOS_SYNCHRONIZER_VTR_CONTAINER_NAME,
316 ports_list = self.XOS_SYNCHRONIZER_VTR_CONTAINER_PORTS)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700317
318 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700319 def test_xos_sync_vsg_container_status(self):
320 self.container_status(image = self.XOS_SYNCHRONIZER_VSG_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_VSG_CONTAINER_NAME)
321
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700322 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700323 def test_xos_sync_vsg_container_ping(self):
324 self.container_ping(image = self.XOS_SYNCHRONIZER_VSG_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_VSG_CONTAINER_NAME)
325
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700326 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700327 def test_xos_sync_vsg_container_listening_ports(self):
328 self.container_listening_ports_info(image = self.XOS_SYNCHRONIZER_VSG_CONTAINER_IMAGE,
329 name = self.XOS_SYNCHRONIZER_VSG_CONTAINER_NAME,
330 ports_list = self.XOS_SYNCHRONIZER_VSG_CONTAINER_PORTS)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700331 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700332 def test_xos_sync_onos_container_status(self):
333 self.container_status(image = self.XOS_SYNCHRONIZER_ONOS_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_ONOS_CONTAINER_NAME)
334
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700335 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700336 def test_xos_sync_onos_container_ping(self):
337 self.container_ping(image = self.XOS_SYNCHRONIZER_ONOS_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_ONOS_CONTAINER_NAME)
338
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700339 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700340 def test_xos_sync_onos_container_listening_ports(self):
341 self.container_listening_ports_info(image = self.XOS_SYNCHRONIZER_ONOS_CONTAINER_IMAGE,
342 name = self.XOS_SYNCHRONIZER_ONOS_CONTAINER_NAME,
343 ports_list = self.XOS_SYNCHRONIZER_ONOS_CONTAINER_PORTS)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700344 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700345 def test_xos_sync_fabric_container_status(self):
346 self.container_status(image = self.XOS_SYNCHRONIZER_FABRIC_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_FABRIC_CONTAINER_NAME)
347
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700348 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700349 def test_xos_sync_fabric_container_ping(self):
350 self.container_ping(image = self.XOS_SYNCHRONIZER_FABRIC_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_FABRIC_CONTAINER_NAME)
351
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700352 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700353 def test_xos_sync_fabric_container_listening_ports(self):
354 self.container_listening_ports_info(image = self.XOS_SYNCHRONIZER_FABRIC_CONTAINER_IMAGE,
355 name = self.XOS_SYNCHRONIZER_FABRIC_CONTAINER_NAME,
356 ports_list = self.XOS_SYNCHRONIZER_FABRIC_CONTAINER_PORTS)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700357 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700358 def test_xos_sync_vtn_container_status(self):
359 self.container_status(image = self.XOS_SYNCHRONIZER_VTN_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_VTN_CONTAINER_NAME)
360
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700361 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700362 def test_xos_sync_vtn_container_ping(self):
363 self.container_ping(image = self.XOS_SYNCHRONIZER_VTN_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_VTN_CONTAINER_NAME)
364
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700365 @nottest
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700366 def test_xos_sync_vtn_container_listening_ports(self):
367 self.container_listening_ports_info(image = self.XOS_SYNCHRONIZER_VTN_CONTAINER_IMAGE,
368 name = self.XOS_SYNCHRONIZER_VTN_CONTAINER_NAME,
369 ports_list = self.XOS_SYNCHRONIZER_VTN_CONTAINER_PORTS)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700370
ChetanGaonker2c0e9bb2016-09-21 13:38:37 -0700371 def test_xos_sync_onboarding_container_status(self):
372 self.container_status(image = self.XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_IMAGE)
373
374 def test_xos_sync_onboarding_container_ping(self):
375 self.container_ping(image = self.XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_IMAGE, name = self.XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_IMAGE)
376
377 def test_xos_sync_onboarding_container_listening_ports(self):
378 self.container_listening_ports_info(image = self.XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_IMAGE,
379 name = self.XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_NAME,
380 ports_list = self.XOS_SYNCHRONIZER_ONBOARDING_CONTAINER_PORTS)
ChetanGaonkerc220e0d2016-10-05 05:06:25 -0700381
382 def test_xos_api_post_login(self):
383 response = urllib.urlopen(self.XOS_API_UTILS_POST_LOGIN)
384 data = response.read()
385
386 def test_xos_api_get_utils_port_forwarding(self):
387 self.validate_url_response_data(url = self.XOS_API_UTILS_GET_PORT_FORWARDING)
388
389 def test_xos_api_get_utils_slices_plus(self):
390 self.validate_url_response_data(url = self.XOS_API_UTILS_GET_SLICES_PLUS)
391
392 def test_xos_api_get_utils_synchronizer(self):
393 self.validate_url_response_data(url = self.XOS_API_UTILS_GET_SYNCHRONIZER)
394
395 def test_xos_api_get_utils_onboarding_status(self):
396 self.validate_url_response_data(url = self.XOS_API_UTILS_GET_ONBOARDING_STATUS)
397
398 def test_xos_api_post_utils_tosca_recipe(self):
399 self.validate_url_response_data(url = self.XOS_API_UTILS_POST_TOSCA_RECIPE)
400
401 def test_xos_api_get_utils_ssh_keys(self):
402 self.validate_url_response_data(url = self.XOS_API_UTILS_GET_SSH_KEYS)
403
404 def test_xos_api_get_tenant_all_subscribers(self):
405 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_ALL_SUBSCRIBERS)
406
407 def test_xos_api_get_tenant_subscribers_details(self):
408 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_SUBSCRIBER_DETAILS)
409
410 def test_xos_api_get_tenant_subscriber_delete(self):
411 self.validate_url_response_data(url = self.XOS_API_TENANT_DELETE_SUBSCRIBER)
412
413 def test_xos_api_get_tenant_subscribers_feature_details(self):
414 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_SUBSCRIBER_FEATURE_DETAILS)
415
416 def test_xos_api_get_tenant_read_subscribers_feature_uplink_speed(self):
417 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_READ_SUBSCRIBER_UPLINK_SPEED)
418
419 def test_xos_api_tenant_put_update_subscribers_feature_uplink_speed(self):
420 self.validate_url_response_data(url = self.XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_UPLINK_SPEED)
421
422 def test_xos_api_get_tenant_read_subscribers_feature_downlink_speed(self):
423 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_READ_SUBSCRIBER_DOWNLINK_SPEED)
424
425 def test_xos_api_tenant_put_update_subscribers_feature_downlink_speed(self):
426 self.validate_url_response_data(url = self.XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_DOWNLINK_SPEED)
427
428 def test_xos_api_get_tenant_read_subscribers_feature_cdn(self):
429 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_READ_SUBSCRIBER_FEATURE_CDN)
430
431 def test_xos_api_tenant_put_update_subscribers_feature_cdn(self):
432 self.validate_url_response_data(url = self.XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_FEATURE_CDN)
433
434 def test_xos_api_get_tenant_read_subscribers_feature_uverse(self):
435 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_READ_SUBSCRIBER_FEATURE_UVERSE)
436
437 def test_xos_api_tenant_put_update_subscribers_feature_uverse(self):
438 self.validate_url_response_data(url = self.XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_FEATURE_UVERSE)
439
440 def test_xos_api_get_tenant_read_subscribers_feature_status(self):
441 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_READ_SUBSCRIBER_FEATURE_STATUS)
442
443 def test_xos_api_tenant_put_update_subscribers_feature_status(self):
444 self.validate_url_response_data(url = self.XOS_API_TENANT_PUT_UPDATE_SUBSCRIBER_FEATURE_STATUS)
445
446 def test_xos_api_tenant_get_all_truckroll(self):
447 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_ALL_TRUCKROLL)
448
449 def test_xos_api_tenant_post_create_truckroll(self):
450 self.validate_url_response_data(url = self.XOS_API_TENANT_POST_CREATE_TRUCKROLL)
451
452 def test_xos_api_tenant_get_truckroll_details(self):
453 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_TRUCKROLL_DETAILS)
454
455 def test_xos_api_tenant_delete_trucroll(self):
456 self.validate_url_response_data(url = self.XOS_API_TENANT_DELETE_TRUCKROLL_DETAILS)
457
458 def test_xos_api_tenant_get_all_volt(self):
459 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_ALL_vOLT)
460
461 def test_xos_api_tenant_post_create_vOLT(self):
462 self.validate_url_response_data(url = self.XOS_API_TENANT_POST_CREATE_vOLT)
463
464 def test_xos_api_tenant_get_volt_details(self):
465 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_vOLT_DETAILS)
466
467 def test_xos_api_tenant_get_all_onos_apps(self):
468 self.validate_url_response_data(url = self.XOS_API_TENANT_GET_ALL_ONOS_APPS)
469
470 def test_xos_api_service_get_all_example_service(self):
471 self.validate_url_response_data(url = self.XOS_API_SERVICE_GET_ALL_EXAMPLE_SERVICE)
472
473 def test_xos_api_service_get_all_onos_service(self):
474 self.validate_url_response_data(url = self.XOS_API_SERVICE_GET_ALL_ONOS_SERVICE)
475
476 def test_xos_api_service_get_all_vsg(self):
477 self.validate_url_response_data(url = self.XOS_API_SERVICE_GET_ALL_vSG)
478
479 def test_xos_api_core_get_all_deployments(self):
480 self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_DEPLOYMENTS)
481
482 def test_xos_api_core_post_create_deployments(self):
483 self.validate_url_response_data(url = self.XOS_API_CORE_POST_CREATE_DEPLOYMENTS)
484
485 def test_xos_api_core_get_deployment_details(self):
486 self.validate_url_response_data(url = self.XOS_API_CORE_GET_DEPLOYMENT_DETAILS)
487
488 def test_xos_api_core_delete_deployment(self):
489 self.validate_url_response_data(url = self.XOS_API_CORE_DELETE_DEPLOYMENTS)
490
491 def test_xos_api_core_get_all_flavors(self):
492 self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_FLAVORS)
493
494 def test_xos_api_core_post_create_flavors(self):
495 self.validate_url_response_data(url = self.XOS_API_CORE_POST_CREATE_FLAVORS)
496
497 def test_xos_api_core_get_flavor_details(self):
498 self.validate_url_response_data(url = self.XOS_API_CORE_GET_FLAVOR_DETAILS)
499
500 def test_xos_api_core_delete_flavors(self):
501 self.validate_url_response_data(url = self.XOS_API_CORE_DELETE_FLAVORS)
502
503 def test_xos_api_core_get_all_instances(self):
504 self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_INSTANCES)
505
506 def test_xos_api_core_post_create_instances(self):
507 self.validate_url_response_data(url = self.XOS_API_CORE_POST_CREATE_INSTANCES)
508
509 def test_xos_api_core_get_instance_details(self):
510 self.validate_url_response_data(url = self.XOS_API_CORE_GET_INSTANCE_DETAILS)
511
512 def test_xos_api_core_delete_instance(self):
513 self.validate_url_response_data(url = self.XOS_API_CORE_DELETE_INSTANCES)
514
515 def test_xos_api_core_get_all_nodes(self):
516 self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_NODES)
517
518 def test_xos_api_core_get_all_services(self):
519 self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_SERVICES)
520
521 def test_xos_api_core_post_create_service(self):
522 self.validate_url_response_data(url = self.XOS_API_CORE_POST_CREATE_SERVICE)
523
524 def test_xos_api_core_get_service_details(self):
525 self.validate_url_response_data(url = self.XOS_API_CORE_GET_SERVICE_DETAILS)
526
527 def test_xos_api_core_delete_service(self):
528 self.validate_url_response_data(url = self.XOS_API_CORE_DELETE_SERVICE)
529
530 def test_xos_api_core_get_all_sites(self):
531 self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_SITES)
532
533 def test_xos_api_core_get_site_details(self):
534 self.validate_url_response_data(url = self.XOS_API_CORE_GET_SITES_DETAILS)
535
536 def test_xos_api_core_get_all_slices(self):
537 self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_SLICES)
538
539 def test_xos_api_core_get_all_users(self):
540 self.validate_url_response_data(url = self.XOS_API_CORE_GET_ALL_USERS)