From e44841210c53290207db9b958c66cb8019910cb7 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Mon, 11 Mar 2019 13:55:40 +0100 Subject: Remove Snaps-based testcases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Snaps hasn't been synchronized for a while regarding requirements. We do remove it due to the inactivity. All test result tabs will be updated in a second change. Change-Id: I834afd902829ed3883b0e88e92aa806ec43d6fcf Signed-off-by: Cédric Ollivier --- functest/ci/__init__.py | 0 functest/ci/check_deployment.py | 188 ---------------------------------- functest/ci/config_aarch64_patch.yaml | 15 --- functest/ci/config_functest.yaml | 41 -------- functest/ci/config_patch.yaml | 4 - functest/ci/download_images.sh | 5 - functest/ci/testcases.yaml | 43 -------- 7 files changed, 296 deletions(-) delete mode 100644 functest/ci/__init__.py delete mode 100644 functest/ci/check_deployment.py (limited to 'functest/ci') diff --git a/functest/ci/__init__.py b/functest/ci/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/functest/ci/check_deployment.py b/functest/ci/check_deployment.py deleted file mode 100644 index 16c69345c..000000000 --- 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 " - -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 index 835a82737..1e5aed410 100644 --- a/functest/ci/config_aarch64_patch.yaml +++ b/functest/ci/config_aarch64_patch.yaml @@ -80,20 +80,5 @@ os: rally_full: image: /home/opnfv/functest/images/cirros-0.4.0-aarch64-disk.img - snaps: - images: - glance_tests: - disk_file: - /home/opnfv/functest/images/cirros-0.4.0-aarch64-disk.img - cirros: - disk_file: - /home/opnfv/functest/images/cirros-0.4.0-aarch64-disk.img - ubuntu: - disk_file: - /home/opnfv/functest/images/ubuntu-14.04-server-cloudimg-arm64-uefi1.img - centos: - disk_file: - /home/opnfv/functest/images/CentOS-7-aarch64-GenericCloud.qcow2 - tempest: use_custom_flavors: 'True' diff --git a/functest/ci/config_functest.yaml b/functest/ci/config_functest.yaml index 07686f8fa..d7a162f73 100644 --- a/functest/ci/config_functest.yaml +++ b/functest/ci/config_functest.yaml @@ -42,47 +42,6 @@ general: neutron_private_subnet_gateway: 192.168.120.254 neutron_router_name: functest-router -snaps: - use_keystone: 'True' - use_floating_ips: 'True' - flavor_extra_specs: {} - 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 diff --git a/functest/ci/config_patch.yaml b/functest/ci/config_patch.yaml index 42220832e..754f19edf 100644 --- a/functest/ci/config_patch.yaml +++ b/functest/ci/config_patch.yaml @@ -3,8 +3,6 @@ fdio: general: openstack: flavor_ram: 1024 - snaps: - flavor_extra_specs: {'hw:mem_page_size':'large'} vmready1: flavor_ram: 1024 vmready2: @@ -52,8 +50,6 @@ ovs: general: openstack: flavor_ram: 1024 - snaps: - flavor_extra_specs: {'hw:mem_page_size':'large'} vmready1: flavor_ram: 1024 vmready2: diff --git a/functest/ci/download_images.sh b/functest/ci/download_images.sh index 9044bfe99..9612f85b2 100644 --- a/functest/ci/download_images.sh +++ b/functest/ci/download_images.sh @@ -8,16 +8,11 @@ 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://download.cirros-cloud.net/0.4.0/cirros-0.4.0-aarch64-disk.img 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 http://repository.cloudifysource.org/cloudify/19.01.24/community-release/cloudify-docker-manager-community-19.01.24.tar http://testresults.opnfv.org/functest/vyos-1.1.8-amd64.qcow2 http://testresults.opnfv.org/functest/shaker-image.qcow2 http://testresults.opnfv.org/functest/shaker-image-arm64.qcow2 EOF - -xz --decompress --force --keep \ - ${1:-/home/opnfv/functest/images}/CentOS-7-aarch64-GenericCloud.qcow2.xz diff --git a/functest/ci/testcases.yaml b/functest/ci/testcases.yaml index 71d524e5c..672349cb5 100644 --- a/functest/ci/testcases.yaml +++ b/functest/ci/testcases.yaml @@ -145,33 +145,6 @@ tiers: - /src/odl_test/csit/suites/integration/basic - /src/odl_test/csit/suites/openstack/neutron - - - case_name: api_check - project_name: functest - criteria: 100 - blocking: true - description: >- - This test case verifies the retrieval of OpenStack clients: - Keystone, Glance, Neutron and Nova and may perform some - simple queries. When the config value of - snaps.use_keystone is True, functest must have access to - the cloud's private network. - run: - name: api_check - - - - case_name: snaps_health_check - project_name: functest - criteria: 100 - blocking: true - description: >- - This test case creates executes the SimpleHealthCheck - Python test class which creates an, image, flavor, network, - and Cirros VM instance and observes the console output to - validate the single port obtains the correct IP address. - run: - name: snaps_health_check - - case_name: tempest_smoke project_name: functest @@ -295,22 +268,6 @@ tiers: - 'test_networks_multiprovider_rbac' - 'test_auto_allocated_topology_rbac' - - - case_name: snaps_smoke - project_name: functest - criteria: 100 - blocking: false - description: >- - This test case contains tests that setup and destroy - environments with VMs with and without Floating IPs - with a newly created user and project. Set the config - value snaps.use_floating_ips (True|False) to toggle - this functionality. When the config value of - snaps.use_keystone is True, functest must have access to - the cloud's private network. - run: - name: snaps_smoke - - case_name: neutron_trunk project_name: functest -- cgit 1.2.3-korg