Add some error checking to F21 install 45/3745/3
authorBilly O'Mahony <billy.o.mahony@intel.com>
Mon, 23 Nov 2015 15:26:28 +0000 (15:26 +0000)
committerMaryam Tahhan <maryam.tahhan@intel.com>
Wed, 2 Dec 2015 13:49:51 +0000 (13:49 +0000)
Make the install fail fast and obviously on error rather than
continuing on. This can be used as a template for adding error
checking on the other systems.

JIRA: VSPERF-141

Change-Id: I1892db661a56ab2012e26c6720e0851fabbb51d9

Signed-off-by: Billy O'Mahony<billy.o.mahony@intel.com>
Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
systems/Fedora/21/build_base_machine.sh
systems/Fedora/21/prepare_python_env.sh
systems/build_base_machine.sh

index 036f6cc..0aaa73b 100755 (executable)
@@ -66,7 +66,7 @@ abrt-addon-python3
 
 # install git-review tool
 git-review
-" | grep -v ^#)
+" | grep -v ^#) || exit 1
 
 # Create hugepage dirs
-mkdir -p /dev/hugepages
\ No newline at end of file
+mkdir -p /dev/hugepages
index 0c1465c..f348c75 100755 (executable)
@@ -23,7 +23,7 @@ fi
 
 # enable virtual environment in a subshell, so QEMU build can use python 2.7
 
-(virtualenv-3.4 "$VSPERFENV_DIR"
-source "$VSPERFENV_DIR"/bin/activate
-pip install -r ../requirements.txt
-pip install pylint)
\ No newline at end of file
+(virtualenv-3.4 "$VSPERFENV_DIR" || exit 1
+source "$VSPERFENV_DIR"/bin/activate || exit 1
+pip install -r ../requirements.txt || exit 1
+pip install pylint || exit 1)
index 84a8e36..95f3876 100755 (executable)
@@ -54,13 +54,13 @@ fi
 
 # build base system using OS specific scripts
 if [ -d "$distro_dir" ] && [ -e "$distro_dir/build_base_machine.sh" ]; then
-    $SUDO $distro_dir/build_base_machine.sh
+    $SUDO $distro_dir/build_base_machine.sh || die "$distro_dir/build_base_machine.sh failed"
 else
     die "$distro_dir is not yet supported"
 fi
 
 if [ -d "$distro_dir" ] && [ -e "$distro_dir/prepare_python_env.sh" ] ; then
-    $distro_dir/prepare_python_env.sh
+    $distro_dir/prepare_python_env.sh || die "prepare_python_env.sh failed"
 else
     die "$distro_dir is not yet supported"
 fi
@@ -72,6 +72,8 @@ fi
 # download and compile DPDK, OVS and QEMU
 if [ -f ../src/Makefile ] ; then
     cd ../src
-    make
+    make || die "Make failed"
     cd -
+else
+    die "Make failed; No Makefile"
 fi