Add debug support 21/22321/1
authorVictor Morales <victor.morales@intel.com>
Mon, 6 Nov 2017 17:20:27 +0000 (09:20 -0800)
committerVictor Morales <victor.morales@intel.com>
Mon, 6 Nov 2017 17:20:27 +0000 (09:20 -0800)
This change allows to control the level of verbosity for the
ONAP on vagrant execution. The new debug configuration value
enables verbosity setting its value to *True*

Change-Id: I29a3694ea3182a02cb585af5ae8ada1f8a415c8c
Signed-off-by: Victor Morales <victor.morales@intel.com>
Issue-Id: INT-323

22 files changed:
bootstrap/vagrant-onap/Vagrantfile
bootstrap/vagrant-onap/lib/aai
bootstrap/vagrant-onap/lib/appc
bootstrap/vagrant-onap/lib/ccsdk
bootstrap/vagrant-onap/lib/commons
bootstrap/vagrant-onap/lib/dcae
bootstrap/vagrant-onap/lib/functions
bootstrap/vagrant-onap/lib/mr
bootstrap/vagrant-onap/lib/mso
bootstrap/vagrant-onap/lib/multicloud
bootstrap/vagrant-onap/lib/policy
bootstrap/vagrant-onap/lib/portal
bootstrap/vagrant-onap/lib/robot
bootstrap/vagrant-onap/lib/sdc
bootstrap/vagrant-onap/lib/sdnc
bootstrap/vagrant-onap/lib/vfc
bootstrap/vagrant-onap/lib/vid
bootstrap/vagrant-onap/lib/vnfsdk
bootstrap/vagrant-onap/lib/vvp
bootstrap/vagrant-onap/tests/asserts
bootstrap/vagrant-onap/vagrant_utils/postinstall.sh
bootstrap/vagrant-onap/vagrant_utils/unit_testing.sh

