From 3d7a0c6f55d5d4db33ff5ecb25466423e5d36b2d Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Wed, 4 Nov 2015 04:58:22 +0000 Subject: Restrucutre gate scripts So we can respect DRY and share as much code as possible I have broken out the common code between the aio and multinode gate scripts. Additionally, this lays the ground work for removing our policy on root-everywhere by using sudo. Once we get the non-root stuff worked out we can gate as non-root user. Change-Id: I781c597ab10f2296b95f51ae27e0fa617ffe0a66 Partially-Implements: blueprint multinode-gate --- tests/deploy_aio.sh | 36 ++++++++++++++++++++++++++++++++++++ tests/deploy_kolla.sh | 45 --------------------------------------------- tests/setup_deploy.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 45 deletions(-) create mode 100755 tests/deploy_aio.sh delete mode 100755 tests/deploy_kolla.sh create mode 100755 tests/setup_deploy.sh (limited to 'tests') diff --git a/tests/deploy_aio.sh b/tests/deploy_aio.sh new file mode 100755 index 000000000..2d76aca8d --- /dev/null +++ b/tests/deploy_aio.sh @@ -0,0 +1,36 @@ +#!/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 +} + +# Populate globals.yml +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 diff --git a/tests/deploy_kolla.sh b/tests/deploy_kolla.sh deleted file mode 100755 index a5e5b2892..000000000 --- a/tests/deploy_kolla.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/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 diff --git a/tests/setup_deploy.sh b/tests/setup_deploy.sh new file mode 100755 index 000000000..366bbf5a8 --- /dev/null +++ b/tests/setup_deploy.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -o xtrace +set -o errexit + +export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" + +function create_keys { + # Setup ssh key as required + sudo -H ssh-keygen -f /root/.ssh/id_rsa -N "" + sudo -H cat /root/.ssh/id_rsa.pub | sudo -H tee /root/.ssh/authorized_keys +} + +function install_deps { + # Install Ansible and docker-py + sudo -H pip install "ansible<2" docker-py + pip freeze | egrep "docker|ansible" +} + +function copy_configs { + # Copy configs + sudo cp -a etc/kolla /etc/ +} + +create_keys +install_deps +copy_configs + +# Link the logs directory into root +mkdir -p logs +sudo ln -s $(pwd)/logs /root/logs -- cgit v1.2.3