Improve ovs_deploy.bash script 77/50377/9
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Wed, 10 Jan 2018 18:59:41 +0000 (18:59 +0000)
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Mon, 29 Jan 2018 08:46:39 +0000 (08:46 +0000)
Improved ovs_deploy.bash script [1]:
- Check if there is an error during the execution.
- Removed "prerequisites" function because is not called.
- Modified DPDK package installation: execute "make config" and then "make"
- Added comments.

[1]https://github.com/opnfv/yardstick/blob/master/yardstick/resources/scripts/install/ovs_deploy.bash

JIRA: YARDSTICK-916

Change-Id: I3029f983dde72aa46f6fdd61dd64d086ab3c2af6
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
yardstick/resources/scripts/install/ovs_deploy.bash

index d94f30d..beda9a5 100755 (executable)
@@ -14,6 +14,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+set -e
+
 INSTALL_OVS_BIN="/usr/src"
 cd $INSTALL_OVS_BIN
 
@@ -22,20 +24,6 @@ if [[ $EUID -ne 0 ]]; then
   exit 1;
 fi
 
-prerequisite()
-{
-  echo "Install required libraries to run collectd..."
-  pkg=(git flex bison build-essential pkg-config automake autotools-dev libltdl-dev cmake qemu-kvm libvirt-bin bridge-utils numactl libnuma-dev libpcap-dev)
-  for i in "${pkg[@]}"; do
-  dpkg-query -W --showformat='${Status}\n' "${i}"|grep "install ok installed"
-  if [  "$?" -eq "1" ]; then
-    apt-get update
-    apt-get -y install "${i}";
-  fi
-  done
-  echo "Done"
-}
-
 download_zip()
 {
   url=$1
@@ -53,6 +41,7 @@ download_zip()
 
 dpdk_build()
 {
+  echo "Build DPDK libraries"
   pushd .
   if [[ $DPDK_VERSION != "" ]]; then
     export DPDK_DIR=$INSTALL_OVS_BIN/dpdk-stable-$DPDK_VERSION
@@ -62,13 +51,15 @@ dpdk_build()
     DPDK_DOWNLOAD="http://fast.dpdk.org/rel/dpdk-$DPDK_VERSION.tar.xz"
     download_zip "${DPDK_DOWNLOAD}" "DPDK"
     cd dpdk-stable-"$DPDK_VERSION"
-    make install -j T=$RTE_TARGET
+    make config T=$RTE_TARGET
+    make install -j $(nproc) T=$RTE_TARGET
   fi
   popd
 }
 
 ovs()
 {
+  echo "Build and install OVS with DPDK"
   pushd .
   if [[ $OVS_VERSION != "" ]]; then
     rm -rf openswitch-"$OVS_VERSION"
@@ -82,7 +73,7 @@ ovs()
     else
       ./configure
     fi
-    make install -j
+    make install -j $(nproc)
   fi
   popd
 }