summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bootstrap/vagrant-onap/README.md2
-rw-r--r--bootstrap/vagrant-onap/Vagrantfile1
-rwxr-xr-xbootstrap/vagrant-onap/lib/_onap_functions5
-rwxr-xr-xbootstrap/vagrant-onap/lib/dcae2
-rwxr-xr-xbootstrap/vagrant-onap/lib/functions20
-rw-r--r--bootstrap/vagrant-onap/tests/_test_base3
-rw-r--r--bootstrap/vagrant-onap/tests/test_aai5
-rw-r--r--bootstrap/vagrant-onap/tests/test_functions30
-rw-r--r--test/csit/plans/modeling/javatoscachecker/APIs/setup.sh22
-rw-r--r--test/csit/plans/modeling/javatoscachecker/APIs/teardown.sh21
-rw-r--r--test/csit/scripts/modeling/javatoscachecker/setup_containers.sh49
-rw-r--r--test/csit/scripts/modeling/javatoscachecker/teardown_containers.sh27
-rw-r--r--test/csit/tests/modeling/javatoscachecker/APIs/__init__.robot2
13 files changed, 157 insertions, 32 deletions
diff --git a/bootstrap/vagrant-onap/README.md b/bootstrap/vagrant-onap/README.md
index c48190ad1..e90e0a724 100644
--- a/bootstrap/vagrant-onap/README.md
+++ b/bootstrap/vagrant-onap/README.md
@@ -1,7 +1,5 @@
# ONAP on Vagrant
-[![Build Status](https://api.travis-ci.org/electrocucaracha/vagrant-onap.svg?branch=master)](https://api.travis-ci.org/electrocucaracha/vagrant-onap)
-
This vagrant project pretends to collect information about a way to deploy
and build [ONAP project](https://www.onap.org/) into a development environment.
diff --git a/bootstrap/vagrant-onap/Vagrantfile b/bootstrap/vagrant-onap/Vagrantfile
index c10cb0bc8..dc8b34768 100644
--- a/bootstrap/vagrant-onap/Vagrantfile
+++ b/bootstrap/vagrant-onap/Vagrantfile
@@ -290,6 +290,7 @@ Vagrant.configure("2") do |config|
config.proxy.http = ENV['http_proxy']
config.proxy.https = ENV['https_proxy']
config.proxy.no_proxy = ENV['no_proxy']
+ configuration['socks_proxy'] = ENV['socks_proxy']
end
if Vagrant.has_plugin?('vagrant-vbguest')
diff --git a/bootstrap/vagrant-onap/lib/_onap_functions b/bootstrap/vagrant-onap/lib/_onap_functions
index 18a465948..cedd6f0a3 100755
--- a/bootstrap/vagrant-onap/lib/_onap_functions
+++ b/bootstrap/vagrant-onap/lib/_onap_functions
@@ -12,7 +12,6 @@ function create_configuration_files {
echo $docker_version > /opt/config/docker_version.txt
}
-# TODO(electrocucaracha): Determine how to use this behind a proxy
# docker_openecomp_login() - Login to OpenECOMP Docker Hub
function docker_openecomp_login {
install_docker
@@ -24,7 +23,7 @@ function pull_openecomp_image {
local image=$1
local tag=$2
docker_openecomp_login
- pull_docker_image $nexus_docker_repo/openecomp/${image}:$docker_version $tag
+ pull_docker_image $nexus_docker_repo/openecomp/${image}:${docker_version-latest} $tag
docker logout
}
@@ -33,7 +32,7 @@ function pull_onap_image {
local image=$1
local tag=$2
docker_openecomp_login
- pull_docker_image $nexus_docker_repo/onap/${image}:$docker_version $tag
+ pull_docker_image $nexus_docker_repo/onap/${image}:${docker_version-latest} $tag
docker logout
}
diff --git a/bootstrap/vagrant-onap/lib/dcae b/bootstrap/vagrant-onap/lib/dcae
index 3e702d989..4995c618d 100755
--- a/bootstrap/vagrant-onap/lib/dcae
+++ b/bootstrap/vagrant-onap/lib/dcae
@@ -44,7 +44,7 @@ function _build_docker_image {
install_docker
pushd $src_folder
- # TODO(electrocucaracha) Workaround for dmmapbc images
+ # NOTE: Workaround for dmmapbc images
sed -i '/LocalKey/d' Dockerfile
local docker_build="docker build -t $name -f ./Dockerfile ."
if [ $http_proxy ]; then
diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions
index 8fff0c2c4..02111fa2c 100755
--- a/bootstrap/vagrant-onap/lib/functions
+++ b/bootstrap/vagrant-onap/lib/functions
@@ -100,23 +100,31 @@ function install_maven {
# _configure_docker_settings() - Configures Docker settings
function _configure_docker_settings {
+ local docker_conf_backup=/tmp/docker.backup
+ local docker_conf=/etc/default/docker
+ local chameleonsocks_filename=chameleonsocks.sh
+
+ cp $docker_conf $docker_conf_backup
if [ $http_proxy ]; then
- echo "export http_proxy=$http_proxy" >> /etc/default/docker
+ echo "export http_proxy=$http_proxy" >> $docker_conf
fi
if [ $https_proxy ]; then
- echo "export https_proxy=$https_proxy" >> /etc/default/docker
+ echo "export https_proxy=$https_proxy" >> $docker_conf
#If you have a socks proxy, then use that to connect to the nexus repo
#via a redsocks container
if [ $socks_proxy ]; then
- wget https://raw.githubusercontent.com/crops/chameleonsocks/master/chameleonsocks.sh
- chmod 755 chameleonsocks.sh
+ wget https://raw.githubusercontent.com/crops/chameleonsocks/master/$chameleonsocks_filename
+ chmod 755 $chameleonsocks_filename
socks=$(echo $socks_proxy | sed -e "s/^.*\///" | sed -e "s/:.*$//")
port=$(echo $socks_proxy | sed -e "s/^.*://")
- PROXY=$socks PORT=$port ./chameleonsocks.sh --install
+ PROXY=$socks PORT=$port ./$chameleonsocks_filename --install
+ rm $chameleonsocks_filename
+ cp $docker_conf_backup $docker_conf
fi
fi
+ rm $docker_conf_backup
- echo "DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\"" >> /etc/default/docker
+ echo "DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\"" >> $docker_conf
usermod -a -G docker vagrant
}
diff --git a/bootstrap/vagrant-onap/tests/_test_base b/bootstrap/vagrant-onap/tests/_test_base
index 155de98bb..7d0415a44 100644
--- a/bootstrap/vagrant-onap/tests/_test_base
+++ b/bootstrap/vagrant-onap/tests/_test_base
@@ -15,6 +15,9 @@ function main {
echo "ok $((i+1)) - test_${covered_functions[$i]}"
# Teardown process
+ if ! is_package_installed docker-ce; then
+ docker images -q | xargs docker rmi -f
+ fi
dpkg --get-selections > installed-software_new
sort -o installed-software_new installed-software_new
apt-get purge -y -qq $(comm -3 installed-software installed-software_new | awk '{print $1}')
diff --git a/bootstrap/vagrant-onap/tests/test_aai b/bootstrap/vagrant-onap/tests/test_aai
index 79d26c83d..10777d678 100644
--- a/bootstrap/vagrant-onap/tests/test_aai
+++ b/bootstrap/vagrant-onap/tests/test_aai
@@ -8,11 +8,6 @@ covered_functions=(
"install_hadoop" "install_haproxy" "clone_all_aai_repos" "compile_aai_repos" "setup_titan" "install_hbase" "install_ajsc_aai" "install_model_loader"
)
-# TODO(electrocucaracha): Remove/Modify functions that doesn't support proxy settings
-if [ -z $http_proxy ] & [ -z $https_proxy ]; then
- covered_functions=(${covered_functions[@]} "install_hbase")
-fi
-
# test_install_hadoop() - Verify that Hadoop is downloaded and started properly
function test_install_hadoop {
install_hadoop
diff --git a/bootstrap/vagrant-onap/tests/test_functions b/bootstrap/vagrant-onap/tests/test_functions
index 17a66313a..ee7358a84 100644
--- a/bootstrap/vagrant-onap/tests/test_functions
+++ b/bootstrap/vagrant-onap/tests/test_functions
@@ -7,14 +7,10 @@ covered_functions=(
"create_configuration_files" "clone_repo" "install_dev_tools"
"configure_bind" "install_java" "install_maven" "install_nodejs" "install_python"
"install_docker" "pull_docker_image" "install_docker_compose" "configure_service"
-"start_ODL" "compile_src" "build_docker_image"
+"start_ODL" "compile_src" "build_docker_image" "docker_openecomp_login"
+"pull_openecomp_image" "pull_onap_image"
)
-# TODO(electrocucaracha): Remove/Modify functions that doesn't support proxy settings
-if [ -z $http_proxy ] & [ -z $https_proxy ]; then
- covered_functions=(${covered_functions[@]} "docker_openecomp_login" "pull_openecomp_image")
-fi
-
# test_create_configuration_files() - Verify the creation of a configuration files
function test_create_configuration_files {
create_configuration_files
@@ -33,14 +29,22 @@ function test_docker_openecomp_login {
docker_openecomp_login
}
-# test_pull_openecomp_image() - Verify the addition of a OpenECOMP container image
+# test_pull_openecomp_image() - Verify the OpenECOMP container image pulling process
function test_pull_openecomp_image {
- pull_openecomp_image portalapps ep:1610-1
+ local image_name=portal-apps
+ unset docker_version
+ pull_openecomp_image $image_name
- asserts_installed_package docker-ce
- asserts_image ep:1610-1
+ asserts_image $nexus_docker_repo/openecomp/$image_name
+}
- docker rmi -f ep:1610-1
+# test_pull_onap_image() - Verify the ONAP cointainer pulling process
+function test_pull_onap_image {
+ local image_name=portal-apps
+ unset docker_version
+ pull_onap_image $image_name
+
+ asserts_image $nexus_docker_repo/onap/$image_name
}
# test_clone_repo() - Verify cloning and pulling source code from repositories
@@ -117,8 +121,6 @@ function test_pull_docker_image {
pull_docker_image $image
asserts_image $image
-
- docker rmi -f $image
}
# test_install_docker_compose() - Verify the correct installation of Docker Compose tool
@@ -161,8 +163,6 @@ function test_build_docker_image {
build_docker_image $git_src_folder/ccsdk/distribution/ubuntu docker
asserts_image onap/ccsdk-ubuntu-image
-
- docker rmi -f onap/ccsdk-ubuntu-image
}
if [ "$1" != '*' ]; then
diff --git a/test/csit/plans/modeling/javatoscachecker/APIs/setup.sh b/test/csit/plans/modeling/javatoscachecker/APIs/setup.sh
new file mode 100644
index 000000000..19fc5ed79
--- /dev/null
+++ b/test/csit/plans/modeling/javatoscachecker/APIs/setup.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Copyright 2017 AT&T
+#
+# 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.
+#
+# Modifications copyright (c) 2017 AT&T Intellectual Property
+#
+# Place the scripts in run order:
+
+source ${WORKSPACE}/test/csit/scripts/modeling/javatoscachecker/setup_containers.sh
+
diff --git a/test/csit/plans/modeling/javatoscachecker/APIs/teardown.sh b/test/csit/plans/modeling/javatoscachecker/APIs/teardown.sh
new file mode 100644
index 000000000..0e149c028
--- /dev/null
+++ b/test/csit/plans/modeling/javatoscachecker/APIs/teardown.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+#
+# Copyright 2016-2017 Huawei Technologies Co., Ltd.
+#
+# 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.
+#
+# Modifications copyright (c) 2017 AT&T Intellectual Property
+#
+
+source ${WORKSPACE}/test/csit/scripts/modeling/javatoscachecker/teardown_containers.sh
+
diff --git a/test/csit/scripts/modeling/javatoscachecker/setup_containers.sh b/test/csit/scripts/modeling/javatoscachecker/setup_containers.sh
new file mode 100644
index 000000000..0b22f6197
--- /dev/null
+++ b/test/csit/scripts/modeling/javatoscachecker/setup_containers.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+#
+# ============LICENSE_START=======================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights
+# reserved.
+# ================================================================================
+# 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.
+# ============LICENSE_END============================================
+# ===================================================================
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+#
+
+echo "This is ${WORKSPACE}/test/csit/modeling/javatoscachecker/setup_containers.sh"
+
+#start docker image
+run-instance.sh nexus3.onap.org:10001/onap/modeling/javatoscachecker:latest modeling_javatoscachecker_1 "-p 8080:8080"
+
+#checker docker image is accesible: picked from clamp, some common script would be good
+TIME_OUT=1200
+INTERVAL=5
+TIME=0
+while [ "$TIME" -lt "$TIME_OUT" ]; do
+ response=$(curl --write-out '%{http_code}' --silent --output /dev/null http://localhost:8080/check_template/test_me); echo $response
+
+ if [ "$response" == "404" ]; then
+ echo javatoscachecker service started in $TIME seconds
+ break;
+ fi
+
+ echo Sleep: $INTERVAL seconds before testing if javatoscachecker service is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds
+ sleep $INTERVAL
+ TIME=$(($TIME+$INTERVAL))
+done
+
+if [ "$TIME" -ge "$TIME_OUT" ]; then
+ echo TIME OUT: Docker containers not started in $TIME_OUT seconds... Could cause problems for tests...
+fi
+
+
diff --git a/test/csit/scripts/modeling/javatoscachecker/teardown_containers.sh b/test/csit/scripts/modeling/javatoscachecker/teardown_containers.sh
new file mode 100644
index 000000000..c3292fb30
--- /dev/null
+++ b/test/csit/scripts/modeling/javatoscachecker/teardown_containers.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# ============LICENSE_START=======================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights
+# reserved.
+# ================================================================================
+# 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.
+# ============LICENSE_END============================================
+# ===================================================================
+# ECOMP is a trademark and service mark of AT&T Intellectual Property.
+#
+
+echo "This is ${WORKSPACE}/test/csit/modeling/javatoscachecker/teardown_containers.sh"
+
+kill-instance.sh modeling_javatoscachecker_1
+
+
diff --git a/test/csit/tests/modeling/javatoscachecker/APIs/__init__.robot b/test/csit/tests/modeling/javatoscachecker/APIs/__init__.robot
new file mode 100644
index 000000000..8064d6b0c
--- /dev/null
+++ b/test/csit/tests/modeling/javatoscachecker/APIs/__init__.robot
@@ -0,0 +1,2 @@
+*** Settings ***
+Documentation javatoscachecker - APIs