diff options
Diffstat (limited to 'bootstrap')
36 files changed, 257 insertions, 125 deletions
diff --git a/bootstrap/jenkins/vagrant/Vagrantfile b/bootstrap/jenkins/vagrant/Vagrantfile index 02b3ec18c..7dcb48eff 100644 --- a/bootstrap/jenkins/vagrant/Vagrantfile +++ b/bootstrap/jenkins/vagrant/Vagrantfile @@ -49,6 +49,7 @@ Vagrant.configure(2) do |config| # # # Customize the amount of memory on the VM: vb.memory = "8192" + vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] end # # View the documentation for the provider you are using for more diff --git a/bootstrap/jenkins/vagrant/bootstrap.sh b/bootstrap/jenkins/vagrant/bootstrap.sh index fd0caf5c6..25c6a45f6 100755 --- a/bootstrap/jenkins/vagrant/bootstrap.sh +++ b/bootstrap/jenkins/vagrant/bootstrap.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # # Copyright 2017 Huawei Technologies Co., Ltd. # @@ -39,16 +39,16 @@ apt-get update apt-get -y install git git config --global user.email "jenkins@localhost" git config --global user.name "jenkins" -apt-get -y install curl openjdk-8-jdk maven unzip +apt-get -y install curl openjdk-8-jdk-headless maven unzip python-pip # install Jenkins wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' apt-get update -apt-get -y install jenkins jenkins-job-builder python-pip +apt-get -y install jenkins +# install docker apt-get -y install docker.io -sudo usermod -aG docker ubuntu sudo usermod -aG docker jenkins su -l jenkins -c "/vagrant/jenkins-init-1.sh" diff --git a/bootstrap/jenkins/vagrant/jenkins-init-1.sh b/bootstrap/jenkins/vagrant/jenkins-init-1.sh index 1f0a80859..3e83fa118 100755 --- a/bootstrap/jenkins/vagrant/jenkins-init-1.sh +++ b/bootstrap/jenkins/vagrant/jenkins-init-1.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # # Copyright 2017 Huawei Technologies Co., Ltd. # diff --git a/bootstrap/jenkins/vagrant/jenkins-init-2.sh b/bootstrap/jenkins/vagrant/jenkins-init-2.sh index a6cddbb10..f255a10ad 100755 --- a/bootstrap/jenkins/vagrant/jenkins-init-2.sh +++ b/bootstrap/jenkins/vagrant/jenkins-init-2.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # # Copyright 2017 Huawei Technologies Co., Ltd. # diff --git a/bootstrap/jenkins/vagrant/jjb-init.sh b/bootstrap/jenkins/vagrant/jjb-init.sh index e9adeb63b..10b96b4fa 100755 --- a/bootstrap/jenkins/vagrant/jjb-init.sh +++ b/bootstrap/jenkins/vagrant/jjb-init.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # # Copyright 2017 Huawei Technologies Co., Ltd. # @@ -17,9 +17,10 @@ git commit -m 'Installed plugins, restarted Jenkins' > /dev/null mkdir -p ~/.config/jenkins_jobs cp /vagrant/jenkins_jobs.ini ~/.config/jenkins_jobs -pip install --user jenkins-job-builder +pip -v install --user jenkins-job-builder +pip list -jenkins-job-builder update -r /vagrant/jjb +jenkins-jobs update -r /vagrant/jjb cat > .gitignore <<EOF jobs/*/builds diff --git a/bootstrap/jenkins/vagrant/jjb/java-jobs.yaml b/bootstrap/jenkins/vagrant/jjb/java-jobs.yaml index cb1f94afb..73d320e4a 100644 --- a/bootstrap/jenkins/vagrant/jjb/java-jobs.yaml +++ b/bootstrap/jenkins/vagrant/jjb/java-jobs.yaml @@ -304,9 +304,6 @@ repo: 'ncomp/utils' pom: 'pom.xml' - 'oom_registrator': - repo: 'oom' - pom: 'registrator/pom.xml' - - 'oom_registrator': repo: 'oom/registrator' pom: 'pom.xml' - 'oparent': @@ -388,9 +385,6 @@ repo: 'so/libs' pom: 'pom.xml' - 'testsuite_heatbridge': - repo: 'testsuite' - pom: 'heatbridge/pom.xml' - - 'testsuite_heatbridge': repo: 'testsuite/heatbridge' pom: 'pom.xml' - 'ui_dmaapbc': diff --git a/bootstrap/vagrant-onap/README.md b/bootstrap/vagrant-onap/README.md index b0e1ee26b..3e1fa1223 100644 --- a/bootstrap/vagrant-onap/README.md +++ b/bootstrap/vagrant-onap/README.md @@ -57,8 +57,11 @@ current options include: | ccsdk | Common Controller SDK | | vnfsdk | VNF SDK | | vvp | VNF Validation Program | +|:----------:|-------------------------------------| | all_in_one | All ONAP services in a VM | | testing | Unit Test VM | +|:----------:|-------------------------------------| +| openstack | OpenStack Deployment | #### Generating documentation diff --git a/bootstrap/vagrant-onap/Vagrantfile b/bootstrap/vagrant-onap/Vagrantfile index 2490b1c75..a0f3a1926 100644 --- a/bootstrap/vagrant-onap/Vagrantfile +++ b/bootstrap/vagrant-onap/Vagrantfile @@ -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', @@ -50,7 +51,7 @@ nodes = [ }, { :name => "all-in-one", - :ips => ['10.252.0.3', "192.168.50.3"], + :ips => ['10.252.1.3', "192.168.51.3"], :macs => [], :cpus => 2, :cpu => "50", @@ -182,7 +183,7 @@ nodes = [ }, { :name => "testing", - :ips => ['10.252.0.3', "192.168.50.3"], + :ips => ['10.252.2.3', "192.168.52.3"], :macs => [], :cpus => 2, :cpu => "50", @@ -212,14 +213,14 @@ nodes = [ :args => ['vid'], }, { - :name => "vnfsdk", - :ips => ['10.252.0.16', "192.168.50.16"], - :macs => [], - :cpus => 2, - :cpu => "50", - :ram => 4 * 1024, - :groups => ["individual"], - :args => ['vnfsdk'], + :name => "vnfsdk", + :ips => ['10.252.0.18', "192.168.50.18"], + :macs => [], + :cpus => 2, + :cpu => "50", + :ram => 4 * 1024, + :groups => ["individual"], + :args => ['vnfsdk'], }, { :name => "vvp", @@ -230,6 +231,16 @@ nodes = [ :ram => 4 * 1024, :groups => ["individual"], :args => ['vvp'], + }, + { + :name => "openstack", + :ips => ['10.252.3.3', "192.168.53.3"], + :macs => [], + :cpus => 2, + :cpu => "50", + :ram => 8 * 1024, + :groups => ["individual"], + :args => ['openstack'], } ] @@ -373,6 +384,9 @@ Vagrant.configure("2") do |config| # Set Box type nodeconfig.vm.box = box[provider] + if "openstack" == node[:name] + nodeconfig.vm.box = "ubuntu/xenial64" + end # Set Node name nodeconfig.vm.hostname = node[:name] diff --git a/bootstrap/vagrant-onap/etc/settings.yaml.development b/bootstrap/vagrant-onap/etc/settings.yaml.development index 594273b0d..7e1a1ec0b 100644 --- a/bootstrap/vagrant-onap/etc/settings.yaml.development +++ b/bootstrap/vagrant-onap/etc/settings.yaml.development @@ -1,4 +1,4 @@ -build_images: "True" +build_image: "True" clone_repo: "True" compile_repo: "False" enable_oparent: "True" diff --git a/bootstrap/vagrant-onap/etc/settings.yaml.testing b/bootstrap/vagrant-onap/etc/settings.yaml.testing index 8beb4767d..0a81e2d0c 100644 --- a/bootstrap/vagrant-onap/etc/settings.yaml.testing +++ b/bootstrap/vagrant-onap/etc/settings.yaml.testing @@ -1,4 +1,4 @@ -build_images: "False" +build_image: "False" clone_repo: "False" compile_repo: "False" enable_oparent: "False" diff --git a/bootstrap/vagrant-onap/lib/aai b/bootstrap/vagrant-onap/lib/aai index d267e020d..538ad2c02 100755 --- a/bootstrap/vagrant-onap/lib/aai +++ b/bootstrap/vagrant-onap/lib/aai @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions hbase_version=1.2.3 diff --git a/bootstrap/vagrant-onap/lib/appc b/bootstrap/vagrant-onap/lib/appc index 4d93f54e5..181c73f1f 100755 --- a/bootstrap/vagrant-onap/lib/appc +++ b/bootstrap/vagrant-onap/lib/appc @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/sdnc source /var/onap/functions diff --git a/bootstrap/vagrant-onap/lib/ccsdk b/bootstrap/vagrant-onap/lib/ccsdk index 03987ea7e..3502e01e8 100755 --- a/bootstrap/vagrant-onap/lib/ccsdk +++ b/bootstrap/vagrant-onap/lib/ccsdk @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions ccsdk_src_folder=$git_src_folder/ccsdk diff --git a/bootstrap/vagrant-onap/lib/commons b/bootstrap/vagrant-onap/lib/commons index 26e2cc26a..5d0c69108 100755 --- a/bootstrap/vagrant-onap/lib/commons +++ b/bootstrap/vagrant-onap/lib/commons @@ -1,26 +1,27 @@ #!/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 - fi - apt-get update -qq -y + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + zypper -n ref + ;; + ubuntu|debian) + if [[ "$debug" == "False" ]]; then + apt-get update > /dev/null + else + apt-get update + fi + ;; + rhel|centos|fedora) + yum updateinfo + ;; + esac } # is_package_installed() - Function to tell if a package is installed @@ -28,35 +29,88 @@ function is_package_installed { if [[ -z "$@" ]]; then return 1 fi - dpkg -s "$@" > /dev/null 2> /dev/null + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + dpkg -s "$@" > /dev/null + ;; + rhel|centos|fedora) + ;; + esac } # install_packages() - Install a list of packages function install_packages { local package=$@ - update_repos - apt-get install -y -qq $package + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + apt-get install -y -qq $package + ;; + rhel|centos|fedora) + ;; + esac } # 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..." + + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + zypper install -y $package + ;; + ubuntu|debian) + if [[ "$debug" == "False" ]]; then + apt-get install -y -qq -o=Dpkg::Use-Pty=0 $package + else + apt-get install -y $package + fi + ;; + rhel|centos|fedora) + PKG_MANAGER=$(which dnf || which yum) + ${PKG_MANAGER} -y install $package + ;; + esac fi } # uninstall_packages() - Uninstall a list of packages function uninstall_packages { local packages=$@ - apt-get purge -y -qq $packages + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + apt-get purge -y -qq $packages + ;; + rhel|centos|fedora) + ;; + esac } # uninstall_package() - Uninstall specific package if exists function uninstall_package { local package=$1 if is_package_installed $package; then - apt-get purge -y -qq $package + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + apt-get purge -y -qq $package + ;; + rhel|centos|fedora) + ;; + esac fi } diff --git a/bootstrap/vagrant-onap/lib/dcae b/bootstrap/vagrant-onap/lib/dcae index 78ca8de06..7ab32fd24 100755 --- a/bootstrap/vagrant-onap/lib/dcae +++ b/bootstrap/vagrant-onap/lib/dcae @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions dcae_src_folder=$git_src_folder/dcae diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions index 02111fa2c..25fbba3e9 100755 --- a/bootstrap/vagrant-onap/lib/functions +++ b/bootstrap/vagrant-onap/lib/functions @@ -1,13 +1,12 @@ #!/bin/bash -set -o xtrace - source /var/onap/commons source /var/onap/_composed_functions source /var/onap/_onap_functions export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' |sort -n | head -1) -export IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) +export NIC=$(ip route get 8.8.8.8 | awk '{ print $5; exit }') +export IP_ADDRESS=$(ifconfig $NIC | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) mvn_conf_file=/root/.m2/settings.xml git_src_folder=/opt @@ -18,6 +17,14 @@ function configure_dns { resolvconf -u } +# get_next_ip() - Function that provides the next ip +function get_next_ip { + local ip=${1:-$IP_ADDRESS} + ip_hex=$(printf '%.2X%.2X%.2X%.2X\n' `echo $ip | sed -e 's/\./ /g'`) + next_ip_hex=$(printf %.8X `echo $(( 0x$ip_hex + 1 ))`) + echo $(printf '%d.%d.%d.%d\n' `echo $next_ip_hex | sed -r 's/(..)/0x\1 /g'`) +} + # _git_timed() - git can sometimes get itself infinitely stuck with transient network # errors or other issues with the remote end. This wraps git in a # timeout/retry loop and is intended to watch over non-local git @@ -44,11 +51,15 @@ function _git_timed { # clone_repo() - Clone Git repository into specific folder function clone_repo { - local repo_url=https://git.onap.org/ + local repo_url=${3:-"https://git.onap.org/"} 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 @@ -56,11 +67,6 @@ function clone_repo { fi } -# install_dev_tools() - Install basic dependencies -function install_dev_tools { - install_packages apt-transport-https ca-certificates curl -} - # _install_bind() - Install bind utils function _install_bind { install_packages bind9 bind9utils @@ -71,8 +77,18 @@ function install_java { if is_package_installed openjdk-8-jdk; then return fi - install_package software-properties-common - add-apt-repository -y ppa:openjdk-r/ppa + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + install_package software-properties-common + add-apt-repository -y ppa:openjdk-r/ppa + ;; + rhel|centos|fedora) + ;; + esac + update_repos # Remove Java 7 uninstall_packages default-jre openjdk-7-jdk openjdk-7-jre openjdk-7-jre-headless @@ -88,8 +104,18 @@ function install_maven { return fi install_java - install_package software-properties-common - add-apt-repository -y ppa:andrei-pozolotin/maven3 + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + install_package software-properties-common + add-apt-repository -y ppa:andrei-pozolotin/maven3 + ;; + rhel|centos|fedora) + ;; + esac + update_repos install_package maven3 # Remove Java 7 @@ -125,7 +151,6 @@ function _configure_docker_settings { rm $docker_conf_backup echo "DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock\"" >> $docker_conf - usermod -a -G docker vagrant } # install_nodejs() - Download and install NodeJS @@ -148,17 +173,17 @@ function install_python { # _install_pip() - Install Python Package Manager function _install_pip { install_python - if [ ! -f /usr/local/bin/pip ]; then + if ! which pip; then curl -sL https://bootstrap.pypa.io/get-pip.py | python fi } # install_python_package() - Install a python module function install_python_package { - local python_package=$1 + local python_packages=$@ _install_pip - pip install $python_package + pip install $python_packages } # install_docker() - Download and install docker-engine @@ -166,12 +191,22 @@ function install_docker { if is_package_installed docker-ce; then return fi - install_package software-properties-common - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - - add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ - $(lsb_release -cs) \ - stable" + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + install_packages software-properties-common linux-image-extra-$(uname -r) linux-image-extra-virtual apt-transport-https ca-certificates curl + curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + add-apt-repository \ + "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ + $(lsb_release -cs) stable" + ;; + rhel|centos|fedora) + ;; + esac + update_repos + install_package docker-ce _configure_docker_settings service docker restart @@ -225,9 +260,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 } diff --git a/bootstrap/vagrant-onap/lib/mr b/bootstrap/vagrant-onap/lib/mr index f221817fa..55096cb4b 100755 --- a/bootstrap/vagrant-onap/lib/mr +++ b/bootstrap/vagrant-onap/lib/mr @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions mr_src_folder=$git_src_folder/dcae/message-router diff --git a/bootstrap/vagrant-onap/lib/mso b/bootstrap/vagrant-onap/lib/mso index 5439d991b..0f29b33c5 100755 --- a/bootstrap/vagrant-onap/lib/mso +++ b/bootstrap/vagrant-onap/lib/mso @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions src_folder=$git_src_folder/mso diff --git a/bootstrap/vagrant-onap/lib/multicloud b/bootstrap/vagrant-onap/lib/multicloud index b4a185aaf..05195877b 100755 --- a/bootstrap/vagrant-onap/lib/multicloud +++ b/bootstrap/vagrant-onap/lib/multicloud @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions multicloud_src_folder=$git_src_folder/multicloud diff --git a/bootstrap/vagrant-onap/lib/openstack b/bootstrap/vagrant-onap/lib/openstack new file mode 100755 index 000000000..6fe20d94c --- /dev/null +++ b/bootstrap/vagrant-onap/lib/openstack @@ -0,0 +1,53 @@ +#!/bin/bash + +source /var/onap/functions + +# deploy_openstack() - Function that provisions an OpenStack deployment +function deploy_openstack { + local network_id=${1:-"192.168.53.0"} + nic=$(ip route get $network_id | awk '{ print $4; exit }') + ip_address=$(ip route get $network_id | awk '{ print $6; exit }') + internal_vip_address=$(get_next_ip $ip_address) + + install_docker + mkdir -p /etc/systemd/system/docker.service.d + tee /etc/systemd/system/docker.service.d/kolla.conf <<-'EOF' +[Service] +MountFlags=shared +EOF + install_packages python-dev libffi-dev gcc libssl-dev python-selinux gcc + + install_python_package ansible docker kolla-ansible python-openstackclient + source /etc/os-release || source /usr/lib/os-release + case ${ID,,} in + *suse) + ;; + ubuntu|debian) + service docker restart + + cp -r /usr/local/share/kolla-ansible/etc_examples/kolla /etc/kolla/ + cp /usr/local/share/kolla-ansible/ansible/inventory/* . + sed -i "s/#kolla_base_distro: \"centos\"/kolla_base_distro: \"ubuntu\"/g" /etc/kolla/globals.yml + ;; + rhel|centos|fedora) + systemctl daemon-reload + systemctl restart docker + + cp -r /usr/share/kolla-ansible/etc_examples/kolla /etc/kolla/ + cp /usr/share/kolla-ansible/ansible/inventory/* . + sed -i "s/#kolla_base_distro: \"centos\"/kolla_base_distro: \"centos\"/g" /etc/kolla/globals.yml + ;; + esac + kolla-genpwd + sed -i "s/#openstack_release: \"\"/openstack_release: \"master\"/g" /etc/kolla/globals.yml + + sed -i "s/#network_interface: \"eth0\"/network_interface: \"$nic\"/g" /etc/kolla/globals.yml + sed -i "s/kolla_internal_vip_address: \"10.10.10.254\"/kolla_internal_vip_address: \"$internal_vip_address\"/g" /etc/kolla/globals.yml + sed -i "s/#api_interface: \"{{ network_interface }}\"/api_interface: \"{{ network_interface }}\"/g" /etc/kolla/globals.yml + echo "$ip_address $(hostname)" >> /etc/hosts + + kolla-ansible pull -i all-in-one + kolla-ansible deploy -i all-in-one + kolla-ansible post-deploy + echo "source /etc/kolla/admin-openrc.sh" >> ${HOME}/.bashrc +} diff --git a/bootstrap/vagrant-onap/lib/policy b/bootstrap/vagrant-onap/lib/policy index be4cb2c18..65a65a186 100755 --- a/bootstrap/vagrant-onap/lib/policy +++ b/bootstrap/vagrant-onap/lib/policy @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions policy_src_folder=$git_src_folder/policy diff --git a/bootstrap/vagrant-onap/lib/portal b/bootstrap/vagrant-onap/lib/portal index b5e768b2c..915ccd59a 100755 --- a/bootstrap/vagrant-onap/lib/portal +++ b/bootstrap/vagrant-onap/lib/portal @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions portal_src_folder=$git_src_folder/portal diff --git a/bootstrap/vagrant-onap/lib/robot b/bootstrap/vagrant-onap/lib/robot index ebcca6e6b..6dcdf90f0 100755 --- a/bootstrap/vagrant-onap/lib/robot +++ b/bootstrap/vagrant-onap/lib/robot @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions robot_src_folder=$git_src_folder/testsuite diff --git a/bootstrap/vagrant-onap/lib/sdc b/bootstrap/vagrant-onap/lib/sdc index a21e2a418..88d1cc0fd 100755 --- a/bootstrap/vagrant-onap/lib/sdc +++ b/bootstrap/vagrant-onap/lib/sdc @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions sdc_src_folder=$git_src_folder/sdc diff --git a/bootstrap/vagrant-onap/lib/sdnc b/bootstrap/vagrant-onap/lib/sdnc index 5faca942e..a69ce18fb 100755 --- a/bootstrap/vagrant-onap/lib/sdnc +++ b/bootstrap/vagrant-onap/lib/sdnc @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions source /var/onap/ccsdk diff --git a/bootstrap/vagrant-onap/lib/vfc b/bootstrap/vagrant-onap/lib/vfc index fc26af282..a4517ff7c 100755 --- a/bootstrap/vagrant-onap/lib/vfc +++ b/bootstrap/vagrant-onap/lib/vfc @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions vfc_src_folder=$git_src_folder/vfc diff --git a/bootstrap/vagrant-onap/lib/vid b/bootstrap/vagrant-onap/lib/vid index f99fd6042..6fc7f351f 100755 --- a/bootstrap/vagrant-onap/lib/vid +++ b/bootstrap/vagrant-onap/lib/vid @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions vid_src_folder=$git_src_folder/vid diff --git a/bootstrap/vagrant-onap/lib/vnfsdk b/bootstrap/vagrant-onap/lib/vnfsdk index c23ed8581..863bae0f6 100644 --- a/bootstrap/vagrant-onap/lib/vnfsdk +++ b/bootstrap/vagrant-onap/lib/vnfsdk @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions vnfsdk_src_folder=$git_src_folder/vnfsdk diff --git a/bootstrap/vagrant-onap/lib/vvp b/bootstrap/vagrant-onap/lib/vvp index 588f32b87..24264ccc9 100644 --- a/bootstrap/vagrant-onap/lib/vvp +++ b/bootstrap/vagrant-onap/lib/vvp @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/functions vvp_src_folder=$git_src_folder/vvp diff --git a/bootstrap/vagrant-onap/tests/_test_base b/bootstrap/vagrant-onap/tests/_test_base index 7d0415a44..78c7f8bb4 100644 --- a/bootstrap/vagrant-onap/tests/_test_base +++ b/bootstrap/vagrant-onap/tests/_test_base @@ -1,11 +1,13 @@ #!/bin/bash source /var/onap_tests/asserts +source /var/onap/commons # main() - Starting point for Unit Tests function main { local covered_functions=("$@") + update_repos len=${#covered_functions[@]} echo "1..$len" for i in ${!covered_functions[@]}; do diff --git a/bootstrap/vagrant-onap/tests/asserts b/bootstrap/vagrant-onap/tests/asserts index 02c269b4c..52f0bce92 100755 --- a/bootstrap/vagrant-onap/tests/asserts +++ b/bootstrap/vagrant-onap/tests/asserts @@ -1,7 +1,5 @@ #!/bin/bash -set -o xtrace - source /var/onap/commons # asserts_process() - Function that verifies if a specific process is running diff --git a/bootstrap/vagrant-onap/tests/test_functions b/bootstrap/vagrant-onap/tests/test_functions index 3ab5828cb..a6d225bc6 100644 --- a/bootstrap/vagrant-onap/tests/test_functions +++ b/bootstrap/vagrant-onap/tests/test_functions @@ -4,7 +4,7 @@ source /var/onap_tests/_test_base source /var/onap/functions covered_functions=( -"create_configuration_files" "clone_repo" "install_dev_tools" +"create_configuration_files" "clone_repo" "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" "docker_openecomp_login" @@ -55,15 +55,6 @@ function test_clone_repo { asserts_file_exist $git_src_folder/demo/LICENSE.TXT } -# test_install_dev_tools() - Verify the correct installation of developer tools -function test_install_dev_tools { - install_dev_tools - - asserts_installed_package apt-transport-https - asserts_installed_package ca-certificates - asserts_installed_package curl -} - # test_configure_bind() - Verify the correct installation and configuration of bind function test_configure_bind { configure_bind diff --git a/bootstrap/vagrant-onap/tools/Run.ps1 b/bootstrap/vagrant-onap/tools/Run.ps1 index a74dcb72d..7dfc83b37 100644 --- a/bootstrap/vagrant-onap/tools/Run.ps1 +++ b/bootstrap/vagrant-onap/tools/Run.ps1 @@ -31,7 +31,8 @@ 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", "vnfsdk", "vvp", "testing")] + [ValidateSet("all_in_one","dns", "mr", "sdc", "aai", "mso", "robot", "vid", "sdnc", "portal", "dcae", "policy", "appc", "vfc", "multicloud", "ccsdk", "vnfsdk", "vvp", "openstack", "testing")] + [Parameter(Mandatory=$True,Position=0)] [ValidateNotNullOrEmpty()] [String] @@ -85,7 +86,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", "vfc", "multicloud", "ccsdk", "vnfsdk", "vvp") -contains $_ } { $env:DEPLOY_MODE="individual" } + { @("dns", "mr", "sdc", "aai", "mso", "robot", "vid", "sdnc", "portal", "dcae", "policy", "appc", "vfc", "multicloud", "ccsdk", "vnfsdk", "vvp", "openstack") -contains $_ } { $env:DEPLOY_MODE="individual" } "testing" { $env:DEPLOY_MODE="testing" diff --git a/bootstrap/vagrant-onap/tools/run.sh b/bootstrap/vagrant-onap/tools/run.sh index eaa49431e..3c2134f8d 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|vvp Deploy chosen service. + dns|mr|sdc|aai|mso|robot|vid|sdnc|portal|dcae|policy|appc|vfc|vnfsdk|multicloud|ccsdk|vvp|openstack 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" | "vvp" ) + "dns" | "mr" | "sdc" | "aai" | "mso" | "robot" | "vid" | "sdnc" | "portal" | "dcae" | "policy" | "appc" | "vfc" | "vnfsdk"| "multicloud" | "ccsdk" | "vvp" | "openstack" ) export DEPLOY_MODE='individual' ;; "testing" ) diff --git a/bootstrap/vagrant-onap/vagrant_utils/postinstall.sh b/bootstrap/vagrant-onap/vagrant_utils/postinstall.sh index 89a69dd9a..8bf116d1d 100755 --- a/bootstrap/vagrant-onap/vagrant_utils/postinstall.sh +++ b/bootstrap/vagrant-onap/vagrant_utils/postinstall.sh @@ -1,11 +1,19 @@ #!/bin/bash -set -o xtrace +if [[ "$debug" == "True" ]]; then + set -o xtrace +fi + +if [[ "$1" == "openstack" ]]; then + source /var/onap/openstack + deploy_openstack + exit +fi source /var/onap/functions +update_repos create_configuration_files -install_dev_tools configure_bind for serv in $@; do diff --git a/bootstrap/vagrant-onap/vagrant_utils/unit_testing.sh b/bootstrap/vagrant-onap/vagrant_utils/unit_testing.sh index a378ad0cd..3a97ad9cf 100755 --- a/bootstrap/vagrant-onap/vagrant_utils/unit_testing.sh +++ b/bootstrap/vagrant-onap/vagrant_utils/unit_testing.sh @@ -1,5 +1,9 @@ #!/bin/bash +if [[ "$debug" == "True" ]]; then + set -o xtrace +fi + set -o errexit TEST_SUITE=${1:-*} |