Merge "Add more UIs functional tests with Selenium"
authorChristophe Closset <cc697w@intl.att.com>
Mon, 4 Sep 2017 12:25:22 +0000 (12:25 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 4 Sep 2017 12:25:22 +0000 (12:25 +0000)
40 files changed:
.gitignore
bootstrap/vagrant-onap/README.md
bootstrap/vagrant-onap/Vagrantfile
bootstrap/vagrant-onap/lib/multicloud [new file with mode: 0755]
bootstrap/vagrant-onap/lib/sdc
bootstrap/vagrant-onap/tests/test_multicloud [new file with mode: 0644]
bootstrap/vagrant-onap/tools/Run.ps1
bootstrap/vagrant-onap/tools/run.sh
pom.xml [new file with mode: 0644]
test/csit/plans/holmes/sanity-check/setup.sh [new file with mode: 0644]
test/csit/plans/holmes/sanity-check/teardown.sh [new file with mode: 0644]
test/csit/plans/holmes/sanity-check/testplan.txt [new file with mode: 0644]
test/csit/plans/msb/sanity-check/setup.sh [new file with mode: 0644]
test/csit/plans/msb/sanity-check/teardown.sh [new file with mode: 0644]
test/csit/plans/msb/sanity-check/testplan.txt [new file with mode: 0644]
test/csit/plans/vfc/nfvo-lcm/setup.sh [new file with mode: 0755]
test/csit/plans/vfc/nfvo-lcm/teardown.sh [new file with mode: 0755]
test/csit/plans/vfc/nfvo-lcm/testplan.txt [new file with mode: 0644]
test/csit/plans/vnfsdk-refrepo/sanity-check/setup.sh
test/csit/plans/vnfsdk-refrepo/sanity-check/teardown.sh
test/csit/scripts/holmes/engine-management/startup.sh [new file with mode: 0644]
test/csit/scripts/holmes/rule-management/startup.sh [new file with mode: 0644]
test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot [new file with mode: 0644]
test/csit/tests/holmes/testcase/EngineMgt/Engine-Keywords.robot [new file with mode: 0644]
test/csit/tests/holmes/testcase/EngineMgt/Engine-Mgt.robot [new file with mode: 0644]
test/csit/tests/holmes/testcase/EngineMgt/EngineAddr.robot [new file with mode: 0644]
test/csit/tests/holmes/testcase/EngineMgt/__init__.txt [new file with mode: 0644]
test/csit/tests/holmes/testcase/RuleMgt/Rule-Keywords.robot [new file with mode: 0644]
test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot [new file with mode: 0644]
test/csit/tests/holmes/testcase/RuleMgt/RuleAddr.robot [new file with mode: 0644]
test/csit/tests/holmes/testcase/RuleMgt/__init__.txt [new file with mode: 0644]
test/csit/tests/msb/startup/__init__.robot [new file with mode: 0644]
test/csit/tests/msb/startup/test1.robot [new file with mode: 0644]
test/csit/tests/vfc/nfvo-lcm/test.robot [new file with mode: 0644]
test/csit/tests/vnfsdk-marketplace/provision/sanity_test_vnfsdktestfunction.robot
version-manifest/pom.xml [new file with mode: 0644]
version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java [new file with mode: 0644]
version-manifest/src/main/resources/docker-manifest.csv [moved from versions/docker-manifest.csv with 100% similarity]
version-manifest/src/main/resources/java-manifest.csv [moved from versions/java-manifest.csv with 100% similarity]
version.properties [new file with mode: 0644]

index 75d4125..f3b07b8 100644 (file)
@@ -17,3 +17,4 @@ env.properties
 *.log
 .vagrant
 *~
+.checkstyle
index 9e7054c..08c5a57 100644 (file)
@@ -54,7 +54,8 @@ current options include:
 | sdc        | Service Design & Creation           |
 | sdnc       | Software Defined Network Controller |
 | vid        | Virtual Infrastructure Development  |
-| vfc        | Virtual Function Controller (WIP)   |
+| vfc        | Virtual Function Controller         |
+| multicloud | Multi Cloud                         |
 | all_in_one | All ONAP services in a VM           |
 | testing    | Unit Test VM                        |
 
index 5eb22d7..ff35908 100644 (file)
@@ -352,6 +352,19 @@ Vagrant.configure("2") do |config|
       end
     end
 
+    config.vm.define :multicloud do |multicloud|
+      multicloud.vm.hostname = 'multicloud'
+      multicloud.vm.network :private_network, ip: '192.168.50.16'
+      multicloud.vm.provider "openstack" do |v|
+        v.server_name = 'multicloud'
+      end
+      multicloud.vm.provision 'shell' do |s|
+        s.path = 'vagrant_utils/postinstall.sh'
+        s.args = ['multicloud']
+        s.env = conf
+      end
+    end
+
   when 'testing'
 
     config.vm.define :testing do |testing|
diff --git a/bootstrap/vagrant-onap/lib/multicloud b/bootstrap/vagrant-onap/lib/multicloud
new file mode 100755 (executable)
index 0000000..1126d61
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+set -o xtrace
+
+source /var/onap/functions
+
+multicloud_src_folder=$git_src_folder/multicloud
+multicloud_repos=("azure" "framework" "openstack" "openstack/vmware" "openstack/windriver")
+
+# clone_multicloud_repos() - Function that clones the Multi Cloud repositories
+function clone_multicloud_repos {
+    clone_repo multicloud $multicloud_src_folder
+
+    for dirc in ${multicloud_repos[@]}; do
+        clone_repo multicloud/$dirc $multicloud_src_folder/$dirc
+    done
+}
+
+# compile_multicloud_repos() - 
+function compile_multicloud_repos {
+    compile_src multicloud $multicloud_src_folder
+
+    for dirc in ${multicloud_repos[@]}; do
+        compile_src $multicloud_src_folder/$dirc
+    done
+}
+
+# install_multicloud() - 
+function install_multicloud {
+    echo "pass"
+}
+
+# init_multicloud() - Function that initialize Multi Cloud services
+function init_multicloud {
+    if [[ "$clone_repo" == "True" ]]; then
+        clone_multicloud_repos
+        if [[ "$compile_repo" == "True" ]]; then
+            compile_multicloud_repos
+        fi
+    fi
+    install_multicloud
+}
index 1c872fa..275f644 100644 (file)
@@ -56,7 +56,7 @@ function clone_all_sdc_repos {
 
 # compile_all_sdc_repos() - Function that compiles SDC source repo.
 function compile_all_sdc_repos {
-    clone_repo sdc $sdc_src_folder
+    compile_src sdc $sdc_src_folder
 
     for dirc in ${sdc_repos[@]}; do
         compile_src $sdc_src_folder/$dirc
diff --git a/bootstrap/vagrant-onap/tests/test_multicloud b/bootstrap/vagrant-onap/tests/test_multicloud
new file mode 100644 (file)
index 0000000..4767152
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+source /var/onap_tests/_test_base
+source /var/onap/multicloud
+
+covered_functions=(
+"clone_multicloud_repos" "compile_multicloud_repos" "install_multicloud"
+)
+
+# test_clone_multicloud_repos() - Verify that Multi Cloud repositories are cloned properly
+function test_clone_multicloud_repos {
+    clone_multicloud_repos
+
+    asserts_file_exist $multicloud_src_folder/framework/multivimbroker/pom.xml
+    asserts_file_exist $multicloud_src_folder/openstack/pom.xml
+    asserts_file_exist $multicloud_src_folder/openstack/vmware/pom.xml
+}
+
+# test_compile_multicloud_repos() -
+function test_compile_multicloud_repos {
+    clone_multicloud_repos
+    compile_multicloud_repos
+
+    asserts_file_exist $multicloud_src_folder/openstack/newton/target/multicloud-openstack-newton-1.0.0-SNAPSHOT.zip
+    asserts_file_exist $multicloud_src_folder/openstack/vmware/vio/target/multivimdriver-vio-1.1.0-SNAPSHOT.zip
+}
+
+# test_install_multicloud() - Verify the built and start of Multi Cloud services
+function test_install_multicloud {
+    clone_multicloud_repos
+    install_multicloud
+}
+
+if [ "$1" != '*' ]; then
+    unset covered_functions
+    covered_functions=$1
+fi
+main "${covered_functions[@]}"
index 4d70140..103dfee 100644 (file)
@@ -25,7 +25,7 @@ https://wiki.onap.org/display/DW/ONAP+on+Vagrant
 #>
 
 Param(
-    [ValidateSet("all_in_one","dns", "mr", "sdc", "aai", "mso", "robot", "vid", "sdnc", "portal", "dcae", "policy", "appc", "testing")]
+    [ValidateSet("all_in_one","dns", "mr", "sdc", "aai", "mso", "robot", "vid", "sdnc", "portal", "dcae", "policy", "appc", "vfc", "multicloud", "testing")]
     [Parameter(Mandatory=$True,Position=0)]
     [ValidateNotNullOrEmpty()]
     [String]
index c606a09..094577f 100755 (executable)
@@ -12,7 +12,7 @@ Optional arguments:
         Test case to use in testing mode.
 Commands:
     all_in_one  Deploy in all-in-one mode.
-    dns|mr|sdc|aai|mso|robot|vid|sdnc|portal|dcae|policy|appc  Deploy chosen service.
+    dns|mr|sdc|aai|mso|robot|vid|sdnc|portal|dcae|policy|appc|vfc|multicloud  Deploy chosen service.
     testing  Deploy in testing mode.
 EOF
 }
@@ -55,7 +55,7 @@ case $COMMAND in
     "all_in_one" )
         export DEPLOY_MODE='all-in-one'
         ;;
-    "dns" | "mr" | "sdc" | "aai" | "mso" | "robot" | "vid" | "sdnc" | "portal" | "dcae" | "policy" | "appc" )
+    "dns" | "mr" | "sdc" | "aai" | "mso" | "robot" | "vid" | "sdnc" | "portal" | "dcae" | "policy" | "appc" | "vfc" | "multicloud" )
         export DEPLOY_MODE='individual'
         ;;
     "testing" )
