Revised deploy/rackhd_redfish_service_validator.sh for comments
# Usage:
# ./rackhd_redfish_service_validator.sh host:port
-if [ -z $1 ]; then
+if [ -z $1 -o "$1" == "-h" ]; then
echo "Usage: ./rackhd_redfish_service_validator.sh host:port"
- exit
+ exit 1
fi
-# set up virtual environment
+echo "**** Checking server..."
+curl $1/api/2.0/config > /dev/null
+if [ $? -gt 0 ]; then
+ echo "Unable to contact server at $1"
+ exit 1
+fi
+
+echo "**** Setting up virtual environment..."
rm -rf rsv1
echo \
"beautifulsoup4==4.5.3
@@ -18,11 +25,11 @@ virtualenv -p python3 rsv1
source rsv1/bin/activate
pip3 install -r rsv_requirements.txt
-# download RSV
+echo "**** Downloading RSV tool from GitHub..."
rm -rf RSV
git clone https://github.com/DMTF/Redfish-Service-Validator.git RSV
-# download on-http
+echo "**** Downloading on-http from RackHD GitHub..."
rm -rf temp_rsv
git clone https://www.github.com/rackhd/on-http temp_rsv
mkdir RSV/config
@@ -30,7 +37,7 @@ mkdir RSV/SchemaFiles
mkdir RSV/logs
cp -rp temp_rsv/static/DSP8010_2016.3/metadata RSV/SchemaFiles
-# create config file
+echo "**** Creating config file..."
echo \
"[Information]
Updated = May 8, 2017
@@ -52,11 +59,13 @@ ServiceMode = Off
Session_UserName = admin
Session_Password = admin123" > RSV/config/config.ini
-# execute validator
+echo "**** Executing Redfish validator..."
cd RSV
python3 RedfishServiceValidator.py -c config/config.ini
+exitcode=$?
echo ""
-echo "Validator Test Results located in RSV/logs"
-exit
+echo "**** Validator exited with status $exitcode"
+echo "**** Validator Test Results located in RSV/logs"
+exit $exitcode
