aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEduardo Gonzalez <dabarren@gmail.com>2018-11-07 18:16:32 +0100
committerEduardo Gonzalez <dabarren@gmail.com>2018-12-21 11:43:22 +0100
commit535aba79a91f8c9351e6bbe799ed1829cb270866 (patch)
treeb3b3191166816c81e63e64991a87ad78bd30562a /tests
parente73fe77d7d1714d81f7dba97d1f357762f16f0dc (diff)
downloadkolla-ansible-535aba79a91f8c9351e6bbe799ed1829cb270866.tar.gz
kolla-ansible-535aba79a91f8c9351e6bbe799ed1829cb270866.zip
Add NFV orchestration services CI job
Change-Id: I33484d0961f1cd17ed05dd124eba68d99b4db83f
Diffstat (limited to 'tests')
-rwxr-xr-xtests/deploy.sh10
-rw-r--r--tests/run.yml8
-rw-r--r--tests/templates/globals-default.j29
-rwxr-xr-xtests/test-openstack.sh10
-rwxr-xr-xtests/test-scenario-nfv.sh78
5 files changed, 105 insertions, 10 deletions
diff --git a/tests/deploy.sh b/tests/deploy.sh
index c06ef4653..91e4a5f96 100755
--- a/tests/deploy.sh
+++ b/tests/deploy.sh
@@ -22,6 +22,16 @@ function deploy {
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv deploy > /tmp/logs/ansible/deploy
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv post-deploy > /tmp/logs/ansible/post-deploy
tools/kolla-ansible -i ${RAW_INVENTORY} -vvv check > /tmp/logs/ansible/check-deploy
+ . /etc/kolla/admin-openrc.sh
+ # Wait for service ready
+ sleep 15
+
+ if ! openstack image show cirros >/dev/null 2>&1; then
+ echo "Initialising OpenStack resources via init-runonce"
+ tools/init-runonce
+ else
+ echo "Not running init-runonce - resources exist"
+ fi
}
diff --git a/tests/run.yml b/tests/run.yml
index 04554b16e..18c7574e1 100644
--- a/tests/run.yml
+++ b/tests/run.yml
@@ -174,6 +174,14 @@
chdir: "{{ kolla_ansible_src_dir }}"
environment:
ACTION: "{{ scenario }}"
+ when: scenario not in ['scenario_nfv']
+
+ - name: Run test-scenario-nfv.sh script
+ shell:
+ cmd: tests/test-scenario-nfv.sh
+ executable: /bin/bash
+ chdir: "{{ kolla_ansible_src_dir }}"
+ when: scenario == "scenario_nfv"
- name: Run reconfigure.sh script
shell:
diff --git a/tests/templates/globals-default.j2 b/tests/templates/globals-default.j2
index bb4392c49..d041df23b 100644
--- a/tests/templates/globals-default.j2
+++ b/tests/templates/globals-default.j2
@@ -42,3 +42,12 @@ enable_kuryr: "yes"
enable_etcd: "yes"
docker_custom_option: " -H unix:///var/run/docker.sock -H tcp://{{ api_interface_address }}:2375 --cluster-store=etcd://{{ api_interface_address }}:2379 --cluster-advertise={{ api_interface_address }}:2375"
{% endif %}
+
+{% if scenario == "scenario_nfv" %}
+glance_api_hosts: ["{{ inventory_hostname }}"]
+enable_tacker: "yes"
+enable_neutron_sfc: "yes"
+enable_mistral: "yes"
+enable_redis: "yes"
+enable_barbican: "yes"
+{% endif %}
diff --git a/tests/test-openstack.sh b/tests/test-openstack.sh
index d7337822a..dbaddadad 100755
--- a/tests/test-openstack.sh
+++ b/tests/test-openstack.sh
@@ -8,21 +8,11 @@ export PYTHONUNBUFFERED=1
function test_openstack_logged {
- # Wait for service ready
- sleep 15
-
. /etc/kolla/admin-openrc.sh
openstack --debug compute service list
openstack --debug network agent list
- if ! openstack image show cirros >/dev/null 2>&1; then
- echo "Initialising OpenStack resources via init-runonce"
- tools/init-runonce
- else
- echo "Not running init-runonce - resources exist"
- fi
-
echo "TESTING: Server creation"
openstack server create --wait --image cirros --flavor m1.tiny --key-name mykey --network demo-net kolla_boot_test
openstack --debug server list
diff --git a/tests/test-scenario-nfv.sh b/tests/test-scenario-nfv.sh
new file mode 100755
index 000000000..5fe01340b
--- /dev/null
+++ b/tests/test-scenario-nfv.sh
@@ -0,0 +1,78 @@
+#!/bin/bash
+
+set -o xtrace
+set -o errexit
+
+# Enable unbuffered output for Ansible in Jenkins.
+export PYTHONUNBUFFERED=1
+
+
+function test_tacker {
+ echo "TESTING: Tacker VIM,VNFD and VNF creation"
+ sh contrib/demos/tacker/deploy-tacker-demo
+ openstack vim list
+ openstack vnf list
+ openstack vnf descriptor list
+
+ while [[ $(openstack vnf show kolla-sample-vnf -f value -c status) != "ACTIVE" ]]; do
+ echo "VNF not running yet"
+ attempt=$((attempt+1))
+ if [[ $attempt -eq 10 ]]; then
+ echo "VNF failed to start"
+ openstack vnf show kolla-sample-vnf
+ return 1
+ fi
+ sleep 10
+ done
+}
+
+function test_barbican {
+ echo "TESTING: Barbican"
+ openstack secret list
+}
+
+function test_mistral {
+ echo "TESTING: Mistral"
+ openstack workflow list
+ openstack workflow execution list
+ openstack action execution list
+}
+
+function test_nova {
+ echo "TESTING: Nova"
+ openstack server list
+}
+
+function test_heat {
+ echo "TESTING: Heat"
+ openstack stack list
+}
+
+function install_requirements {
+ echo "TESTING: Install requirements"
+ sudo -H pip install --ignore-installed -U "python-tackerclient" "python-heatclient" "networking-sfc" "python-mistralclient" "python-barbicanclient"
+}
+
+function test_scenario_nfv_logged {
+ . /etc/kolla/admin-openrc.sh
+ install_requirements
+ test_tacker
+ test_barbican
+ test_mistral
+ test_nova
+ test_heat
+}
+
+function test_scenario_nfv {
+ echo "Testing Scenario NFV"
+ test_scenario_nfv_logged > /tmp/logs/ansible/test-scenario-nfv 2>&1
+ result=$?
+ if [[ $result != 0 ]]; then
+ echo "Testing Scenario NFV failed. See ansible/test-scenario-nfv for details"
+ else
+ echo "Successfully Scenario NFV. See ansible/test-scenario-nfv for details"
+ fi
+ return $result
+}
+
+test_scenario_nfv