diff options
author | 2017-02-08 17:25:21 -0800 | |
---|---|---|
committer | 2017-02-08 17:25:21 -0800 | |
commit | c4a8915f75a026b224edc34ed6d1095e69a28388 (patch) | |
tree | d85068284dad58b088f4ca1771d8cf47a3f30427 /tests | |
parent | 5868265049d434c2d642e41ab2730683cc765eb9 (diff) |
Update vHello_Tacker test
JIRA: MODELS-23
Update comments and usage.
Remove redundant openstack image delete.
Add tacker vim-register --is-default flag.
Add docker install for ubuntu as needed.
Delete start.sh (moved into blueprint user data).
Change-Id: I1e4890a8902d164605b82221c54f7b81bdb57c93
Signed-off-by: bryan <bryan.sullivan@att.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/blueprints/tosca-vnfd-hello-world-tacker/start.sh | 40 | ||||
-rw-r--r-- | tests/utils/tacker-setup.sh | 14 | ||||
-rw-r--r-- | tests/vHello_Tacker.sh | 22 |
3 files changed, 25 insertions, 51 deletions
diff --git a/tests/blueprints/tosca-vnfd-hello-world-tacker/start.sh b/tests/blueprints/tosca-vnfd-hello-world-tacker/start.sh deleted file mode 100755 index 5285e69..0000000 --- a/tests/blueprints/tosca-vnfd-hello-world-tacker/start.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# Copyright 2016 AT&T Intellectual Property, 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. -# -# What this is: Startup script for a simple web server as part of the -# vHello test of the OPNFV Models project. -# -# Status: this is a work in progress, under test. -# -# How to use: -# $ bash start.sh - -cat << EOM | sudo tee /home/ubuntu/index.html -<!DOCTYPE html> -<html> -<head> -<title>Hello World!</title> -<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1"/> -<style> -body { width: 100%; background-color: white; color: black; padding: 0px; margin: 0px; font-family: sans-serif; font-size:100%; } -</style> -</head> -<body> -Hello World!<br> -<a href="http://wiki.opnfv.org"><img src="https://www.opnfv.org/sites/all/themes/opnfv/logo.png"></a> -</body></html> -EOM - -nohup sudo python3 -m http.server 80 > /dev/null 2>&1 & diff --git a/tests/utils/tacker-setup.sh b/tests/utils/tacker-setup.sh index 48d8f10..1d48aab 100644 --- a/tests/utils/tacker-setup.sh +++ b/tests/utils/tacker-setup.sh @@ -78,6 +78,18 @@ function create_container () { echo "$0: $(date) Setup container" if [ "$dist" == "Ubuntu" ]; then echo "$0: $(date) Ubuntu-based install" + dpkg -l docker-engine + if [[ $? -eq 1 ]]; then + sudo apt-get install -y apt-transport-https ca-certificates + sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D + echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list + sudo apt-get update + sudo apt-get purge lxc-docker + sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + sudo apt-get install -y docker-engine + sudo service docker start + fi + # xenial is needed for python 3.5 sudo docker pull ubuntu:xenial sudo service docker start @@ -345,7 +357,7 @@ user_id: $(openstack user list | awk "/ admin / { print \$2 }") EOF # newton: NAME (was "--name") is now a positional parameter - tacker vim-register --config-file vim-config.yaml --description OpenStack VIM0 + tacker vim-register --is-default --config-file vim-config.yaml --description OpenStack VIM0 if [ $? -eq 1 ]; then fail; fi setup_test_environment diff --git a/tests/vHello_Tacker.sh b/tests/vHello_Tacker.sh index a459556..cf7dbae 100644 --- a/tests/vHello_Tacker.sh +++ b/tests/vHello_Tacker.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 2016 AT&T Intellectual Property, Inc +# Copyright 2016-2017 AT&T Intellectual Property, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ # # What this is: Deployment test for the Tacker Hello World blueprint. # -# Status: work in progress, planned for OPNFV Danube release. +# Status: this is a work in progress, under test. # # Use Case Description: A single-node simple python web server, connected to # two internal networks (private and admin), and accessible via a floating IP. @@ -287,8 +287,6 @@ stop() { vid=($(tacker vnfd-list|grep hello-world-tacker|awk '{print $2}')); for id in ${vid[@]}; do try 10 10 "tacker vnfd-delete ${id}"; done assert "models-tacker-005 (VNFD deletion)" [[ -z "$(tacker vnfd-list|grep hello-world-tacker|awk '{print $2}')" ]] - for id in ${sg[@]}; do try 5 5 "openstack security group delete ${id}"; done - iid=($(openstack image list|grep VNFImage|awk '{print $2}')); for id in ${iid[@]}; do openstack image delete ${id}; done assert "models-tacker-vnfd-004 (artifacts deletion)" [[ -z "$(openstack image list|grep VNFImage|awk '{print $2}')" ]] @@ -340,11 +338,15 @@ case "$1" in pass ;; *) - echo "usage: bash vHello_Tacker.sh [setup|start|run|stop|clean]" - echo "setup: setup test environment" - echo "start: install blueprint and run test" - echo "run: setup test environment and run test" - echo "stop: stop test and uninstall blueprint" - echo "clean: cleanup after test" + echo "usage: " + echo "$ bash vHello_Tacker.sh [setup|run] [<openrc>] [branch]" + echo " setup: setup test environment" + echo " <openrc>: location of OpenStack openrc file" + echo " branch: OpenStack branch to install (default: master)" + echo "$ bash vHello_Tacker.sh [start|stop|clean]" + echo " run: setup test environment and run test" + echo " start: install blueprint and run test" + echo " stop: stop test and uninstall blueprint" + echo " clean: cleanup after test" fail esac |