Merge "Add pre_commit tests for neutron"
This commit is contained in:
commit
9fda441c8f
|
@ -63,7 +63,9 @@ def check_pod_status_by_name(name, k8sclient, namespace='ccp', count=None):
|
|||
pod_names = [pod.name for pod in
|
||||
k8sclient.pods.list(namespace=namespace) if name in pod.name]
|
||||
if count:
|
||||
assert len(pod_names), count
|
||||
fail_msg = 'Unexpected count of pods {0}. Current {1}'.format(
|
||||
pod_names, len(pod_names))
|
||||
assert len(pod_names) == count, fail_msg
|
||||
for pod in pod_names:
|
||||
|
||||
assert k8sclient.pods.get(
|
||||
|
|
|
@ -61,10 +61,6 @@ KUBE_PROXY_MODE = os.environ.get("KUBE_PROXY_MODE", "iptables")
|
|||
IPIP_USAGE = get_var_as_bool('IPIP_USAGE', True)
|
||||
DOCKER_VERSION = float(os.environ.get("DOCKER_VERSION", "1.12"))
|
||||
|
||||
KARGO_REPO = os.environ.get('KARGO_REPO',
|
||||
"https://github.com/kubespray/kargo.git")
|
||||
KARGO_COMMIT = os.environ.get('KARGO_COMMIT', 'master')
|
||||
|
||||
HYPERKUBE_IMAGE_REPO = os.environ.get('HYPERKUBE_IMAGE_REPO',
|
||||
"quay.io/coreos/hyperkube")
|
||||
HYPERKUBE_IMAGE_TAG = os.environ.get('HYPERKUBE_IMAGE_TAG', "{}_coreos.0"
|
||||
|
@ -72,6 +68,20 @@ HYPERKUBE_IMAGE_TAG = os.environ.get('HYPERKUBE_IMAGE_TAG', "{}_coreos.0"
|
|||
ETCD_IMAGE_REPO = os.environ.get('ETCD_IMAGE_REPO', "quay.io/coreos/etcd")
|
||||
ETCD_IMAGE_TAG = os.environ.get("ETCD_IMAGE_TAG", 'v3.0.1')
|
||||
ETCD_DEPLOYMENT_TYPE = os.environ.get('ETCD_DEPLOYMENT_TYPE', "docker")
|
||||
# For dnsmasq purposes
|
||||
UPSTREAM_DNS = os.environ.get('UPSTREAM_DNS', '8.8.8.8').split(',')
|
||||
# For resolv.conf entries
|
||||
|
||||
SERVICE_PATH = os.environ.get('SERVICE_PATH')
|
||||
TEMPEST_SCRIPT_PATH = os.environ.get('TEMPEST_SCRIPT_PATH')
|
||||
SEARCH_DOMAINS = os.environ.get('SEARCH_DOMAINS',
|
||||
'ccp.svc.cluster.local').split(',')
|
||||
BUILDER_WORKERS = os.environ.get('BUILDER_WORKERS', 1)
|
||||
BUILD_IMAGES = get_var_as_bool('BUILD_IMAGES', True)
|
||||
REGISTRY = os.environ.get('REGISTRY', "127.0.0.1:31500")
|
||||
IMAGES_NAMESPACE = os.environ.get('IMAGES_NAMESPACE', 'mcp')
|
||||
IMAGES_TAG = os.environ.get('IMAGES_TAG', 'latest')
|
||||
|
||||
|
||||
DEFAULT_CUSTOM_YAML = {
|
||||
"kube_network_plugin": KUBE_NETWORK_PLUGIN,
|
||||
|
@ -86,6 +96,9 @@ DEFAULT_CUSTOM_YAML = {
|
|||
"hyperkube_image_repo": HYPERKUBE_IMAGE_REPO,
|
||||
"ipip": IPIP_USAGE,
|
||||
"kube_version": KUBE_VERSION,
|
||||
"use_hyperkube_cni": str("true"),
|
||||
"upstream_dns_servers": UPSTREAM_DNS,
|
||||
"searchdomains": SEARCH_DOMAINS,
|
||||
}
|
||||
|
||||
CALICO = {
|
||||
|
@ -103,17 +116,6 @@ for key, val in CALICO.items():
|
|||
if val:
|
||||
DEFAULT_CUSTOM_YAML[key] = val
|
||||
|
||||
BUILD_IMAGES = get_var_as_bool('BUILD_IMAGES', True)
|
||||
REGISTRY = os.environ.get('REGISTRY', "127.0.0.1:31500")
|
||||
IMAGES_NAMESPACE = os.environ.get('IMAGES_NAMESPACE', 'mcp')
|
||||
IMAGES_TAG = os.environ.get('IMAGES_TAG', 'latest')
|
||||
# For dnsmasq purposes
|
||||
UPSTREAM_DNS = os.environ.get('UPSTREAM_DNS', '8.8.8.8').split(',')
|
||||
SERVICE_PATH = os.environ.get('SERVICE_PATH')
|
||||
TEMPEST_SCRIPT_PATH = os.environ.get('TEMPEST_SCRIPT_PATH')
|
||||
SEARCH_DOMAINS = os.environ.get('SEARCH_DOMAINS',
|
||||
'ccp.svc.cluster.local').split(',')
|
||||
BUILDER_WORKERS = os.environ.get('BUILDER_WORKERS', 1)
|
||||
DEPLOY_CONFIG = '/tmp/ccp-globals.yaml'
|
||||
|
||||
FUEL_CCP_KEYSTONE_LOCAL_REPO = os.environ.get('FUEL_CCP_KEYSTONE_LOCAL_REPO',
|
||||
|
|
|
@ -0,0 +1,82 @@
|
|||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
import datetime
|
||||
import json
|
||||
import pytest
|
||||
|
||||
from fuel_ccp_tests.helpers import post_os_deploy_checks
|
||||
from fuel_ccp_tests.helpers import ext
|
||||
from fuel_ccp_tests import logger
|
||||
from fuel_ccp_tests import settings
|
||||
|
||||
LOG = logger.logger
|
||||
LOG.addHandler(logger.console)
|
||||
|
||||
|
||||
class TestPreCommitNeutron(object):
|
||||
"""docstring for TestPreCommitNeutron
|
||||
|
||||
Scenario:
|
||||
1. Install k8s
|
||||
2. Install fuel-ccp
|
||||
3. Fetch all repositories
|
||||
4. Fetch neutron from review
|
||||
5. Fetch containers from external registry
|
||||
6. Build neutron container
|
||||
7. Deploy Openstack
|
||||
8. Run tempest
|
||||
"""
|
||||
|
||||
@pytest.mark.test_neutron_on_commit
|
||||
@pytest.mark.revert_snapshot(ext.SNAPSHOT.ccp_deployed)
|
||||
def test_deploy_os_with_custom_neutron(
|
||||
self, ccpcluster, k8s_actions, rally, underlay, config):
|
||||
"""
|
||||
Scenario:
|
||||
1. Install k8s
|
||||
2. Install fuel-ccp
|
||||
3. Fetch repos
|
||||
4. Upload repo with changes
|
||||
5. Build components
|
||||
6. Deploy components
|
||||
7. Run tempest suite
|
||||
|
||||
"""
|
||||
remote = underlay.remote(host=config.k8s.kube_host)
|
||||
k8s_actions.create_registry()
|
||||
ccpcluster.fetch()
|
||||
ccpcluster.update_service('neutron')
|
||||
ccpcluster.build(suppress_output=False)
|
||||
ccpcluster.deploy()
|
||||
rally.prepare()
|
||||
rally.pull_image()
|
||||
rally.run()
|
||||
|
||||
post_os_deploy_checks.check_jobs_status(k8s_actions.api)
|
||||
post_os_deploy_checks.check_pods_status(k8s_actions.api)
|
||||
rally.run_tempest('--regex tempest.api.network')
|
||||
LOG.info('Storing tests results...')
|
||||
res_file_name = 'result.html'
|
||||
file_prefix = 'results_' + datetime.datetime.now().strftime(
|
||||
'%Y%m%d_%H%M%S') + '_'
|
||||
file_dst = '{0}/logs/{1}{2}'.format(
|
||||
settings.LOGS_DIR, file_prefix, res_file_name)
|
||||
remote.download(
|
||||
'/home/{0}/rally/{1}'.format(settings.SSH_LOGIN, res_file_name),
|
||||
file_dst)
|
||||
res = json.load(remote.open('/home/{}/rally/result.json'.format(
|
||||
settings.SSH_LOGIN)))
|
||||
|
||||
fail_msg = 'Tempest verification fails {}'.format(res)
|
||||
assert res['failures'] == 0, fail_msg
|
|
@ -94,4 +94,5 @@ class TestPreStackLight(object):
|
|||
|
||||
res = requests.get(url,
|
||||
auth=('admin', 'admin'))
|
||||
assert res.status_code, 200
|
||||
msg = 'Fail to auth in Grafana with {}'.format(res.status_code)
|
||||
assert res.status_code == 200, msg
|
||||
|
|
Loading…
Reference in New Issue