+#!/usr/bin/env python
+
# Copyright (c) 2017 Cable Television Laboratories, Inc. and others.
#
# This program and the accompanying materials
#
# http://www.apache.org/licenses/LICENSE-2.0
+"""
+Snaps test suite including openstack client tests, api tests and
+integration tests.
+add_openstack_client_tests: for connection_check
+add_openstack_api_tests: for api_check
+add_openstack_integration_tests: for snaps_smoke
+"""
+
import logging
from snaps.openstack.tests.create_flavor_tests import (
CreateImageSuccessTests, CreateImageNegativeTests,
CreateMultiPartImageTests)
from snaps.openstack.tests.create_instance_tests import (
- CreateInstanceSingleNetworkTests, CreateInstanceOnComputeHost,
+ CreateInstanceOnComputeHost,
CreateInstanceSimpleTests, InstanceSecurityGroupTests,
CreateInstancePortManipulationTests, SimpleHealthCheck,
CreateInstanceFromThreePartImage, CreateInstanceTwoNetTests,
use_keystone=True, log_level=logging.INFO):
"""
Adds tests written to exercise OpenStack client retrieval
+
:param suite: the unittest.TestSuite object to which to add the tests
:param os_creds: and instance of OSCreds that holds the credentials
required by OpenStack
def add_openstack_api_tests(suite, os_creds, ext_net_name, use_keystone=True,
image_metadata=None, log_level=logging.INFO):
+ # pylint: disable=too-many-arguments
"""
Adds tests written to exercise all existing OpenStack APIs
+
:param suite: the unittest.TestSuite object to which to add the tests
:param os_creds: Instance of OSCreds that holds the credentials
required by OpenStack
def add_openstack_integration_tests(suite, os_creds, ext_net_name,
use_keystone=True, flavor_metadata=None,
image_metadata=None, use_floating_ips=True,
+ netconf_override=None,
log_level=logging.INFO):
+ # pylint: disable=too-many-arguments
"""
Adds tests written to exercise all long-running OpenStack integration tests
meaning they will be creating VM instances and potentially performing some
SSH functions through floatingIPs
+
:param suite: the unittest.TestSuite object to which to add the tests
:param os_creds: and instance of OSCreds that holds the credentials
required by OpenStack
(i.e. {'hw:mem_page_size': 'large'})
:param use_floating_ips: when true, all tests requiring Floating IPs will
be added to the suite
+ :param netconf_override: dict() containing the reconfigured network_type,
+ physical_network and segmentation_id
:param log_level: the logging level
:return: None as the tests will be adding to the 'suite' parameter object
"""
CreateInstanceSimpleTests, os_creds=os_creds,
ext_net_name=ext_net_name, use_keystone=use_keystone,
flavor_metadata=flavor_metadata, image_metadata=image_metadata,
- log_level=log_level))
+ netconf_override=netconf_override, log_level=log_level))
suite.addTest(OSIntegrationTestCase.parameterize(
CreateInstancePortManipulationTests, os_creds=os_creds,
ext_net_name=ext_net_name, use_keystone=use_keystone,
flavor_metadata=flavor_metadata, image_metadata=image_metadata,
- log_level=log_level))
+ netconf_override=netconf_override, log_level=log_level))
suite.addTest(OSIntegrationTestCase.parameterize(
InstanceSecurityGroupTests, os_creds=os_creds,
ext_net_name=ext_net_name, use_keystone=use_keystone,
flavor_metadata=flavor_metadata, image_metadata=image_metadata,
- log_level=log_level))
+ netconf_override=netconf_override, log_level=log_level))
suite.addTest(OSIntegrationTestCase.parameterize(
CreateInstanceOnComputeHost, os_creds=os_creds,
ext_net_name=ext_net_name, use_keystone=use_keystone,
flavor_metadata=flavor_metadata, image_metadata=image_metadata,
- log_level=log_level))
+ netconf_override=netconf_override, log_level=log_level))
suite.addTest(OSIntegrationTestCase.parameterize(
CreateInstanceFromThreePartImage, os_creds=os_creds,
ext_net_name=ext_net_name, use_keystone=use_keystone,
flavor_metadata=flavor_metadata, image_metadata=image_metadata,
- log_level=log_level))
+ netconf_override=netconf_override, log_level=log_level))
suite.addTest(OSIntegrationTestCase.parameterize(
CreateInstanceVolumeTests, os_creds=os_creds,
ext_net_name=ext_net_name, use_keystone=use_keystone,
flavor_metadata=flavor_metadata, image_metadata=image_metadata,
- log_level=log_level))
+ netconf_override=netconf_override, log_level=log_level))
suite.addTest(OSIntegrationTestCase.parameterize(
CreateStackSuccessTests, os_creds=os_creds, ext_net_name=ext_net_name,
use_keystone=use_keystone,
log_level=log_level))
if use_floating_ips:
- suite.addTest(OSIntegrationTestCase.parameterize(
- CreateInstanceSingleNetworkTests, os_creds=os_creds,
- ext_net_name=ext_net_name, use_keystone=use_keystone,
- flavor_metadata=flavor_metadata, image_metadata=image_metadata,
- log_level=log_level))
+ # https://jira.opnfv.org/browse/SNAPS-322
+ # suite.addTest(OSIntegrationTestCase.parameterize(
+ # CreateInstanceSingleNetworkTests, os_creds=os_creds,
+ # ext_net_name=ext_net_name, use_keystone=use_keystone,
+ # flavor_metadata=flavor_metadata, image_metadata=image_metadata,
+ # log_level=log_level))
suite.addTest(OSIntegrationTestCase.parameterize(
CreateStackFloatingIpTests, os_creds=os_creds,
ext_net_name=ext_net_name, use_keystone=use_keystone,