diff options
-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 | 27 |
3 files changed, 28 insertions, 53 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 bb96c32..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. @@ -23,7 +23,7 @@ # as extended for testing of more Tacker-supported features as of OpenStack # Newton. # -# Pre-State: +# Prerequisites: # This test can be run in either an OPNFV environment, or a plain OpenStack # environment (e.g. Devstack). # For Devstack running in a VM on the host, you must first enable the host to @@ -35,8 +35,9 @@ # $ sudo route add -net 172.24.0.0/16 gw 192.168.122.112 # Sub your devstack Public network subnet for 172.24.0.0/16, and # your devstack VM IP address on the host for 192.168.122.112 -# For OPNFV-based tests, pre-requisites are +# For OPNFV-based tests, prerequisites are # 1) models-joid-001 | models-apex-001 (installation of OPNFV system) +# The test may work, but has not been tested for other OPNFV installers. # # Test Steps and Assertions: # 1) bash vHello_Tacker.sh setup <openrc> [branch] @@ -286,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}')" ]] @@ -339,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 |