aboutsummaryrefslogtreecommitdiffstats
path: root/functest/ci
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-27 14:25:49 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-27 14:27:57 +0100
commitbaa8f2d5f67d45e5761f92cb93fe22050f08d0fe (patch)
tree05ddb33dc893cad35369b3286db944eac79ffe4d /functest/ci
parent53cd7f8176c996014decb7311d9f546f6b8f2497 (diff)
Clean all OpenStack related modules
Xtesting is only focused on the framework and entry points. Change-Id: I1a4146ed8519438b13810a20ddf1140c35bb6ecd Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/ci')
-rw-r--r--functest/ci/check_deployment.py188
-rw-r--r--functest/ci/config_aarch64_patch.yaml56
-rw-r--r--functest/ci/config_functest.yaml185
-rw-r--r--functest/ci/config_patch.yaml20
-rw-r--r--functest/ci/download_images.sh24
-rw-r--r--functest/ci/rally_aarch64_patch.conf5
6 files changed, 0 insertions, 478 deletions
diff --git a/functest/ci/check_deployment.py b/functest/ci/check_deployment.py
deleted file mode 100644
index a475491a..00000000
--- a/functest/ci/check_deployment.py
+++ /dev/null
@@ -1,188 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2017 Ericsson and others.
-#
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-
-"""
-OpenStack deployment checker
-
-Verifies that:
- - Credentials file is given and contains the right information
- - OpenStack endpoints are reachable
-"""
-
-import logging
-import logging.config
-import os
-import socket
-
-import pkg_resources
-from six.moves import urllib
-from snaps.openstack.tests import openstack_tests
-from snaps.openstack.utils import glance_utils
-from snaps.openstack.utils import keystone_utils
-from snaps.openstack.utils import neutron_utils
-from snaps.openstack.utils import nova_utils
-
-from functest.utils import constants
-from functest.opnfv_tests.openstack.snaps import snaps_utils
-
-__author__ = "Jose Lausuch <jose.lausuch@ericsson.com>"
-
-LOGGER = logging.getLogger(__name__)
-
-
-def verify_connectivity(endpoint):
- """ Returns true if an hostname/port is reachable"""
- try:
- connection = socket.socket()
- connection.settimeout(10)
- url = urllib.parse.urlparse(endpoint)
- port = url.port
- if not port:
- port = 443 if url.scheme == "https" else 80
- connection.connect((url.hostname, port))
- LOGGER.debug('%s:%s is reachable!', url.hostname, port)
- return True
- except socket.error:
- LOGGER.error('%s:%s is not reachable.', url.hostname, port)
- except Exception: # pylint: disable=broad-except
- LOGGER.exception(
- 'Errors when verifying connectivity to %s:%s', url.hostname, port)
- return False
-
-
-def get_auth_token(os_creds):
- """ Get auth token """
- sess = keystone_utils.keystone_session(os_creds)
- try:
- return sess.get_token()
- except Exception as error:
- LOGGER.error("Got token ...FAILED")
- raise error
-
-
-class CheckDeployment(object):
- """ Check deployment class."""
-
- def __init__(self, rc_file=constants.ENV_FILE):
- self.rc_file = rc_file
- self.services = ('compute', 'network', 'image')
- self.os_creds = None
-
- def check_rc(self):
- """ Check if RC file exists and contains OS_AUTH_URL """
- if not os.path.isfile(self.rc_file):
- raise IOError('RC file {} does not exist!'.format(self.rc_file))
- if 'OS_AUTH_URL' not in open(self.rc_file).read():
- raise SyntaxError('OS_AUTH_URL not defined in {}.'.
- format(self.rc_file))
-
- def check_auth_endpoint(self):
- """ Verifies connectivity to the OS_AUTH_URL given in the RC file
- and get auth token"""
- rc_endpoint = self.os_creds.auth_url
- if not verify_connectivity(rc_endpoint):
- raise Exception("OS_AUTH_URL {} is not reachable.".
- format(rc_endpoint))
- LOGGER.info("Connectivity to OS_AUTH_URL %s ...OK", rc_endpoint)
- if get_auth_token(self.os_creds):
- LOGGER.info("Got token ...OK")
-
- def check_public_endpoint(self):
- """ Gets the public endpoint and verifies connectivity to it """
- public_endpoint = keystone_utils.get_endpoint(self.os_creds,
- 'identity',
- interface='public')
- if not verify_connectivity(public_endpoint):
- raise Exception("Public endpoint {} is not reachable.".
- format(public_endpoint))
- LOGGER.info("Connectivity to the public endpoint %s ...OK",
- public_endpoint)
-
- def check_service_endpoint(self, service):
- """ Verifies connectivity to a given openstack service """
- endpoint = keystone_utils.get_endpoint(self.os_creds,
- service,
- interface='public')
- if not verify_connectivity(endpoint):
- raise Exception("{} endpoint {} is not reachable.".
- format(service, endpoint))
- LOGGER.info("Connectivity to endpoint '%s' %s ...OK",
- service, endpoint)
-
- def check_nova(self):
- """ checks that a simple nova operation works """
- try:
- client = nova_utils.nova_client(self.os_creds)
- client.servers.list()
- LOGGER.info("Nova service ...OK")
- except Exception as error:
- LOGGER.error("Nova service ...FAILED")
- raise error
-
- def check_neutron(self):
- """ checks that a simple neutron operation works """
- try:
- client = neutron_utils.neutron_client(self.os_creds)
- client.list_networks()
- LOGGER.info("Neutron service ...OK")
- except Exception as error:
- LOGGER.error("Neutron service ...FAILED")
- raise error
-
- def check_glance(self):
- """ checks that a simple glance operation works """
- try:
- client = glance_utils.glance_client(self.os_creds)
- client.images.list()
- LOGGER.info("Glance service ...OK")
- except Exception as error:
- LOGGER.error("Glance service ...FAILED")
- raise error
-
- def check_ext_net(self):
- """ checks if external network exists """
- ext_net = snaps_utils.get_ext_net_name(self.os_creds)
- if ext_net:
- LOGGER.info("External network found: %s", ext_net)
- else:
- raise Exception("ERROR: No external networks in the deployment.")
-
- def check_all(self):
- """
- Calls all the class functions and returns 0 if all of them succeed.
- This is the method called by CLI
- """
- self.check_rc()
- try:
- self.os_creds = openstack_tests.get_credentials(
- os_env_file=self.rc_file,
- proxy_settings_str=None,
- ssh_proxy_cmd=None)
- except:
- raise Exception("Problem while getting credentials object.")
- if self.os_creds is None:
- raise Exception("Credentials is None.")
- self.check_auth_endpoint()
- self.check_public_endpoint()
- for service in self.services:
- self.check_service_endpoint(service)
- self.check_nova()
- self.check_neutron()
- self.check_glance()
- self.check_ext_net()
- return 0
-
-
-def main():
- """Entry point"""
- logging.config.fileConfig(pkg_resources.resource_filename(
- 'functest', 'ci/logging.ini'))
- logging.captureWarnings(True)
- deployment = CheckDeployment()
- return deployment.check_all()
diff --git a/functest/ci/config_aarch64_patch.yaml b/functest/ci/config_aarch64_patch.yaml
deleted file mode 100644
index a87fe25b..00000000
--- a/functest/ci/config_aarch64_patch.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
----
-os:
- general:
- openstack:
- image_name: TestVM
- image_file_name: cirros-d161201-aarch64-disk.img
- image_password: gocubsgo
- extra_properties:
- hw_firmware_type: 'uefi'
- hw_video_model: 'vga'
- short_id: 'ubuntu16.04'
- snaps:
- images:
- glance_tests:
- disk_file:
- /home/opnfv/functest/images/cirros-d161201-aarch64-disk.img
- extra_properties:
- hw_firmware_type: 'uefi'
- short_id: 'ubuntu16.04'
- hw_video_model: 'vga'
- cirros:
- disk_file:
- /home/opnfv/functest/images/cirros-d161201-aarch64-disk.img
- extra_properties:
- hw_firmware_type: 'uefi'
- short_id: 'ubuntu16.04'
- hw_video_model: 'vga'
- ubuntu:
- disk_file:
- /home/opnfv/functest/images/ubuntu-14.04-server-cloudimg-arm64-uefi1.img
- extra_properties:
- hw_firmware_type: 'uefi'
- hw_video_model: 'vga'
- centos:
- disk_file:
- /home/opnfv/functest/images/CentOS-7-aarch64-GenericCloud.qcow2
- extra_properties:
- hw_firmware_type: 'uefi'
- hw_video_model: 'vga'
-
- vping:
- image_name: TestVM
-
- tempest:
- use_custom_flavors: 'True'
-
- odl_sfc:
- image_base_url: "http://artifacts.opnfv.org/sfc/demo"
- image_name: sfc_nsh_danube
- image_file_name: sf_nsh_danube_arm64.img
- image_initrd: sf_nsh_danube_arm64-initrd
- image_kernel: sf_nsh_danube_arm64-kernel
- image_format: ami
- os_cmd_line: 'root=LABEL=cloudimg-rootfs ro'
- doctor:
- image_name: TestVM
diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml
deleted file mode 100644
index eaa860aa..00000000
--- a/functest/ci/config_functest.yaml
+++ /dev/null
@@ -1,185 +0,0 @@
----
-general:
- dir:
- home: /home/opnfv
- repos: /home/opnfv/repos
- repo_tempest: /src/tempest
- repo_vims_test: /src/vims-test
- repo_odl_test: /src/odl_test
- functest: /home/opnfv/functest
- results: /home/opnfv/functest/results
- functest_conf: /home/opnfv/functest/conf
- functest_data: /home/opnfv/functest/data
- ims_data: /home/opnfv/functest/data/ims/
- refstack_data: /home/opnfv/functest/data/refstack
- router_data: /home/opnfv/functest/data/router/
- functest_images: /home/opnfv/functest/images
- rally_inst: /root/.rally
-
- openstack:
- image_name: Cirros-0.4.0
- image_name_alt: Cirros-0.4.0-1
- image_file_name: cirros-0.4.0-x86_64-disk.img
- image_url:
- http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
- image_user: cirros
- image_disk_format: qcow2
- image_username: cirros
- image_password: gocubsgo
-
- flavor_name: opnfv_flavor
- flavor_name_alt: opnfv_flavor_1
- flavor_ram: 512
- flavor_disk: 1
- flavor_vcpus: 1
-
- # Private network for functest. Will be created by config_functest.py
- neutron_private_net_name: functest-net
- neutron_private_subnet_name: functest-subnet
- neutron_private_subnet_cidr: 192.168.120.0/24
- neutron_private_subnet_start: 192.168.120.2
- neutron_private_subnet_end: 192.168.120.254
- neutron_private_subnet_gateway: 192.168.120.254
- neutron_router_name: functest-router
-
-snaps:
- use_keystone: 'True'
- use_floating_ips: 'True'
- images:
- glance_tests:
- disk_file: /home/opnfv/functest/images/cirros-0.4.0-x86_64-disk.img
- cirros:
- disk_file: /home/opnfv/functest/images/cirros-0.4.0-x86_64-disk.img
- ubuntu:
- disk_file:
- /home/opnfv/functest/images/ubuntu-14.04-server-cloudimg-amd64-disk1.img
- centos:
- disk_file:
- /home/opnfv/functest/images/CentOS-7-x86_64-GenericCloud.qcow2
-# netconf_override:
-# network_type: vlan
-# physical_network: physnet2
-# segmentation_id: 2366
-
-# All of these values are optional and will override the values retrieved
-# by the RC file
-# os_creds_override:
-# username: {user}
-# password: {password}
-# auth_url: {auth_url}
-# project_name: {project_name}
-# identity_api_version: {2|3}
-# network_api_version: {2}
-# compute_api_version: {2}
-# image_api_version: {1|2}
-# user_domain_id: {user_domain_id}
-# project_domain_id: {projects_domain_id}
-# interface: {interface}
-# cacert: {True|False}
-# proxy_settings:
-# host: {proxy_host}
-# port: {proxy_port}
-# ssh_proxy_cmd: {OpenSSH -o ProxyCommand value}
-
-vping:
- ping_timeout: 200
- vm_flavor: m1.tiny # adapt to your environment
- vm_name_1: opnfv-vping-1
- vm_name_2: opnfv-vping-2
- image_name: functest-vping
- private_net_name: vping-net
- # network_type: vlan
- # physical_network: physnet2
- # segmentation_id: 2366
- private_subnet_name: vping-subnet
- private_subnet_cidr: 192.168.130.0/24
- router_name: vping-router
- sg_name: vPing-sg
- sg_desc: Security group for vPing test case
- keypair_name: vPing-keypair
- keypair_priv_file: /tmp/vPing-keypair
- keypair_pub_file: /tmp/vPing-keypair.pub
- vm_boot_timeout: 180
- vm_delete_timeout: 100
- vm_ssh_connect_timeout: 60
- cleanup_objects: 'True'
-
-odl_sfc:
- image_base_url: "http://artifacts.opnfv.org/sfc/images"
- image_name: sfc_nsh_danube
- image_file_name: sfc_nsh_danube.qcow2
- image_format: qcow2
-
-tempest:
- verifier_name: opnfv-tempest
- identity:
- tenant_name: tempest
- tenant_description: Tenant for Tempest test suite
- user_name: tempest
- user_password: Tempest123!
- validation:
- ssh_timeout: 130
- object_storage:
- operator_role: SwiftOperator
- # network_type: vlan
- # physical_network: physnet2
- # segmentation_id: 2366
- private_net_name: tempest-net
- private_subnet_name: tempest-subnet
- private_subnet_cidr: 192.168.150.0/24
- router_name: tempest-router
- use_custom_flavors: 'False'
- volume_device_name: vdc
-
-rally:
- deployment_name: opnfv-rally
- network_name: rally-net
- # network_type: vlan
- # physical_network: physnet2
- # segmentation_id: 2366
- subnet_name: rally-subnet
- subnet_cidr: 192.168.140.0/24
- router_name: rally-router
- flavor_name: rally-tiny
- flavor_alt_name: rally-mini
-
-vnf:
- juju_epc:
- config: juju_epc.yaml
- tenant_description: OAI EPC deployed with Juju
- tenant_name: abotepc
- private_net_name: abot-net
- private_subnet_cidr: 172.16.0.0/24
- private_subnet_name: abot-subnet
- external_router: abot-router
- cloudify_ims:
- tenant_name: cloudify_ims
- tenant_description: vIMS
- config: cloudify_ims.yaml
- cloudify_ims_perf:
- tenant_name: cloudify_ims_perf
- tenant_description: vIMS
- config: cloudify_ims_perf.yaml
- orchestra_openims:
- tenant_name: orchestra_openims
- tenant_description: OpenIMS deployed with Open Baton
- config: orchestra.yaml
- orchestra_clearwaterims:
- tenant_name: orchestra_clearwaterims
- tenant_description: Clearwater IMS deployed with Open Baton
- config: orchestra.yaml
- vyos_vrouter:
- tenant_name: vrouter
- tenant_description: vRouter
- config: cloudify_vrouter.yaml
-
-example:
- vm_name: example-vm
- flavor: m1.small
- image_name: functest-example-vm
- private_net_name: example-net
- private_subnet_name: example-subnet
- private_subnet_cidr: 192.168.170.0/24
- router_name: example-router
- sg_name: example-sg
- sg_desc: Example Security group
diff --git a/functest/ci/config_patch.yaml b/functest/ci/config_patch.yaml
deleted file mode 100644
index 32b67057..00000000
--- a/functest/ci/config_patch.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-lxd:
- general:
- openstack:
- image_name: Cirros-0.4.0
- image_file_name: cirros-0.4.0-x86_64-lxc.tar.gz
- image_disk_format: raw
-
-fdio:
- general:
- flavor_extra_specs: {'hw:mem_page_size':'large'}
- image_properties: {'hw_mem_page_size':'large'}
- tempest:
- use_custom_flavors: 'True'
-ovs:
- general:
- flavor_extra_specs: {'hw:mem_page_size':'large'}
- image_properties: {'hw_mem_page_size':'large'}
- tempest:
- use_custom_flavors: 'True'
diff --git a/functest/ci/download_images.sh b/functest/ci/download_images.sh
deleted file mode 100644
index 14cda147..00000000
--- a/functest/ci/download_images.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-set -ex
-
-wget_opts="-N --tries=1 --connect-timeout=30"
-
-cat << EOF | wget ${wget_opts} -i - -P ${1:-/home/opnfv/functest/images}
-http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img
-https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-amd64-disk1.img
-https://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2
-https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img
-http://repository.cloudifysource.org/cloudify/4.0.1/sp-release/cloudify-manager-premium-4.0.1.qcow2
-http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img
-http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-lxc.tar.gz
-http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-disk.img
-http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-initramfs
-http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-kernel
-https://cloud-images.ubuntu.com/releases/14.04/release/ubuntu-14.04-server-cloudimg-arm64-uefi1.img
-http://cloud.centos.org/altarch/7/images/aarch64/CentOS-7-aarch64-GenericCloud.qcow2.xz
-https://sourceforge.net/projects/ool-opnfv/files/vyos-1.1.7.img
-http://marketplace.openbaton.org:8080/api/v1/images/52e2ccc0-1dce-4663-894d-28aab49323aa/img
-EOF
-
-xz --decompress --force --keep ${1:-/home/opnfv/functest/images}/CentOS-7-aarch64-GenericCloud.qcow2.xz
diff --git a/functest/ci/rally_aarch64_patch.conf b/functest/ci/rally_aarch64_patch.conf
deleted file mode 100644
index e5cae813..00000000
--- a/functest/ci/rally_aarch64_patch.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-img_name_regex = ^TestVM$
-img_url = http://download.cirros-cloud.net/daily/20161201/cirros-d161201-aarch64-disk.img
-flavor_ref_ram = 256
-flavor_ref_alt_ram = 256
-heat_instance_type_ram = 256