aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorGary Wu <gary.i.wu@huawei.com>2017-10-27 17:17:25 +0000
committerGerrit Code Review <gerrit@onap.org>2017-10-27 17:17:25 +0000
commit16daccf687482656ff4e71b6e09c08664d24eb68 (patch)
treef863674f576bfaa2deecee436ef01d5209fe94f0 /bootstrap
parent312e7f3db1dd2664a4320e9be087965c00bfe44e (diff)
parentd3cbcf2b5498cf7facd474ba30a45bb5498fe5d1 (diff)
Merge "Add VVP support in Vagrant ONAP"
Diffstat (limited to 'bootstrap')
-rw-r--r--bootstrap/vagrant-onap/README.md1
-rw-r--r--bootstrap/vagrant-onap/Vagrantfile10
-rw-r--r--bootstrap/vagrant-onap/lib/vvp59
-rw-r--r--bootstrap/vagrant-onap/tests/test_vvp55
-rw-r--r--bootstrap/vagrant-onap/tools/Run.ps16
-rwxr-xr-xbootstrap/vagrant-onap/tools/run.sh4
6 files changed, 130 insertions, 5 deletions
diff --git a/bootstrap/vagrant-onap/README.md b/bootstrap/vagrant-onap/README.md
index e1815e7eb..7a3641e4f 100644
--- a/bootstrap/vagrant-onap/README.md
+++ b/bootstrap/vagrant-onap/README.md
@@ -56,6 +56,7 @@ current options include:
| multicloud | Multi Cloud |
| ccsdk | Common Controller SDK |
| vnfsdk | VNF SDK |
+| vpp | VNF Validation Program |
| all_in_one | All ONAP services in a VM |
| testing | Unit Test VM |
diff --git a/bootstrap/vagrant-onap/Vagrantfile b/bootstrap/vagrant-onap/Vagrantfile
index dc8b34768..d70cf8f8a 100644
--- a/bootstrap/vagrant-onap/Vagrantfile
+++ b/bootstrap/vagrant-onap/Vagrantfile
@@ -211,6 +211,16 @@ nodes = [
:groups => ["individual"],
:args => ['vid'],
},
+ {
+ :name => "vvp",
+ :ips => ['10.252.0.17', "192.168.50.17"],
+ :macs => [],
+ :cpus => 2,
+ :cpu => "50",
+ :ram => 4 * 1024,
+ :groups => ["individual"],
+ :args => ['vvp'],
+ },
]
run_path = 'vagrant_utils/postinstall.sh'
diff --git a/bootstrap/vagrant-onap/lib/vvp b/bootstrap/vagrant-onap/lib/vvp
new file mode 100644
index 000000000..588f32b87
--- /dev/null
+++ b/bootstrap/vagrant-onap/lib/vvp
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+set -o xtrace
+
+source /var/onap/functions
+
+vvp_src_folder=$git_src_folder/vvp
+vvp_repos=("vvp/ansible-ice-bootstrap" "vvp/cms" "vvp/devkit" "vvp/documentation" "vvp/engagementmgr" "vvp/gitlab" "vvp/image-scanner" "vvp/jenkins" "vvp/portal" "vvp/postgresql" "vvp/test-engine" "vvp/validation-scripts")
+
+# clone_all_vvp_repos() - Function that clones vvp source repo.
+function clone_all_vvp_repos {
+ for repo in ${vvp_repos[@]}; do
+ clone_repo $repo $vvp_src_folder${repo#*vvp}
+ done
+}
+
+# compile_all_vvp_repos - Function that builds vvp source repo
+function compile_all_vvp_repos {
+ for repo in ${vvp_repos[@]}; do
+ compile_src $vvp_src_folder${repo#*vvp}
+ done
+}
+
+# _build_vvp_images() - Builds VNFSDK images from source code
+function _build_vvp_images {
+ echo "pass"
+}
+
+# get_vvp_images - Function that clones vvp Docker images
+function get_vvp_images {
+ if [[ "$build_image" == "True" ]]; then
+ _build_vvp_images
+ else
+ pull_docker_image refrepo:1.0-STAGING-latest
+ pull_docker_image refrepo:latest
+ fi
+}
+
+# install_vvp - Function that installs vvp Docker images
+function install_vvp {
+ echo "pass"
+}
+
+# init_vvp() - Init VNFSDK services
+function init_vvp {
+ if [[ "$clone_repo" == "True" ]]; then
+ clone_all_vvp_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_vvp_repos
+ fi
+ fi
+
+ if [[ "$skip_get_images" == "False" ]]; then
+ get_vvp_images
+ if [[ "$skip_install" == "False" ]]; then
+ install_vvp
+ fi
+ fi
+}
diff --git a/bootstrap/vagrant-onap/tests/test_vvp b/bootstrap/vagrant-onap/tests/test_vvp
new file mode 100644
index 000000000..f77fdf4d3
--- /dev/null
+++ b/bootstrap/vagrant-onap/tests/test_vvp
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+source /var/onap_tests/_test_base
+source /var/onap/vvp
+
+covered_functions=(
+"clone_all_vvp_repos" "compile_all_vvp_repos" "get_vvp_images" "install_vvp"
+)
+
+# test_clone_all_vvp_repos() - Verify the cloning of VNFSDK source repo.
+function test_clone_all_vvp_repos {
+ clone_all_vvp_repos
+
+ asserts_file_exist $vvp_src_folder/cms/pom.xml
+ asserts_file_exist $vvp_src_folder/devkit/LICENSE.TXT
+ asserts_file_exist $vvp_src_folder/engagementmgr/pom.xml
+ asserts_file_exist $vvp_src_folder/gitlab/pom.xml
+ asserts_file_exist $vvp_src_folder/image-scanner/pom.xml
+ asserts_file_exist $vvp_src_folder/jenkins/pom.xml
+ asserts_file_exist $vvp_src_folder/portal/pom.xml
+ asserts_file_exist $vvp_src_folder/postgresql/pom.xml
+ asserts_file_exist $vvp_src_folder/test-engine/pom.xml
+ asserts_file_exist $vvp_src_folder/validation-scripts/LICENSE.txt
+}
+
+# test_compile_all_vvp_repos () - Verify if VNFSDK source repo compiles correctly.
+function test_compile_all_vvp_repos {
+ clone_all_vvp_repos
+ compile_all_vvp_repos
+
+ # asserts_file_exist $vvp_src_folder/
+}
+
+# test_get_vvp_images() - Verify that the VNFSDK images are created or retrieved
+function test_get_vvp_images {
+ clone_all_vvp_repos
+ get_vvp_images
+
+ #asserts_image refrepo:latest
+}
+
+# test_install_vvp() - Verify that VNFSDK docker images are running.
+function test_install_vvp {
+ clone_all_vvp_repos
+ get_vvp_images
+ install_vvp
+
+ #asserts_image_running refrepo:1.0-STAGING-latest
+}
+
+if [ "$1" != '*' ]; then
+ unset covered_functions
+ covered_functions=$1
+fi
+main "${covered_functions[@]}"
diff --git a/bootstrap/vagrant-onap/tools/Run.ps1 b/bootstrap/vagrant-onap/tools/Run.ps1
index 71e595bd8..a74dcb72d 100644
--- a/bootstrap/vagrant-onap/tools/Run.ps1
+++ b/bootstrap/vagrant-onap/tools/Run.ps1
@@ -31,7 +31,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", "vfc", "multicloud", "ccsdk", "testing")]
+ [ValidateSet("all_in_one","dns", "mr", "sdc", "aai", "mso", "robot", "vid", "sdnc", "portal", "dcae", "policy", "appc", "vfc", "multicloud", "ccsdk", "vnfsdk", "vvp", "testing")]
[Parameter(Mandatory=$True,Position=0)]
[ValidateNotNullOrEmpty()]
[String]
@@ -85,7 +85,7 @@ $env:SKIP_INSTALL=$skip_install
switch ($Command)
{
"all_in_one" { $env:DEPLOY_MODE="all-in-one" }
- { @("dns", "mr", "sdc", "aai", "mso", "robot", "vid", "sdnc", "portal", "dcae", "policy", "appc") -contains $_ } { $env:DEPLOY_MODE="individual" }
+ { @("dns", "mr", "sdc", "aai", "mso", "robot", "vid", "sdnc", "portal", "dcae", "policy", "appc", "vfc", "multicloud", "ccsdk", "vnfsdk", "vvp") -contains $_ } { $env:DEPLOY_MODE="individual" }
"testing"
{
$env:DEPLOY_MODE="testing"
@@ -110,7 +110,7 @@ switch ($Command)
}
default
{
- Write-Output $"Usage: $0 {all_in_one|dns|mr|sdc|aai|mso|robot|vid|sdnc|portal|dcae|policy|appc|testing}"
+ Write-Output $"Usage: $0 {all_in_one|dns|mr|sdc|aai|mso|robot|vid|sdnc|portal|dcae|policy|appc|vfc|multicloud|ccsdk|vnfsdk|vvp|testing}"
exit 1
}
}
diff --git a/bootstrap/vagrant-onap/tools/run.sh b/bootstrap/vagrant-onap/tools/run.sh
index 2f2743a16..eaa49431e 100755
--- a/bootstrap/vagrant-onap/tools/run.sh
+++ b/bootstrap/vagrant-onap/tools/run.sh
@@ -16,7 +16,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|vfc|vnfsdk|multicloud|ccsdk Deploy chosen service.
+ dns|mr|sdc|aai|mso|robot|vid|sdnc|portal|dcae|policy|appc|vfc|vnfsdk|multicloud|ccsdk|vvp Deploy chosen service.
testing Deploy in testing mode.
EOF
}
@@ -65,7 +65,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" | "vfc" | "vnfsdk"| "multicloud" | "ccsdk" )
+ "dns" | "mr" | "sdc" | "aai" | "mso" | "robot" | "vid" | "sdnc" | "portal" | "dcae" | "policy" | "appc" | "vfc" | "vnfsdk"| "multicloud" | "ccsdk" | "vvp" )
export DEPLOY_MODE='individual'
;;
"testing" )