diff --git a/pom.xml b/pom.xml
new file mode 100644 (file)
index 0000000..c19d699
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   Copyright (c) 2016-2017 Huawei Technologies Co., Ltd.
+   Modifications copyright (C) 2017 AT&T Intellectual Property
+
+   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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.onap.oparent</groupId>
+    <artifactId>oparent</artifactId>
+    <version>0.1.0</version>
+  </parent>
+  <name>integration</name>
+  <groupId>org.onap.integration</groupId>
+  <artifactId>root</artifactId>
+  <version>0.1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <modules>
+    <module>version-manifest</module>
+  </modules>
+</project>
diff --git a/test/csit/plans/holmes/sanity-check/setup.sh b/test/csit/plans/holmes/sanity-check/setup.sh
new file mode 100644 (file)
index 0000000..d3214e0
--- /dev/null
@@ -0,0 +1,66 @@
+#!/bin/bash
+#
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+#
+# Place the scripts in run order:
+
+# Download and start MySQL
+docker pull mysql/mysql-server
+docker run --name mysql-holmes -e MYSQL_ROOT_PASSWORD=rootpass -e MYSQL_ROOT_HOST=% -d mysql/mysql-server 
+MYSQL_IP=`get-instance-ip.sh mysql-holmes`
+echo MYSQL_IP=${MYSQL_IP}
+
+#login to the onap nexus docker repo
+docker login -u docker -p docker nexus3.onap.org:10001
+
+# Start MSB
+docker run -d -p 8500:8500 --name msb_consul nexus3.onap.org:10001/onap/msb/msb_base
+CONSUL_IP=`get-instance-ip.sh msb_consul`
+echo CONSUL_IP=${CONSUL_IP}
+docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery
+DISCOVERY_IP=`get-instance-ip.sh msb_discovery`
+echo DISCOVERY_IP=${DISCOVERY_IP}
+docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway
+MSB_IP==`get-instance-ip.sh msb_internal_apigateway`
+echo MSB_IP=${MSB_IP}
+
+# Start rulemgt
+source ${SCRIPTS}/holmes/rule-management/startup.sh i-rulemgt ${MYSQL_IP} ${MSB_IP} 80
+RULEMGT_IP=`get-instance-ip.sh i-rulemgt`
+echo RULEMGT_IP=${RULEMGT_IP}
+
+# Wait for initialization
+for i in {1..20}; do
+    curl -sS -m 1 ${RULEMGT_IP}:9101 && curl -sS -m 1 ${MSB_IP}:80 && break
+    echo sleep $i
+    sleep $i
+done
+
+# Start engine-d
+source ${SCRIPTS}/holmes/engine-management/startup.sh i-engine-d ${MYSQL_IP} ${MSB_IP} 80
+ENGINE_D_IP=`get-instance-ip.sh i-engine-d`
+echo ENGINE_D_IP=${ENGINE_D_IP}
+
+
+# Wait for initialization
+for i in {1..10}; do
+    curl -sS -m 1 ${ENGINE_D_IP}:9102 && break
+    echo sleep $i
+    sleep $i
+done
+#Pass any variables required by Robot test suites in ROBOT_VARIABLES
+ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v RULEMGT_IP:${RULEMGT_IP} -v ENGINE_D_IP:${ENGINE_D_IP}"
+
diff --git a/test/csit/plans/holmes/sanity-check/teardown.sh b/test/csit/plans/holmes/sanity-check/teardown.sh
new file mode 100644 (file)
index 0000000..4c457dc
--- /dev/null
@@ -0,0 +1,25 @@
+#!/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.
+#
+
+kill-instance.sh i-rulemgt
+kill-instance.sh i-engine-d
+kill-instance.sh msb_internal_apigateway
+kill-instance.sh msb_discovery
+kill-instance.sh msb_consul
+kill-instance.sh mysql-holmes
+
+
diff --git a/test/csit/plans/holmes/sanity-check/testplan.txt b/test/csit/plans/holmes/sanity-check/testplan.txt
new file mode 100644 (file)
index 0000000..e699512
--- /dev/null
@@ -0,0 +1,5 @@
+# Test suites are relative paths under [integration.git]/test/csit/tests/.
+# Place the suites in run order.
+
+holmes/testcase/EngineMgt
+holmes/testcase/RuleMgt
diff --git a/test/csit/plans/msb/sanity-check/setup.sh b/test/csit/plans/msb/sanity-check/setup.sh
new file mode 100644 (file)
index 0000000..6ae5e42
--- /dev/null
@@ -0,0 +1,41 @@
+#!/bin/bash
+#
+# Copyright 2017 2017 ZTE, Inc. and others.
+#
+# 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.
+#
+
+source ${SCRIPTS}/common_functions.sh
+
+#start msb
+sudo docker run -d -p 8500:8500  --name msb_consul consul
+MSB_CONSUL_IP=`get-instance-ip.sh msb_consul`
+echo MSB_CONSUL_IP=${MSB_CONSUL_IP}
+
+sudo docker run -d  -p 10081:10081  -e CONSUL_IP=$MSB_CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery
+MSB_DISCOVERY_IP=`get-instance-ip.sh msb_discovery`
+echo DISCOVERY_IP=${MSB_DISCOVERY_IP}
+
+sudo docker run -d -p 80:80 -e CONSUL_IP=$MSB_CONSUL_IP -e SDCLIENT_IP=$MSB_DISCOVERY_IP --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway
+MSB_IAG_IP=`get-instance-ip.sh msb_internal_apigateway`
+echo MSB_IAG_IP=${MSB_IAG_IP}
+
+# Wait for initialization(8500 Consul, 10081 Service Registration & Discovery, 80 api gateway)
+for i in {1..10}; do
+    curl -sS -m 1 ${MSB_CONSUL_IP}:8500 && curl -sS -m 1 ${MSB_DISCOVERY_IP}:10081 && curl -sS -m 1 ${MSB_IAG_IP}:80 && break
+    echo sleep $i
+    sleep $i
+done
+
+# Pass any variables required by Robot test suites in ROBOT_VARIABLES
+ROBOT_VARIABLES="-v MSB_IAG_IP:${MSB_IAG_IP}"
diff --git a/test/csit/plans/msb/sanity-check/teardown.sh b/test/csit/plans/msb/sanity-check/teardown.sh
new file mode 100644 (file)
index 0000000..3e7dbc1
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# Copyright 2017 2017 ZTE, Inc. and others.
+#
+# 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.
+#
+
+kill-instance.sh msb_consul
+kill-instance.sh msb_discovery
+kill-instance.sh msb_internal_apigateway
\ No newline at end of file
diff --git a/test/csit/plans/msb/sanity-check/testplan.txt b/test/csit/plans/msb/sanity-check/testplan.txt
new file mode 100644 (file)
index 0000000..0ef7507
--- /dev/null
@@ -0,0 +1,3 @@
+# Test suites are relative paths under [integration.git]/test/csit/tests/.
+# Place the suites in run order.
+msb/startup
diff --git a/test/csit/plans/vfc/nfvo-lcm/setup.sh b/test/csit/plans/vfc/nfvo-lcm/setup.sh
new file mode 100755 (executable)
index 0000000..92d500c
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+#
+# Place the scripts in run order:
+# Start all process required for executing test case
+
+#login to the onap nexus docker repo
+docker login -u docker -p docker nexus3.onap.org:10001
+
+# Start MSB
+docker run -d -p 8500:8500 --name msb_consul nexus3.onap.org:10001/onap/msb/msb_base
+CONSUL_IP=`get-instance-ip.sh msb_consul`
+echo CONSUL_IP=${CONSUL_IP}
+docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery nexus3.onap.org:10001/onap/msb/msb_discovery
+DISCOVERY_IP=`get-instance-ip.sh msb_discovery`
+echo DISCOVERY_IP=${DISCOVERY_IP}
+docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP --name msb_internal_apigateway nexus3.onap.org:10001/onap/msb/msb_apigateway
+MSB_IP==`get-instance-ip.sh msb_internal_apigateway`
+echo MSB_IP=${MSB_IP}
+
+# start vfc-nslcm
+docker run -d --name vfc-nslcm -e MSB_ADDR=${MSB_IP}:80 nexus3.onap.org:10001/onap/vfc/nslcm
+NSLCM_IP=`get-instance-ip.sh vfc-nslcm`
+for i in {1..50}; do
+    curl -sS ${NSLCM_IP}:8403 && break
+    echo sleep $i
+    sleep $i
+done
+
+# Pass any variables required by Robot test suites in ROBOT_VARIABLES
+ROBOT_VARIABLES="-v MSB_IP:${MSB_IP} -v NSLCM_IP:${NSLCM_IP}"
diff --git a/test/csit/plans/vfc/nfvo-lcm/teardown.sh b/test/csit/plans/vfc/nfvo-lcm/teardown.sh
new file mode 100755 (executable)
index 0000000..c74850d
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+#
+
+# This script is sourced by run-csit.sh after Robot test completion.
+kill-instance.sh msb_internal_apigateway
+kill-instance.sh msb_discovery
+kill-instance.sh msb_consul
+kill-instance.sh vfc-nslcm
diff --git a/test/csit/plans/vfc/nfvo-lcm/testplan.txt b/test/csit/plans/vfc/nfvo-lcm/testplan.txt
new file mode 100644 (file)
index 0000000..fc261e1
--- /dev/null
@@ -0,0 +1,3 @@
+# Test suites are relative paths under [integration.git]/test/csit/tests/.
+# Place the suites in run order.
+vfc/nfvo-lcm/test.robot
index 85c6bc2..b54ea56 100644 (file)
 
 
 #Start market place
