Merge "In gate functional testing"
This commit is contained in:
commit
a466bcb939
@ -52,6 +52,7 @@ infra = ceph,data,mariadb,haproxy,keepalived,kolla-ansible,memcached,mongodb,ope
|
|||||||
main = cinder,ceilometer,glance,heat,horizon,keystone,neutron,nova,swift
|
main = cinder,ceilometer,glance,heat,horizon,keystone,neutron,nova,swift
|
||||||
aux = designate,gnocchi,ironic,magnum,zaqar
|
aux = designate,gnocchi,ironic,magnum,zaqar
|
||||||
default = data,kolla-ansible,glance,haproxy,heat,horizon,keystone,memcached,mariadb,neutron,nova,rabbitmq
|
default = data,kolla-ansible,glance,haproxy,heat,horizon,keystone,memcached,mariadb,neutron,nova,rabbitmq
|
||||||
|
gate = ceph,cinder,data,glance,haproxy,heat,horizon,keepalived,keystone,kolla-ansible,memcached,neutron,nova,openvswitch,rabbitmq
|
||||||
|
|
||||||
# Provide location of sources for source install builds.
|
# Provide location of sources for source install builds.
|
||||||
# Example:
|
# Example:
|
||||||
|
45
tests/deploy_kolla.sh
Executable file
45
tests/deploy_kolla.sh
Executable file
@ -0,0 +1,45 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -o xtrace
|
||||||
|
set -o errexit
|
||||||
|
|
||||||
|
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
|
||||||
|
function print_failure {
|
||||||
|
docker ps -a
|
||||||
|
docker logs bootstrap_keystone
|
||||||
|
echo "FAILED"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Setup ssh key as required
|
||||||
|
ssh-keygen -f kolla-ssh -N ""
|
||||||
|
cat kolla-ssh.pub | tee /root/.ssh/authorized_keys
|
||||||
|
|
||||||
|
# Install Ansible and docker-py
|
||||||
|
pip install "ansible<2" docker-py
|
||||||
|
pip freeze | egrep "docker|ansible"
|
||||||
|
|
||||||
|
# Setup configs
|
||||||
|
cp -a etc/kolla /etc/
|
||||||
|
cat << EOF > /etc/kolla/globals.yml
|
||||||
|
---
|
||||||
|
kolla_base_distro: "$1"
|
||||||
|
kolla_install_type: "$2"
|
||||||
|
kolla_internal_address: "169.254.169.10"
|
||||||
|
docker_pull_policy: "missing"
|
||||||
|
docker_restart_policy: "no"
|
||||||
|
network_interface: "eth0"
|
||||||
|
neutron_external_interface: "fake_interface"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Create dummy interface for neutron
|
||||||
|
ip l a fake_interface type dummy
|
||||||
|
|
||||||
|
# Actually do the deployment
|
||||||
|
tools/kolla-ansible deploy || print_failure
|
||||||
|
|
||||||
|
# TODO(SamYaple): Actually validate that all containers are started
|
||||||
|
docker ps -a
|
||||||
|
|
||||||
|
# TODO(SamYaple): Actually do functional testing of OpenStack
|
@ -59,8 +59,7 @@ class BuildTest(base.BaseTestCase):
|
|||||||
LOG.critical(">>> Expected image '%s' to succeed!" % image)
|
LOG.critical(">>> Expected image '%s' to succeed!" % image)
|
||||||
|
|
||||||
for image in unmatched_results.keys():
|
for image in unmatched_results.keys():
|
||||||
failures = failures + 1
|
LOG.warning(">>> Image '%s' was not matched" % image)
|
||||||
LOG.critical(">>> Expected image '%s' to be matched!" % image)
|
|
||||||
|
|
||||||
self.assertEqual(failures, 0, "%d failure(s) occurred" % failures)
|
self.assertEqual(failures, 0, "%d failure(s) occurred" % failures)
|
||||||
|
|
||||||
@ -84,3 +83,27 @@ class BuildTestUbuntuSource(BuildTest):
|
|||||||
super(BuildTestUbuntuSource, self).setUp()
|
super(BuildTestUbuntuSource, self).setUp()
|
||||||
self.build_args.extend(["--base", "ubuntu",
|
self.build_args.extend(["--base", "ubuntu",
|
||||||
"--type", "source"])
|
"--type", "source"])
|
||||||
|
|
||||||
|
|
||||||
|
class DeployTestCentosBinary(BuildTest):
|
||||||
|
def setUp(self):
|
||||||
|
super(BuildTestCentosBinary, self).setUp()
|
||||||
|
self.build_args.extend(["--base", "centos",
|
||||||
|
"--type", "binary",
|
||||||
|
"--profile", "gate"])
|
||||||
|
|
||||||
|
|
||||||
|
class DeployTestCentosSource(BuildTest):
|
||||||
|
def setUp(self):
|
||||||
|
super(BuildTestCentosSource, self).setUp()
|
||||||
|
self.build_args.extend(["--base", "centos",
|
||||||
|
"--type", "source",
|
||||||
|
"--profile", "gate"])
|
||||||
|
|
||||||
|
|
||||||
|
class DeployTestUbuntuSource(BuildTest):
|
||||||
|
def setUp(self):
|
||||||
|
super(BuildTestUbuntuSource, self).setUp()
|
||||||
|
self.build_args.extend(["--base", "ubuntu",
|
||||||
|
"--type", "source",
|
||||||
|
"--profile", "gate"])
|
||||||
|
62
tox.ini
62
tox.ini
@ -35,6 +35,9 @@ commands =
|
|||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
commands = bash -c tests/setup_gate.sh
|
commands = bash -c tests/setup_gate.sh
|
||||||
|
|
||||||
|
# These tests are duplicated because of the namechange of the jobs upstream
|
||||||
|
# to allow continued use of the job-template. This way the gate never breaks
|
||||||
|
# TODO(SamYaple): Remove once new gates are in place
|
||||||
[testenv:images-centos-binary]
|
[testenv:images-centos-binary]
|
||||||
whitelist_externals = find
|
whitelist_externals = find
|
||||||
bash
|
bash
|
||||||
@ -44,6 +47,7 @@ commands =
|
|||||||
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
sudo -g docker testr run test_build.BuildTestCentosBinary
|
sudo -g docker testr run test_build.BuildTestCentosBinary
|
||||||
|
|
||||||
|
# TODO(SamYaple): Remove once new gates are in place
|
||||||
[testenv:images-centos-source]
|
[testenv:images-centos-source]
|
||||||
whitelist_externals = find
|
whitelist_externals = find
|
||||||
bash
|
bash
|
||||||
@ -53,6 +57,7 @@ commands =
|
|||||||
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
sudo -g docker testr run test_build.BuildTestCentosSource
|
sudo -g docker testr run test_build.BuildTestCentosSource
|
||||||
|
|
||||||
|
# TODO(SamYaple): Remove once new gates are in place
|
||||||
[testenv:images-ubuntu-source]
|
[testenv:images-ubuntu-source]
|
||||||
whitelist_externals = find
|
whitelist_externals = find
|
||||||
bash
|
bash
|
||||||
@ -62,6 +67,63 @@ commands =
|
|||||||
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
sudo -g docker testr run test_build.BuildTestUbuntuSource
|
sudo -g docker testr run test_build.BuildTestUbuntuSource
|
||||||
|
|
||||||
|
[testenv:build-images-centos-binary]
|
||||||
|
whitelist_externals = find
|
||||||
|
bash
|
||||||
|
sudo
|
||||||
|
commands =
|
||||||
|
find . -type f -name "*.pyc" -delete
|
||||||
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
|
sudo -g docker testr run test_build.BuildTestCentosBinary
|
||||||
|
|
||||||
|
[testenv:build-images-centos-source]
|
||||||
|
whitelist_externals = find
|
||||||
|
bash
|
||||||
|
sudo
|
||||||
|
commands =
|
||||||
|
find . -type f -name "*.pyc" -delete
|
||||||
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
|
sudo -g docker testr run test_build.BuildTestCentosSource
|
||||||
|
|
||||||
|
[testenv:build-images-ubuntu-source]
|
||||||
|
whitelist_externals = find
|
||||||
|
bash
|
||||||
|
sudo
|
||||||
|
commands =
|
||||||
|
find . -type f -name "*.pyc" -delete
|
||||||
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
|
sudo -g docker testr run test_build.BuildTestUbuntuSource
|
||||||
|
|
||||||
|
[testenv:deploy-images-centos-binary]
|
||||||
|
whitelist_externals = find
|
||||||
|
bash
|
||||||
|
sudo
|
||||||
|
commands =
|
||||||
|
find . -type f -name "*.pyc" -delete
|
||||||
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
|
sudo -g docker testr run test_build.DeployTestCentosBinary
|
||||||
|
sudo tests/deploy_kolla.sh centos binary
|
||||||
|
|
||||||
|
[testenv:deploy-images-centos-source]
|
||||||
|
whitelist_externals = find
|
||||||
|
bash
|
||||||
|
sudo
|
||||||
|
commands =
|
||||||
|
find . -type f -name "*.pyc" -delete
|
||||||
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
|
sudo -g docker testr run test_build.DeployTestCentosSource
|
||||||
|
sudo tests/deploy_kolla.sh centos source
|
||||||
|
|
||||||
|
[testenv:deploy-images-ubuntu-source]
|
||||||
|
whitelist_externals = find
|
||||||
|
bash
|
||||||
|
sudo
|
||||||
|
commands =
|
||||||
|
find . -type f -name "*.pyc" -delete
|
||||||
|
bash -c "if [ ! -d .testrepository ]; then testr init; fi"
|
||||||
|
sudo -g docker testr run test_build.DeployTestUbuntuSource
|
||||||
|
sudo tests/deploy_kolla.sh ubuntu source
|
||||||
|
|
||||||
[testenv:functional]
|
[testenv:functional]
|
||||||
whitelist_externals = find
|
whitelist_externals = find
|
||||||
bash
|
bash
|
||||||
|
Loading…
Reference in New Issue
Block a user