Merge "test gateway in private network"

This commit is contained in:
Jenkins 2016-10-12 13:17:18 +00:00 committed by Gerrit Code Review
commit 3386027448
4 changed files with 99 additions and 2 deletions

View File

@ -599,3 +599,38 @@ Expected results
################
All steps should pass
ID
##
contrail_private_gateway
Description
###########
Check gateway in private network for single nodegroup deployment
Complexity
##########
Advanced
Steps
#####
1. Create an environment
2. Create new netwotk between vSRX ana private network
3. Enable and configure Contrail plugin
4. Deploy cluster
5. Run OSTF tests
6. Run contrail health check tests
Expected results
################
All steps must be completed successfully, without any errors.

View File

@ -17,6 +17,7 @@ under the License.
import os
VSRX_TEMPLATE_PATH = os.environ.get('VSRX_TEMPLATE_PATH', False)
LIBVIRT_NET_PATH = os.environ.get('LIBVIRT_NET_PATH', False)
OSTF_RUN_TIMEOUT = 60 * 60 # 60 minutes
DEPLOY_CLUSTER_TIMEOUT = 25 * 60 # 25 minutes

View File

@ -21,13 +21,14 @@ from devops.helpers.helpers import tcp_ping
from helpers import settings
def activate(
obj=None, vsrx_config=False, vsrx_ip='10.109.4.250'):
def activate(obj=None, vsrx_config=False,
vsrx_ip='10.109.4.250', separate_net=False):
"""Activate vSRX1 image.
:param obj: Test case object
:param vsrx_ip: ip of vSRX router
:param vsrx_config: upload vsrx configuration template
:param separate_net: create network for vSRX router
"""
def call_cmd(cmd):
@ -53,6 +54,14 @@ def activate(
'sed -i -r "s/vSRX1.img/vSRX.400.img/g" logs/vSRX1.xml',
])
if separate_net:
commands = [
'virsh net-create {0}'.format(settings.LIBVIRT_NET_PATH),
'sed -i -r "s/qa_private/vsrx_internal_net/g" logs/vSRX1.xml',
'sed -i -r "s/vSRX.400.img/vSRX_gateway.img/g" logs/vSRX1.xml'
]
map(call_cmd, commands)
logger.info("#" * 10 + 'Create vSRX...' + "#" * 10)
if subprocess.call('virsh create logs/vSRX1.xml', shell=True):
logger.info("#" * 10 + 'VSRX could not be established, '
@ -85,3 +94,4 @@ def upload_config(obj, config_path, vsrx_ip):
for command in commands:
logger.info('Execute command {0}.'.format(command))
remote.execute_async(command)

View File

@ -716,3 +716,54 @@ class FunctionalTests(TestBasic):
self.show_step(14)
TestContrailCheck(self).cloud_check(['contrail'])
@test(depends_on=[SetupEnvironment.prepare_slaves_9],
groups=["contrail_private_gateway"])
@log_snapshot_after_test
def contrail_ostf_net_provisioning_disable(self):
"""Check gateway in private network for single nodegroup deployment
Scenario:
1. Create an environment
2. Enable and configure Contrail plugin
3. Create new netwotk between vSRX ana private network
4. Deploy cluster with following node configuration:
* 3 controller+ceph-osd
* 2 compute
* Contrail-controller + contrail-analytics
* Contrail-analytics + contrail-analytics-db
5. Run OSTF tests
6. Run contrail health check tests
"""
conf_contrail = {'contrail_single_gateway': '10.109.4.1',
'contrail_gateways': '10.109.5.250'}
conf_env = {
'slave-01': ['controller', 'ceph-osd'],
'slave-02': ['controller', 'ceph-osd'],
'slave-03': ['controller', 'ceph-osd'],
'slave-04': ['compute'],
'slave-05': ['compute'],
'slave-06': ['contrail-controller', 'contrail-analytics'],
'slave-07': ['contrail-analytics', 'contrail-analytics-db'],
}
self.show_step(1)
plugin.prepare_contrail_plugin(self, slaves=9,
options={
'images_ceph': True,
'volumes_ceph': True,
'ephemeral_ceph': True,
'objects_ceph': True,
'volumes_lvm': False})
self.show_step(2)
plugin.activate_plugin(self, **conf_contrail)
self.show_step(3)
vsrx_setup_result = vsrx.activate(separate_net=True)
plugin.show_range(self, 4, 7)
openstack.update_deploy_check(self, conf_env,
is_vsrx=vsrx_setup_result)