22#
33# buckets/error_injection/infrastructure.sh
44#
5- # © Copyright IBM Corporation 2015-2018 . All Rights Reserved
5+ # © Copyright IBM Corporation 2015-2021 . All Rights Reserved
66#
77# This program is licensed under the terms of the Eclipse Public License
88# v1.0 as published by the Eclipse Foundation and available at
@@ -31,7 +31,7 @@ LOG=${LOG_PATH}/buckets/error_injection/infrastructure.log
3131CSM_PATH=/opt/ibm/csm/bin
3232TEMP_LOG=${LOG_PATH} /buckets/error_injection/infrastructure_tmp.log
3333FLAG_LOG=${LOG_PATH} /buckets/error_injection/infrastructure_flags.log
34- UTILIY=$( nodels utility )
34+ UTILIY=$( nodels ${UTILITY} )
3535
3636if [ -f " ${BASH_SOURCE%/* } /../../include/functions.sh" ]
3737then
@@ -63,9 +63,9 @@ check_return_flag_value $? 0 "Test Case 1: Validating Health Check output"
6363
6464# Test Case 2: Start utility daemon, health check, utility daemon filled in
6565echo " Test Case 2: Start utility daemon, health check, utility daemon filled in" >> ${LOG}
66- xdsh utility " systemctl start csmd-utility"
66+ xdsh ${UTILITY} " systemctl start csmd-utility"
6767sleep 1
68- xdsh utility " systemctl is-active csmd-utility" > /dev/null
68+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
6969check_return_exit $? 0 " Test Case 2: Utility is active"
7070${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
7171check_return_exit $? 0 " Test Case 2: Health Check"
@@ -74,16 +74,16 @@ check_return_flag_value $? 0 "Test Case 2: Validating Health Check output"
7474
7575# Test Case 3: health check from utility, same info, local listed as utility
7676echo " Test Case 3: health check from utility, same info, local listed as utility" >> ${LOG}
77- xdsh utility " ${CSM_PATH} /csm_infrastructure_health_check -v" > ${TEMP_LOG} 2>&1
77+ xdsh ${UTILITY} " ${CSM_PATH} /csm_infrastructure_health_check -v" > ${TEMP_LOG} 2>&1
7878check_return_exit $? 0 " Test Case 3: Health check from utility"
7979check_all_output " MASTER: ${MASTER} " " Aggregators:0" " Utility Nodes:1" " Local_daemon: UTILITY: ${UTILITY} "
8080check_return_flag_value $? 0 " Test Case 3: Validating Health Check output"
8181
8282# Test Case 4: Stop utility daemon, health check, utility daemon unresponsive
8383echo " Test Case 4: Stop utility daemon, health check, utility daemon unresponsive" >> ${LOG}
84- xdsh utility " systemctl stop csmd-utility"
84+ xdsh ${UTILITY} " systemctl stop csmd-utility"
8585sleep 1
86- xdsh utility " systemctl is-active csmd-utility" > /dev/null
86+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
8787check_return_exit $? 1 " Test Case 4: Utility is not active"
8888${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
8989check_return_exit $? 0 " Test Case 4: Health Check"
@@ -92,9 +92,9 @@ check_return_flag_value $? 0 "Test Case 4: Validating Health Check output"
9292
9393# Test Case 5: Start utility daemon, health check, utility daemon responsive and bounced=1
9494echo " Test Case 5: Start utility daemon, health check, utility daemon responsive and bounced=1" >> ${LOG}
95- xdsh utility " systemctl start csmd-utility"
95+ xdsh ${UTILITY} " systemctl start csmd-utility"
9696sleep 1
97- xdsh utility " systemctl is-active csmd-utility" > /dev/null
97+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
9898check_return_exit $? 0 " Test Case 5: Utility is active"
9999${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
100100check_return_exit $? 0 " Test Case 5: Health Check"
@@ -107,7 +107,7 @@ systemctl stop csmd-master
107107sleep 1
108108systemctl is-active csmd-master > /dev/null
109109check_return_exit $? 3 " Test Case 6: Master is inactive"
110- xdsh utility " cat /var/log/ibm/csm/csm_utility.log" > ${TEMP_LOG} 2>&1
110+ xdsh ${UTILITY} " cat /var/log/ibm/csm/csm_utility.log" > ${TEMP_LOG} 2>&1
111111check_all_output " Transition from RUNMODE_CONFIGURED to: RUNMODE_DISCONNECTED"
112112check_return_flag_value $? 0 " Test Case 6: Utility transition to RUNMODE_DISCONNECTED"
113113
@@ -117,7 +117,7 @@ systemctl start csmd-master
117117sleep 1
118118systemctl is-active csmd-master > /dev/null
119119check_return_exit $? 0 " Test Case 7: Master is active"
120- xdsh utility " systemctl is-active csmd-utility" > /dev/null
120+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
121121check_return_exit $? 0 " Test Case 7: Utility is still active"
122122${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
123123check_return_exit $? 0 " Test Case 7: Health Check"
@@ -227,9 +227,9 @@ check_return_flag_value $? 0 "Test Case 15: Validating Health Check output"
227227
228228# Test Case 16: Start utility daemon, health check, utility and aggregator daemon present
229229echo " Test Case 16: Start utility daemon, health check, utility and aggregator daemon present" >> ${LOG}
230- xdsh utility " systemctl start csmd-utility"
230+ xdsh ${UTILITY} " systemctl start csmd-utility"
231231sleep 1
232- xdsh utility " systemctl is-active csmd-utility" > /dev/null
232+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
233233check_return_exit $? 0 " Test Case 16: Utility is active"
234234${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
235235check_return_exit $? 0 " Test Case 16: Health Check"
@@ -249,9 +249,9 @@ check_return_flag_value $? 0 "Test Case 17: Validating Health Check output"
249249
250250# Test Case 18: Stop utility daemon, health check, unresponsive aggregator and utility
251251echo " Test Case 18: Stop utility daemon, health check, unresponsive aggregator and utility" >> ${LOG}
252- xdsh utility " systemctl stop csmd-utility"
252+ xdsh ${UTILITY} " systemctl stop csmd-utility"
253253sleep 1
254- xdsh utility " systemctl is-active csmd-utility" > /dev/null
254+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
255255check_return_exit $? 1 " Test Case 18: Utility is not active"
256256${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
257257check_return_exit $? 0 " Test Case 18: Health Check"
@@ -271,9 +271,9 @@ check_return_flag_value $? 0 "Test Case 19: Validating Health Check output"
271271
272272# Test Case 20: Start utility daemon, health check, responsive aggregator and utility and bounced=1 for both
273273echo " Test Case 20: Start utility daemon, health check, responsive aggregator and utility and bounced=1 for both" >> ${LOG}
274- xdsh utility " systemctl start csmd-utility"
274+ xdsh ${UTILITY} " systemctl start csmd-utility"
275275sleep 1
276- xdsh utility " systemctl is-active csmd-utility" > /dev/null
276+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
277277check_return_exit $? 0 " Test Case 20: Utility is active"
278278${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
279279check_return_exit $? 0 " Test Case 20: Health Check"
@@ -289,7 +289,7 @@ check_return_exit $? 3 "Test Case 21: Master is not active"
289289xdsh ${AGGREGATOR_A} " cat /var/log/ibm/csm/csm_aggregator.log" > ${TEMP_LOG} 2>&1
290290check_all_output " Transition from RUNMODE_CONFIGURED to: RUNMODE_DISCONNECTED"
291291check_return_flag_value $? 0 " Test Case 21: Aggregator transitions to RUNMODE_DISCONNECTED"
292- xdsh utility " cat /var/log/ibm/csm/csm_utility.log" > ${TEMP_LOG} 2>&1
292+ xdsh ${UTILITY} " cat /var/log/ibm/csm/csm_utility.log" > ${TEMP_LOG} 2>&1
293293check_all_output " Transition from RUNMODE_CONFIGURED to: RUNMODE_DISCONNECTED"
294294check_return_flag_value $? 0 " Test Case 21: Utility transitions to RUNMODE_DISCONNECTED"
295295
@@ -299,7 +299,7 @@ systemctl start csmd-master
299299sleep 1
300300systemctl is-active csmd-master > /dev/null
301301check_return_exit $? 0 " Test Case 22: Master is active"
302- xdsh utility " systemctl is-active csmd-utility" > /dev/null
302+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
303303check_return_exit $? 0 " Test Case 22: Utility is active"
304304xdsh ${AGGREGATOR_A} " systemctl is-active csmd-aggregator" > /dev/null
305305check_return_exit $? 0 " Test Case 22: Aggregator is active"
@@ -405,9 +405,9 @@ check_return_flag_value $? 0 "Test Case 29: Validating Health Check output"
405405
406406# Test Case 30: Start utility daemon, health check, utility and aggregator daemon present
407407echo " Test Case 30: Start utility daemon, health check, utility and aggregator daemon present" >> ${LOG}
408- xdsh utility " systemctl start csmd-utility"
408+ xdsh ${UTILITY} " systemctl start csmd-utility"
409409sleep 1
410- xdsh utility " systemctl is-active csmd-utility" > /dev/null
410+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
411411check_return_exit $? 0 " Test Case 30: Utility is active"
412412${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
413413check_return_exit $? 0 " Test Case 30: Health Check"
@@ -441,9 +441,9 @@ check_return_flag_value $? 0 "Test Case 32: Validating csm_ras_event_query outpu
441441
442442# Test Case 33: Stop utility daemon, health check, utility disconnected
443443echo " Test Case 33: Stop utility daemon, health check, utility disconnected" >> ${LOG}
444- xdsh utility " systemctl stop csmd-utility"
444+ xdsh ${UTILITY} " systemctl stop csmd-utility"
445445sleep 1
446- xdsh utility " systemctl is-active csmd-utility" > /dev/null
446+ xdsh ${UTILITY} " systemctl is-active csmd-utility" > /dev/null
447447check_return_exit $? 1 " Test Case 33: Utility is not active"
448448${CSM_PATH} /csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
449449check_return_exit $? 0 " Test Case 33: Health Check"
0 commit comments