From c4a8915f75a026b224edc34ed6d1095e69a28388 Mon Sep 17 00:00:00 2001 From: bryan Date: Wed, 8 Feb 2017 17:25:21 -0800 Subject: 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 --- .../tosca-vnfd-hello-world-tacker/start.sh | 40 ---------------------- tests/utils/tacker-setup.sh | 14 +++++++- tests/vHello_Tacker.sh | 22 ++++++------ 3 files changed, 25 insertions(+), 51 deletions(-) delete mode 100755 tests/blueprints/tosca-vnfd-hello-world-tacker/start.sh 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 - - - -Hello World! - - - - -Hello World!
- - -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] [] [branch]" + echo " setup: setup test environment" + echo " : 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 -- cgit 1.2.3-korg