-docker run -d -i -t --name=vnfmarket   -p 8702:8702 onap/vnfmarket
+docker run -d -i -t --name=refrepo   -p 8702:8702 nexus3.onap.org:10001/onap/refrepo:1.0-STAGING-latest
 
-REPO_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' vnfmarket`
+REPO_IP=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' refrepo`
 
 
 # Pass any variables required by Robot test suites in ROBOT_VARIABLES
-ROBOT_VARIABLES="-v REPO_IP:${REPO_IP}"
-
+ROBOT_VARIABLES="-v SCRIPTS:{SCRIPTS} -v REPO_IP:${REPO_IP}"
+echo ${ROBOT_VARIABLES}
 
index 42d7b7f..a426343 100644 (file)
@@ -17,5 +17,5 @@
 # This script is sourced by run-csit.sh after Robot test completion.
 
 
-kill-instance.sh vnfmarket
+kill-instance.sh refrepo
 
diff --git a/test/csit/scripts/holmes/engine-management/startup.sh b/test/csit/scripts/holmes/engine-management/startup.sh
new file mode 100644 (file)
index 0000000..321ac6b
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+#
+# $1 nickname for the engined instance
+# $2 IP address of JDBC
+# $3 IP address of BrokerIP
+
+docker login -u docker -p docker nexus3.onap.org:10001
+
+run-instance.sh nexus3.onap.org:10001/onap/holmes/engine-management:latest $1 "-e URL_JDBC=$2:3306 -e MSB_ADDR=$3 -e MSB_PORT=$4"
diff --git a/test/csit/scripts/holmes/rule-management/startup.sh b/test/csit/scripts/holmes/rule-management/startup.sh
new file mode 100644 (file)
index 0000000..cbfd13a
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+#
+# Copyright 2017 ZTE Corporation.
+#
+# 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.
+#
+# $1 nickname for the RuleMgt instance
+# $2 IP address of JDBC
+
+docker login -u docker -p docker nexus3.onap.org:10001
+
+run-instance.sh nexus3.onap.org:10001/onap/holmes/rule-management:latest $1 "-e URL_JDBC=$2:3306 -e MSB_ADDR=$3 -e MSB_PORT=$4"
\ No newline at end of file
diff --git a/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot b/test/csit/tests/holmes/testcase/CommonKeywords/HttpRequest.robot
new file mode 100644 (file)
index 0000000..5b84174
--- /dev/null
@@ -0,0 +1,37 @@
+*** Settings ***
+Library           Collections
+Library           RequestsLibrary
+Resource          ../RuleMgt/Rule-Keywords.robot
+
+*** Keywords ***
+httpPut
+    [Arguments]    ${restHost}    ${restUrl}    ${data}
+    ${headers}    create dictionary    Content-Type=application/json;charset=utf-8    Accept=application/json
+    create session    microservices    ${restHost}    ${headers}
+    log    ${data}
+    ${putResponse}    put request    microservices    ${restUrl}    ${data}    \    ${EMPTY}
+    ...    ${headers}
+    log    ${putResponse}
+    [Return]    ${putResponse}
+
+httpGet
+    [Arguments]    ${restHost}    ${restUrl}
+    create session    microservices    ${restHost}
+    ${getResponse}    get request    microservices    ${restUrl}
+    [Return]    ${getResponse}
+
+httpPost
+    [Arguments]    ${restHost}    ${restUrl}    ${data}
+    ${headers}    create dictionary    Content-Type=application/json    Accept=application/json
+    create session    microservices    ${restHost}    ${headers}
+    log    ${data}
+    ${postResponse}    post request    microservices    ${restUrl}    ${data}
+    Comment    log    ${postResponse.content}
+    [Return]    ${postResponse}
+
+httpDelete
+    [Arguments]    ${restHost}    ${restUrl}    ${data}
+    ${headers}    create dictionary    Content-Type=application/json    Accept=application/json
+    create session    microservices    ${restHost}    ${headers}
+    ${deleteResponse}    delete request    microservices    ${restUrl}    ${data}
+    [Return]    ${deleteResponse}
diff --git a/test/csit/tests/holmes/testcase/EngineMgt/Engine-Keywords.robot b/test/csit/tests/holmes/testcase/EngineMgt/Engine-Keywords.robot
new file mode 100644 (file)
index 0000000..aac8676
--- /dev/null
@@ -0,0 +1,34 @@
+*** Settings ***
+Library           Collections
+Library           RequestsLibrary
+Resource          ../CommonKeywords/HttpRequest.robot
+Resource          EngineAddr.robot
+
+*** Keywords ***
+deleteEngineRule
+    [Arguments]    ${packageName}    ${codeFlag}=1
+    [Documentation]    ${packageName} :The data type is string!
+    ${headers}    create dictionary    Content-Type=application/json
+    create session    microservices    ${engineHost}    ${headers}
+    ${deleteUrl}    set variable    ${engineUrl}/${packageName}
+    ${deleteResponse}    delete request    microservices    ${deleteUrl}
+    log    ${deleteResponse.content}
+    run keyword if    ${codeFlag}==1    Should be equal as strings    ${deleteResponse.status_code}    200
+    run keyword if    ${codeFlag}!=1    Should be equal as strings    ${deleteResponse.status_code}    499
+    [Return]    ${deleteResponse}
+
+verifyEngineRule
+    [Arguments]    ${checkContent}    ${codeFlag}=1
+    ${response}    httpPost    ${engineHost}    ${engineUrl}    ${checkContent}
+    log    ${response.content}
+    run keyword if    ${codeFlag}==1    Should be equal as strings    ${response.status_code}    200
+    run keyword if    ${codeFlag}!=1    Should be equal as strings    ${response.status_code}    499
+    [Return]    ${response}
+
+deployEngineRule
+    [Arguments]    ${jsonParams}    ${codeFlag}=1
+    ${response}    httpPut    ${engineHost}    ${engineUrl}    ${jsonParams}
+    log    ${response.content}
+    run keyword if    ${codeFlag}==1    Should be equal as strings    ${response.status_code}    200
+    run keyword if    ${codeFlag}!=1    Should be equal as strings    ${response.status_code}    499
+    [Return]    ${response}
diff --git a/test/csit/tests/holmes/testcase/EngineMgt/Engine-Mgt.robot b/test/csit/tests/holmes/testcase/EngineMgt/Engine-Mgt.robot
new file mode 100644 (file)
index 0000000..52c6822
--- /dev/null
@@ -0,0 +1,41 @@
+*** Settings ***
+Suite Setup
+Suite Teardown    Delete All Sessions
+Test Teardown
+Test Timeout
+Library           demjson
+Resource          Engine-Keywords.robot
+Resource          ../RuleMgt/Rule-Keywords.robot
+
+*** Test Cases ***
+verify_invalid_rule
+    [Documentation]    Verify a rule with invalid contents.
+    ${dic1}    create dictionary    content=123123123
+    ${Jsonparam}    encode    ${dic1}
+    verifyEngineRule    ${Jsonparam}    -1
+
+verify_valid_rule
+    [Documentation]    Verify a rule with valid contents.
+    ${dic2}    create dictionary    content=package rule03080001
+    ${Jsonparam}    encode    ${dic2}
+    verifyEngineRule    ${Jsonparam}
+
+deploy_invalid_rule
+    [Documentation]    Add a rule with invalid contents to the engine.
+    ${dic3}    create dictionary    content=789789789    engineid=""
+    ${Jsonparam}    encode    ${dic3}
+    ${response}    deployEngineRule    ${Jsonparam}    -1
+
+deploy_valid_rule
+    [Documentation]    Add a rule with valid contents to the engine.
+    ${dic4}    create dictionary    content=package rule03080002    engineid=""
+    ${Jsonparam}    encode    ${dic4}
+    ${response}    deployEngineRule    ${Jsonparam}
+
+delete_existing_rule
+    [Documentation]    Delete an existing rule using an existing package ID from the engine.
+    deleteEngineRule    rule03080002
+
+delete_non_existing_rule
+    [Documentation]    Delete an existing rule using a non-existing package ID from the engine.
+    deleteEngineRule    rule03080002    -1
diff --git a/test/csit/tests/holmes/testcase/EngineMgt/EngineAddr.robot b/test/csit/tests/holmes/testcase/EngineMgt/EngineAddr.robot
new file mode 100644 (file)
index 0000000..24c809c
--- /dev/null
@@ -0,0 +1,3 @@
+*** Variables ***
+${engineHost}     http://${MSB_IP}
+${engineUrl}      /onapapi/holmes-engine-mgmt/v1/rule
diff --git a/test/csit/tests/holmes/testcase/EngineMgt/__init__.txt b/test/csit/tests/holmes/testcase/EngineMgt/__init__.txt
new file mode 100644 (file)
index 0000000..a69b32d
--- /dev/null
@@ -0,0 +1,2 @@
+*** Settings ***
+Suite Setup
diff --git a/test/csit/tests/holmes/testcase/RuleMgt/Rule-Keywords.robot b/test/csit/tests/holmes/testcase/RuleMgt/Rule-Keywords.robot
new file mode 100644 (file)
index 0000000..b203917
--- /dev/null
@@ -0,0 +1,81 @@
+*** Settings ***
+Library           RequestsLibrary
+Library           Collections
+Resource          RuleAddr.robot
+Resource          ../CommonKeywords/HttpRequest.robot
+
+*** Keywords ***
+prepareRules
+    ${rule1}    create dictionary    rulename=ying001    content=package rule0001    enabled=1    description=this is first description
+    ${rule2}    create dictionary    rulename=ying002    content=package rule0002    enabled=0    description=this is seconddescription
+    ${rule3}    create dictionary    rulename=ying003    content=package rule0003    enabled=1    description=this is third description
+    @{rulesList}    create list    ${rule1}    ${rule2}    ${rule3}
+    : FOR    ${row}    IN    @{rulesList}
+    \    ${rulejson}    encode    ${row}
+    \    log    ${rulejson}
+    \    createRule    ${rulejson}
+
+ruleMgtSuiteVariable
+    ${RULEDIC}    create dictionary    rulename=gy2017001    description=create a new rule!    content=package rule2017001    enabled=1
+    set suite variable    ${RULEDIC}
+
+queryConditionRule
+    [Arguments]    ${queryParam}    ${codeFlag}=1
+    [Documentation]    ${queryParam} : The data type is Json .
+    create session    microservices    ${ruleMgtHost}
+    ${param}    set variable    queryrequest\=${queryParam}
+    ${headers}    set variable
+    ${getResponse}    get request    microservices    ${ruleMgtUrl}    ${headers}    ${param}
+    log    ${getResponse.content}
+    run keyword if    ${codeFlag}==1    Should be equal as strings    ${getResponse.status_code}    200
+    run keyword if    ${codeFlag}!=1    Should be equal as strings    ${getResponse.status_code}    499
+    [Return]    ${getResponse}
+
+traversalRuleAttribute
+    [Arguments]    ${responseJsonData}    ${expectAttrDic}
+    [Documentation]    ${expectAttrDic} : The data type is dictionary;
+    ...    key is the name of the attribute, value is the expected value of the attribute.
+    @{responseRules}    Get From Dictionary    ${responseJsonData}    rules
+    : FOR    ${rule}    IN    @{responseRules}
+    \    log    ${rule}
+    \    verifyRuleAttribute    ${rule}    ${expectAttrDic}
+
+verifyRuleAttribute
+    [Arguments]    ${singleRule}    ${expectAttrDic}
+    [Documentation]    ${expectAttrDic} : The data type is dictionary; key is the name of the attributes to be traversaled, value is the expected value of the attributes.
+    log    ${singleRule}
+    log    ${expectAttrDic}
+    @{attrsKeys}    get dictionary keys    ${expectAttrDic}
+    : FOR    ${attr}    IN    @{attrsKeys}
+    \    log    ${attr}
+    \    ${actualResponse}    get from dictionary    ${singleRule}    ${attr}
+    \    ${expectResponse}    get from dictionary    ${expectAttrDic}    ${attr}
+    \    Comment    log    ${actualResponse}
+    \    Comment    log    ${expectResponse}
+    Should be equal as strings    ${actualResponse}    ${expectResponse}
+
+createRule
+    [Arguments]    ${jsonParams}    ${codeFlag}=1
+    [Documentation]    ${codeFlag} : The data type is string, defult value is 1, indicating that the case need to assert thatthe statues code is 200.
+    ...    Then other values indicating that the case need to assert that the statues code is 499.
+    ${response}    httpPut    ${ruleMgtHost}    ${ruleMgtUrl}    ${jsonParams}
+    log    ${response.content}
+    run keyword if    ${codeFlag}==1    Should be equal as strings    ${response.status_code}    200
+    run keyword if    ${codeFlag}!=1    Should be equal as strings    ${response.status_code}    499
+    [Return]    ${response}
+
+modifyRule
+    [Arguments]    ${jsonParams}    ${codeFlag}=1
+    ${response}    httpPost    ${ruleMgtHost}    ${ruleMgtUrl}    ${jsonParams}
+    log    ${response.content}
+    run keyword if    ${codeFlag}==1    Should be equal as strings    ${response.status_code}    200
+    run keyword if    ${codeFlag}!=1    Should be equal as strings    ${response.status_code}    499
+    [Return]    ${response}
+
+deleteRule
+    [Arguments]    ${jsonParam}    ${codeFlag}=1
+    ${response}    httpDelete    ${ruleMgtHost}    ${ruleMgtUrl}    ${jsonParam}
+    log    ${response.content}
+    run keyword if    ${codeFlag}==1    Should be equal as strings    ${response.status_code}    200
+    run keyword if    ${codeFlag}!=1    Should be equal as strings    ${response.status_code}    499
+    [Return]    ${response}
diff --git a/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot b/test/csit/tests/holmes/testcase/RuleMgt/Rule-Mgt.robot
new file mode 100644 (file)
index 0000000..03ee708
--- /dev/null
@@ -0,0 +1,127 @@
+*** Settings ***
+Suite Setup
+Suite Teardown    Delete All Sessions
+Test Timeout
+Library           demjson
+Resource          Rule-Keywords.robot
+
+*** Test Cases ***
+add_valid_rule
+    [Documentation]    Add a valid rule.
+    ${dict2}    create dictionary    rulename=youbowu0314    description=create a new rule!    content=package rule03140002    enabled=1
+    ${jsonParams}    encode    ${dict2}
+    ${response}    createRule    ${jsonParams}
+    ${respJson}    to json    ${response.content}
+    ${RULEID}    get from dictionary    ${respJson}    ruleid
+    set global variable    ${RULEID}
+    log    ${RULEID}
+
+add_invalid_content_rule
+    [Documentation]    Add an invalid rule of which the content is incorrect!!
+    ${dict1}    create dictionary    rulename=gy0307001    description=create a new rule!    content=123123123    enabled=1
+    ${jsonParams}    encode    ${dict1}
+    ${response}    createRule    ${jsonParams}    -1
+    log    ${response.content}
+
+add_deficient_rule
+    [Documentation]    Add an invalid rule of which some mandatory fields are missing.(rulename)
+    ${dict3}    create dictionary    description=create a valid rule!    content=package rule2017    enabled=1
+    ${jsonParams}    encode    ${dict3}
+    ${response}    createRule    ${jsonParams}    -1
+
+query_rule_with_existing_id
+    [Documentation]    Query a rule with an existing ID.
+    should not be empty    ${RULEID}
+    ${response}    queryConditionRule    {"ruleid":"${RULEID}"}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}!=1    fail    Can't find the rule with the specified ruleid.
+
+query_rule_with_non_existing_id
+    [Documentation]    Query a rule with a non-existing ID.
+    ${response}    queryConditionRule    {"ruleid":"invalidid"}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}!=0    fail
+
+query_rule_with_partial_existing_name
+    [Documentation]    Query rules with (a part of) an existing name.
+    ${response}    queryConditionRule    {"rulename":"youbowu"}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}<1    fail    Can't find the rule with (a part of) an existing name
+
+query_rule_with_partial_non_existing_name
+    [Documentation]    Query rules with (a part of) a non-existing name.
+    ${response}    queryConditionRule    {"rulename":"zte2017"}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}!=0    fail
+
+query_rule_with_vaild_status
+    [Documentation]    Query rules with a valid status.
+    ${response}    queryConditionRule    {"enabled":1}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}<0    fail    Can't find the rule with the status valued 1.
+
+query_rule_with_invalid_status
+    [Documentation]    Query rules with an invalid status.
+    ${response}    queryConditionRule    {"enabled":99}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}!=0    fail
+
+query_rule_with_empty_status
+    [Documentation]    Query rules with the status left empty.
+    ${response}    queryConditionRule    {"enabled":""}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}!=0    fail
+
+query_rule_with_combinational_fields
+    [Documentation]    Query rules using the combination of different fields.
+    ${dic}    create dictionary    rulename=youbowu0314    enabled=1
+    ${paramJson}    encode    ${dic}
+    ${response}    queryConditionRule    ${paramJson}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}<1    fail    Can't find the rules with the combination of different fields.
+    ...    ELSE    traversalRuleAttribute    ${respJson}    ${dic}
+
+modify_rule_with_status
+    [Documentation]    modify the rule with a valid status.
+    ${dic}    create dictionary    ruleid=${RULEID}    enabled=0    content=package rule03140002
+    ${modifyParam}    encode    ${dic}
+    ${modifyResp}    modifyRule    ${modifyParam}
+    ${response}    queryConditionRule    {"ruleid":"${RULEID}"}
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}!=1    fail    query rule fails! (can't find the rule modified!)
+    ...    ELSE    traversalRuleAttribute    ${respJson}    ${dic}
+
+modify_rule_with_invalid_status
+    [Documentation]    modify the rule with an invalid status.
+    ${dic}    create dictionary    ruleid=${RULEID}    enabled=88    content=package rule03140002
+    ${modifyParam}    encode    ${dic}
+    ${modifyResponse}    modifyRule    ${modifyParam}    -1
+
+modify_rule_with_description
+    [Documentation]    modify the description of the rule with the new string.
+    ${dic}    create dictionary    ruleid=${RULEID}    description=now, i modifying the description of the rule.    content=package rule03140002
+    ${modifyParam}    encode    ${dic}
+    ${modifyResp}    modifyRule    ${modifyParam}
+    ${response}    queryConditionRule    {"ruleid":"${RULEID}"}    1
+    ${respJson}    to json    ${response.content}
+    ${count}    get from dictionary    ${respJson}    totalcount
+    run keyword if    ${count}!=1    fail    query rule fails!
+    ...    ELSE    traversalRuleAttribute    ${respJson}    ${dic}
+
+delete_existing_rule
+    [Documentation]    Delete an existing rule.
+    should not be empty    ${RULEID}
+    deleteRule    {"ruleid":"${RULEID}"}
+
+delete_non_existing_rule
+    [Documentation]    Delete a non-existing rule.
+    deleteRule    {"ruleid":"${RULEID}"}    -1
diff --git a/test/csit/tests/holmes/testcase/RuleMgt/RuleAddr.robot b/test/csit/tests/holmes/testcase/RuleMgt/RuleAddr.robot
new file mode 100644 (file)
index 0000000..ec565e9
--- /dev/null
@@ -0,0 +1,3 @@
+*** Variables ***
+${ruleMgtHost}    http://${MSB_IP}
+${ruleMgtUrl}     /onapapi/holmes-rule-mgmt/v1/rule
diff --git a/test/csit/tests/holmes/testcase/RuleMgt/__init__.txt b/test/csit/tests/holmes/testcase/RuleMgt/__init__.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/test/csit/tests/msb/startup/__init__.robot b/test/csit/tests/msb/startup/__init__.robot
new file mode 100644 (file)
index 0000000..2f64526
--- /dev/null
@@ -0,0 +1,2 @@
+*** Settings ***
+Documentation    Microservices Service Bus - Startup
diff --git a/test/csit/tests/msb/startup/test1.robot b/test/csit/tests/msb/startup/test1.robot
new file mode 100644 (file)
index 0000000..99ad603
--- /dev/null
@@ -0,0 +1,16 @@
+*** Settings ***
+Library       RequestsLibrary
+
+*** Test Cases ***
+Liveness Test
+    [Documentation]        Check various endpoints for basic liveness check
+    Create Session         msb              http://${MSB_IAG_IP}:80
+    CheckUrl               msb              /msb
+    CheckUrl               msb              /iui/microservices/default.html
+
+*** Keywords ***
+CheckUrl
+    [Arguments]                   ${session}  ${path}
+    ${resp}=                      Get Request          ${session}  ${path}
+    Should Be Equal As Integers   ${resp.status_code}  200
+
diff --git a/test/csit/tests/vfc/nfvo-lcm/test.robot b/test/csit/tests/vfc/nfvo-lcm/test.robot
new file mode 100644 (file)
index 0000000..2ace7b4
--- /dev/null
@@ -0,0 +1,21 @@
+*** settings ***
+Library     Collections
+Library     RequestsLibrary
+Library     OperatingSystem
+Library     json
+
+*** Variables ***
+@{return_ok_list}=   200  201  202
+${queryswagger_url}    /api/nslcm/v1/swagger.json
+
+*** Test Cases ***
+NslcmSwaggerTest
+    [Documentation]    query nslcm swagger info rest test
+    ${headers}    Create Dictionary    Content-Type=application/json    Accept=application/json
+    Create Session    web_session    http://${MSB_IP}    headers=${headers}
+    ${resp}=  Get Request    web_session    ${queryswagger_url}
+    ${responese_code}=     Convert To String      ${resp.status_code}
+    List Should Contain Value    ${return_ok_list}   ${responese_code}
+    ${response_json}    json.loads    ${resp.content}
+    ${swagger_version}=    Convert To String      ${response_json['swagger']}
+    Should Be Equal    ${swagger_version}    2.0
index cff6b58..473415e 100644 (file)
@@ -4,8 +4,8 @@ Library           Process
 
 
 *** Variables ***
-${csarpath}    enterprise2DC.csar
-${upload}      uploadCSAR.sh
+${csarpath}    ${SCRIPTS}/../tests/vnfsdk-marketplace/provision/enterprise2DC.csar
+${upload}      ${SCRIPTS}/../tests/vnfsdk-marketplace/provision/uploadCSAR.sh
 
 
 *** Test Cases ***
@@ -13,4 +13,5 @@ ${upload}      uploadCSAR.sh
 E2E Test case for VNF SDK
     [Documentation]    Upload the VNF Package
     ${status}=    Run Process   bash ${upload} ${REPO_IP} ${csarpath} > log.txt    shell=yes
+    Log    Status is ${status}
 
diff --git a/version-manifest/pom.xml b/version-manifest/pom.xml
new file mode 100644 (file)
index 0000000..5d3f569
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.onap.integration</groupId>
+    <artifactId>root</artifactId>
+    <version>0.1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>version-manifest</artifactId>
+  <packaging>maven-plugin</packaging>
+  <name>ONAP Version Manifest and Maven Plugin</name>
+  <url>https://www.onap.org</url>
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <mavenVersion>3.2.3</mavenVersion>
+  </properties>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>2.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.plugin-tools</groupId>
+      <artifactId>maven-plugin-annotations</artifactId>
+      <version>3.2</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-utils</artifactId>
+      <version>3.0.8</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>${mavenVersion}</version>
+    </dependency>
+    <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-csv -->
+    <dependency>
+      <groupId>org.apache.commons</groupId>
+      <artifactId>commons-csv</artifactId>
+      <version>1.4</version>
+    </dependency>
+  </dependencies>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-plugin-plugin</artifactId>
+        <version>3.2</version>
+        <configuration>
+          <goalPrefix>version-manifest</goalPrefix>
+          <skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
+        </configuration>
+        <executions>
+          <execution>
+            <id>mojo-descriptor</id>
+            <goals>
+              <goal>descriptor</goal>
+            </goals>
+          </execution>
+          <execution>
+            <id>help-goal</id>
+            <goals>
+              <goal>helpmojo</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
diff --git a/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java b/version-manifest/src/main/java/org/onap/integration/versionmanifest/VersionCheckMojo.java
new file mode 100644 (file)
index 0000000..b26c1cd
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2017 Huawei Technologies, Ltd. and others.
+ *
+ * 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.
+ */
+
+package org.onap.integration.versionmanifest;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.MalformedURLException;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.commons.csv.CSVFormat;
+import org.apache.commons.csv.CSVRecord;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.logging.Log;
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.project.MavenProject;
+
+@Mojo(name = "version-check", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
+public class VersionCheckMojo extends AbstractMojo {
+
+    /**
+     * The Maven Project.
+     *
+     * @since 1.0-alpha-1
+     */
+    @Parameter(defaultValue = "${project}", required = true, readonly = true)
+    protected MavenProject project;
+
+    /**
+     * Location of the file.
+     */
+    @Parameter(property = "manifest", required = true, defaultValue = "/java-manifest.csv")
+    private String manifest;
+
+    public void execute() throws MojoExecutionException {
+        final Log log = getLog();
+
+        log.info("Checking version manifest " + manifest);
+
+        Map<String, String> expectedVersions = new HashMap<>();
+
+        try (InputStreamReader in = new InputStreamReader(getClass().getResourceAsStream(manifest),
+                StandardCharsets.ISO_8859_1)) {
+            Iterable<CSVRecord> records = CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(in);
+            for (CSVRecord record : records) {
+                String groupId = record.get("groupId");
+                String artifactId = record.get("artifactId");
+                String version = record.get("version");
+                log.debug("Expected version: " + groupId + ":" + artifactId + ":" + version);
+                expectedVersions.put(groupId + ":" + artifactId, version);
+            }
+        } catch (MalformedURLException e) {
+            log.error(e);
+            throw new MojoExecutionException(e.getMessage());
+        } catch (IOException e) {
+            log.error(e);
+            throw new MojoExecutionException(e.getMessage());
+        }
+
+        Map<String, String> actualVersions = new HashMap<>();
+        MavenProject parent = project.getParent();
+        if (parent != null) {
+            log.debug("Parent: " + parent);
+            actualVersions.put(parent.getGroupId() + ":" + parent.getArtifactId(), parent.getVersion());
+        } else {
+            log.debug("No parent");
+        }
+
+        for (Dependency dep : project.getDependencies()) {
+            log.debug("Dependency: " + dep.toString());
+            actualVersions.put(dep.getGroupId() + ":" + dep.getArtifactId(), dep.getVersion());
+        }
+
+        Set<String> mismatches = new TreeSet<>();
+        for (Entry<String, String> expected : expectedVersions.entrySet()) {
+            String artifact = expected.getKey();
+            String expectedVersion = expectedVersions.get(artifact);
+            String actualVersion = actualVersions.get(artifact);
+            if (actualVersion != null && !actualVersion.equals(expectedVersion)) {
+                mismatches.add(artifact);
+            }
+        }
+
+        if (mismatches.isEmpty()) {
+            log.debug("No version mismatches found");
+        } else {
+            log.warn("The following dependencies should be updated to match the version manifest:");
+            for (String artifact : mismatches) {
+                String expectedVersion = expectedVersions.get(artifact);
+                String actualVersion = actualVersions.get(artifact);
+                if (actualVersion != null && !actualVersion.equals(expectedVersion)) {
+                    log.warn("  " + artifact + " " + actualVersion + " -> " + expectedVersion);
+                }
+            }
+        }
+
+    }
+}
diff --git a/version.properties b/version.properties
new file mode 100644 (file)
index 0000000..f841ab7
--- /dev/null
@@ -0,0 +1,14 @@
+###########################################################
+# Versioning variables
+# Note that these variables cannot be structured (e.g. : version.release or version.snapshot etc... )
+# because they are used in Jenkins, whose plug-in doesn't support
+
+major_version=0
+minor_version=1
+patch_version=0
+
+base_version=${major_version}.${minor_version}.${patch_version}
+
+# Release must be completed with GIT information # in Jenkins
+release_version=${base_version}
+snapshot_version=${base_version}-SNAPSHOT
\ No newline at end of file