index 2490b1c..0664e5f 100644 (file)
@@ -23,6 +23,7 @@ configuration = {
   'openstack_password'  => '',
   'odl_version'         => '0.5.3-Boron-SR3',
   # Parameters for enabling features
+  'debug'               => 'True',
   'build_image'         => 'True',
   'clone_repo'          => 'True',
   'compile_repo'        => 'False',
index d267e02..538ad2c 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 hbase_version=1.2.3
index 4d93f54..181c73f 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/sdnc
 source /var/onap/functions
 
index 03987ea..3502e01 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 ccsdk_src_folder=$git_src_folder/ccsdk
index 26e2cc2..ba7c761 100755 (executable)
@@ -1,26 +1,16 @@
 #!/bin/bash
 
-set -o xtrace
-
 # update_repos() - Function that updates linux repositories
 function update_repos {
+    echo "Updating repositories list..."
     if [ -f /var/onap/files/sources.list ]; then
         cp /var/onap/files/sources.list /etc/apt/sources.list
     fi
-    if [ -f /var/onap/files/proxyrc ]; then
-        source /var/onap/files/proxyrc
-        cp /var/onap/files/proxyrc /etc/profile.d/proxy.sh
-
-        if [ -f /etc/apt/apt.conf ]; then
-            echo "Acquire::http::Proxy \"${http_proxy}\";" >>  /etc/apt/apt.conf
-            echo "Acquire::https::Proxy \"${https_proxy}\";" >>  /etc/apt/apt.conf
-        fi
-        if [ -d /etc/apt/apt.conf.d ] & [ ! -f /etc/apt/apt.conf.d/70proxy.conf ]; then
-            echo "Acquire::http::Proxy \"${http_proxy}\";" >>  /etc/apt/apt.conf.d/70proxy.conf
-            echo "Acquire::https::Proxy \"${https_proxy}\";" >>  /etc/apt/apt.conf.d/70proxy.conf
-        fi
+    if [[ "$debug" == "False" ]]; then
+        apt-get update > /dev/null
+    else
+        apt-get update
     fi
-    apt-get update -qq -y
 }
 
 # is_package_installed() - Function to tell if a package is installed
@@ -41,9 +31,15 @@ function install_packages {
 # install_package() - Install specific package if doesn't exist
 function install_package {
     local package=$1
+
     if ! is_package_installed $package; then
-        update_repos
-        apt-get install -y -qq $package
+        echo "Installing $package..."
+
+        if [[ "$debug" == "False" ]]; then
+            apt-get install -y -qq -o=Dpkg::Use-Pty=0 $package
+        else
+            apt-get install -y $package
+        fi
     fi
 }
 
index 78ca8de..7ab32fd 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 dcae_src_folder=$git_src_folder/dcae
index 02111fa..1a1b2aa 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/commons
 source /var/onap/_composed_functions
 source /var/onap/_onap_functions
@@ -48,7 +46,11 @@ function clone_repo {
     local repo=$1
     local dest_folder=${2:-$git_src_folder/$repo}
     if [ ! -d $dest_folder ]; then
-        _git_timed clone ${repo_url}${repo} $dest_folder
+        if [[ "$debug" == "False" ]]; then
+            _git_timed clone --quiet ${repo_url}${repo} $dest_folder
+        else
+            _git_timed clone ${repo_url}${repo} $dest_folder
+        fi
     else
         pushd $dest_folder
         _git_timed pull
@@ -168,10 +170,10 @@ function install_docker {
     fi
     install_package software-properties-common
     curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
-    add-apt-repository \
+        add-apt-repository \
         "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
-        $(lsb_release -cs) \
-        stable"
+        $(lsb_release -cs) stable"
+
     install_package docker-ce
     _configure_docker_settings
     service docker restart
@@ -225,9 +227,14 @@ function start_ODL {
 function compile_src {
     local src_folder=$1
     pushd $src_folder
+    local mvn_build='mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none'
+    if [[ "$debug" == "False" ]]; then
+        mvn_build+=" -q"
+    fi
     if [ -f pom.xml ]; then
         install_maven
-        mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none
+        echo "Compiling $src_folder folder..."
+        eval $mvn_build
     fi
     popd
 }
index f221817..55096cb 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 mr_src_folder=$git_src_folder/dcae/message-router
index 5439d99..0f29b33 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 src_folder=$git_src_folder/mso
index b4a185a..0519587 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 multicloud_src_folder=$git_src_folder/multicloud
index be4cb2c..65a65a1 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 policy_src_folder=$git_src_folder/policy
index b5e768b..915ccd5 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 portal_src_folder=$git_src_folder/portal
index ebcca6e..6dcdf90 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 robot_src_folder=$git_src_folder/testsuite
index a21e2a4..88d1cc0 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 sdc_src_folder=$git_src_folder/sdc
index 5faca94..a69ce18 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 source /var/onap/ccsdk
 
index fc26af2..a4517ff 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 vfc_src_folder=$git_src_folder/vfc
index f99fd60..6fc7f35 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 vid_src_folder=$git_src_folder/vid
index c23ed85..863bae0 100644 (file)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 vnfsdk_src_folder=$git_src_folder/vnfsdk
index 588f32b..24264cc 100644 (file)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/functions
 
 vvp_src_folder=$git_src_folder/vvp
index 02c269b..52f0bce 100755 (executable)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -o xtrace
-
 source /var/onap/commons
 
 # asserts_process() - Function that verifies if a specific process is running
index 89a69dd..7083f3d 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/bash
 
-set -o xtrace
+if [[ "$debug" == "True" ]]; then
+    set -o xtrace
+fi
 
 source /var/onap/functions
 
index a378ad0..3a97ad9 100755 (executable)
@@ -1,5 +1,9 @@
 #!/bin/bash
 
+if [[ "$debug" == "True" ]]; then
+    set -o xtrace
+fi
+
 set -o errexit
 
 TEST_SUITE=${1:-*}