Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1015 from williammorrison2/bills_csm_fvt_updates_…
Browse files Browse the repository at this point in the history
…1_8_3

CSM FVT updates from xcat node definitions to variables in the csm_te…
  • Loading branch information
besawn authored Oct 8, 2021
2 parents 66558d8 + 9008063 commit c6d4f28
Show file tree
Hide file tree
Showing 22 changed files with 272 additions and 182 deletions.
4 changes: 2 additions & 2 deletions csmtest/buckets/basic/allocation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# buckets/basic/node.sh
#
# © Copyright IBM Corporation 2015-2018. All Rights Reserved
# © Copyright IBM Corporation 2015-2021. All Rights Reserved
#
# This program is licensed under the terms of the Eclipse Public License
# v1.0 as published by the Eclipse Foundation and available at
Expand Down Expand Up @@ -126,7 +126,7 @@ check_return_flag_value $? 0 "Test Case 12: Checking allocation history table u

# Test Case 13: csm_allocation_create with launch node input
# Get utility node name
utility_node=`nodels utility | head -1`
utility_node=`nodels ${UTILITY} | head -1`
${CSM_PATH}/csm_allocation_create -j 1 -n ${SINGLE_COMPUTE} -l ${utility_node} > ${TEMP_LOG} 2>&1
check_return_flag_value $? 0 "Test Case 13: csm_allocation_create with launch node input"

Expand Down
5 changes: 3 additions & 2 deletions csmtest/buckets/basic/csm_ctrl_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# buckets/basic/csm_ctrl_cmd.sh
#
# © Copyright IBM Corporation 2015-2018. All Rights Reserved
# © Copyright IBM Corporation 2015-2021. All Rights Reserved
#
# This program is licensed under the terms of the Eclipse Public License
# v1.0 as published by the Eclipse Foundation and available at
Expand Down Expand Up @@ -43,7 +43,8 @@ date >> ${LOG}
echo "------------------------------------------------------------" >> ${LOG}

# Get Target Compute Node
target_node=`nodels compute_B | head -1`
#target_node=`nodels ${COMPUTE_B} | head -1`
target_node=`echo ${COMPUTE_B} | cut -d ',' -f 1`

# Start with Fresh CSM environment
${BASH_SOURCE%/*}/../../tools/dual_aggregator/shutdown_daemons.sh
Expand Down
4 changes: 2 additions & 2 deletions csmtest/buckets/basic/db_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# buckets/basic/db_script.sh
#
# © Copyright IBM Corporation 2015-2018. All Rights Reserved
# © Copyright IBM Corporation 2015-2021. All Rights Reserved
#
# This program is licensed under the terms of the Eclipse Public License
# v1.0 as published by the Eclipse Foundation and available at
Expand Down Expand Up @@ -69,7 +69,7 @@ check_return_exit $? 2 "Test Case 5: Checking fvttestdb was deleted"

# Cleanup
rm -f ${TEMP_LOG}
rm -f /var/lib/pgsql/backups/fvttestdb*
rm -rf /var/lib/pgsql/backups/fvttestdb_*

echo "------------------------------------------------------------" >> ${LOG}
echo "CSM DB Scripts Bucket PASSED" >> ${LOG}
Expand Down
6 changes: 3 additions & 3 deletions csmtest/buckets/error_injection/allocation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# buckets/error_injection/allocation.sh
#
# © Copyright IBM Corporation 2015-2018. All Rights Reserved
# © Copyright IBM Corporation 2015-2021. All Rights Reserved
#
# This program is licensed under the terms of the Eclipse Public License
# v1.0 as published by the Eclipse Foundation and available at
Expand Down Expand Up @@ -65,7 +65,7 @@ check_all_output "IN_SERVICE"
check_return_exit $? 0 "Test Case 2: csm_allocation_create node is out of service - verify back IN_SERVICE"

# Test Case 3: csm_allocation_create permission denied
su -c "${CSM_PATH}/csm_allocation_create -j 123 -n ${SINGLE_COMPUTE}" plundgr > ${TEMP_LOG} 2>&1
su -c "${CSM_PATH}/csm_allocation_create -j 123 -n ${SINGLE_COMPUTE}" ${USER} > ${TEMP_LOG} 2>&1
check_return_exit $? 1 "Test Case 3: csm_allocation_create permission denied"

# Test Case 4: csm_allocation_create prolog error 255
Expand Down Expand Up @@ -267,7 +267,7 @@ ${CSM_PATH}/csm_allocation_update_history -a ${allocation_id} -c "test comment"
check_return_flag_value $? 25 "Test Case 39: csm_allocation_update_history before allocation deleted (i.e. added to history table)"

# Test Case 40: csm_allocation_delete permission denied
su -c "${CSM_PATH}/csm_allocation_delete -a ${allocation_id}" plundgr > ${TEMP_LOG} 2>&1
su -c "${CSM_PATH}/csm_allocation_delete -a ${allocation_id}" ${USER} > ${TEMP_LOG} 2>&1
check_return_flag_value $? 16 "Test Case 40: csm_allocation_delete permission denied"

# Test Case 40: csm_allocation_delete success
Expand Down
46 changes: 23 additions & 23 deletions csmtest/buckets/error_injection/infrastructure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# buckets/error_injection/infrastructure.sh
#
# © Copyright IBM Corporation 2015-2018. All Rights Reserved
# © Copyright IBM Corporation 2015-2021. All Rights Reserved
#
# This program is licensed under the terms of the Eclipse Public License
# v1.0 as published by the Eclipse Foundation and available at
Expand Down Expand Up @@ -31,7 +31,7 @@ LOG=${LOG_PATH}/buckets/error_injection/infrastructure.log
CSM_PATH=/opt/ibm/csm/bin
TEMP_LOG=${LOG_PATH}/buckets/error_injection/infrastructure_tmp.log
FLAG_LOG=${LOG_PATH}/buckets/error_injection/infrastructure_flags.log
UTILIY=$(nodels utility)
UTILIY=$(nodels ${UTILITY})

if [ -f "${BASH_SOURCE%/*}/../../include/functions.sh" ]
then
Expand Down Expand Up @@ -63,9 +63,9 @@ check_return_flag_value $? 0 "Test Case 1: Validating Health Check output"

# Test Case 2: Start utility daemon, health check, utility daemon filled in
echo "Test Case 2: Start utility daemon, health check, utility daemon filled in" >> ${LOG}
xdsh utility "systemctl start csmd-utility"
xdsh ${UTILITY} "systemctl start csmd-utility"
sleep 1
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 0 "Test Case 2: Utility is active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 2: Health Check"
Expand All @@ -74,16 +74,16 @@ check_return_flag_value $? 0 "Test Case 2: Validating Health Check output"

# Test Case 3: health check from utility, same info, local listed as utility
echo "Test Case 3: health check from utility, same info, local listed as utility" >> ${LOG}
xdsh utility "${CSM_PATH}/csm_infrastructure_health_check -v" > ${TEMP_LOG} 2>&1
xdsh ${UTILITY} "${CSM_PATH}/csm_infrastructure_health_check -v" > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 3: Health check from utility"
check_all_output "MASTER: ${MASTER}" "Aggregators:0" "Utility Nodes:1" "Local_daemon: UTILITY: ${UTILITY}"
check_return_flag_value $? 0 "Test Case 3: Validating Health Check output"

# Test Case 4: Stop utility daemon, health check, utility daemon unresponsive
echo "Test Case 4: Stop utility daemon, health check, utility daemon unresponsive" >> ${LOG}
xdsh utility "systemctl stop csmd-utility"
xdsh ${UTILITY} "systemctl stop csmd-utility"
sleep 1
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 1 "Test Case 4: Utility is not active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 4: Health Check"
Expand All @@ -92,9 +92,9 @@ check_return_flag_value $? 0 "Test Case 4: Validating Health Check output"

# Test Case 5: Start utility daemon, health check, utility daemon responsive and bounced=1
echo "Test Case 5: Start utility daemon, health check, utility daemon responsive and bounced=1" >> ${LOG}
xdsh utility "systemctl start csmd-utility"
xdsh ${UTILITY} "systemctl start csmd-utility"
sleep 1
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 0 "Test Case 5: Utility is active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 5: Health Check"
Expand All @@ -107,7 +107,7 @@ systemctl stop csmd-master
sleep 1
systemctl is-active csmd-master > /dev/null
check_return_exit $? 3 "Test Case 6: Master is inactive"
xdsh utility "cat /var/log/ibm/csm/csm_utility.log" > ${TEMP_LOG} 2>&1
xdsh ${UTILITY} "cat /var/log/ibm/csm/csm_utility.log" > ${TEMP_LOG} 2>&1
check_all_output "Transition from RUNMODE_CONFIGURED to: RUNMODE_DISCONNECTED"
check_return_flag_value $? 0 "Test Case 6: Utility transition to RUNMODE_DISCONNECTED"

Expand All @@ -117,7 +117,7 @@ systemctl start csmd-master
sleep 1
systemctl is-active csmd-master > /dev/null
check_return_exit $? 0 "Test Case 7: Master is active"
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 0 "Test Case 7: Utility is still active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 7: Health Check"
Expand Down Expand Up @@ -227,9 +227,9 @@ check_return_flag_value $? 0 "Test Case 15: Validating Health Check output"

# Test Case 16: Start utility daemon, health check, utility and aggregator daemon present
echo "Test Case 16: Start utility daemon, health check, utility and aggregator daemon present" >> ${LOG}
xdsh utility "systemctl start csmd-utility"
xdsh ${UTILITY} "systemctl start csmd-utility"
sleep 1
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 0 "Test Case 16: Utility is active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 16: Health Check"
Expand All @@ -249,9 +249,9 @@ check_return_flag_value $? 0 "Test Case 17: Validating Health Check output"

# Test Case 18: Stop utility daemon, health check, unresponsive aggregator and utility
echo "Test Case 18: Stop utility daemon, health check, unresponsive aggregator and utility" >> ${LOG}
xdsh utility "systemctl stop csmd-utility"
xdsh ${UTILITY} "systemctl stop csmd-utility"
sleep 1
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 1 "Test Case 18: Utility is not active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 18: Health Check"
Expand All @@ -271,9 +271,9 @@ check_return_flag_value $? 0 "Test Case 19: Validating Health Check output"

# Test Case 20: Start utility daemon, health check, responsive aggregator and utility and bounced=1 for both
echo "Test Case 20: Start utility daemon, health check, responsive aggregator and utility and bounced=1 for both" >> ${LOG}
xdsh utility "systemctl start csmd-utility"
xdsh ${UTILITY} "systemctl start csmd-utility"
sleep 1
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 0 "Test Case 20: Utility is active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 20: Health Check"
Expand All @@ -289,7 +289,7 @@ check_return_exit $? 3 "Test Case 21: Master is not active"
xdsh ${AGGREGATOR_A} "cat /var/log/ibm/csm/csm_aggregator.log" > ${TEMP_LOG} 2>&1
check_all_output "Transition from RUNMODE_CONFIGURED to: RUNMODE_DISCONNECTED"
check_return_flag_value $? 0 "Test Case 21: Aggregator transitions to RUNMODE_DISCONNECTED"
xdsh utility "cat /var/log/ibm/csm/csm_utility.log" > ${TEMP_LOG} 2>&1
xdsh ${UTILITY} "cat /var/log/ibm/csm/csm_utility.log" > ${TEMP_LOG} 2>&1
check_all_output "Transition from RUNMODE_CONFIGURED to: RUNMODE_DISCONNECTED"
check_return_flag_value $? 0 "Test Case 21: Utility transitions to RUNMODE_DISCONNECTED"

Expand All @@ -299,7 +299,7 @@ systemctl start csmd-master
sleep 1
systemctl is-active csmd-master > /dev/null
check_return_exit $? 0 "Test Case 22: Master is active"
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 0 "Test Case 22: Utility is active"
xdsh ${AGGREGATOR_A} "systemctl is-active csmd-aggregator" > /dev/null
check_return_exit $? 0 "Test Case 22: Aggregator is active"
Expand Down Expand Up @@ -405,9 +405,9 @@ check_return_flag_value $? 0 "Test Case 29: Validating Health Check output"

# Test Case 30: Start utility daemon, health check, utility and aggregator daemon present
echo "Test Case 30: Start utility daemon, health check, utility and aggregator daemon present" >> ${LOG}
xdsh utility "systemctl start csmd-utility"
xdsh ${UTILITY} "systemctl start csmd-utility"
sleep 1
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 0 "Test Case 30: Utility is active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 30: Health Check"
Expand Down Expand Up @@ -441,9 +441,9 @@ check_return_flag_value $? 0 "Test Case 32: Validating csm_ras_event_query outpu

# Test Case 33: Stop utility daemon, health check, utility disconnected
echo "Test Case 33: Stop utility daemon, health check, utility disconnected" >> ${LOG}
xdsh utility "systemctl stop csmd-utility"
xdsh ${UTILITY} "systemctl stop csmd-utility"
sleep 1
xdsh utility "systemctl is-active csmd-utility" > /dev/null
xdsh ${UTILITY} "systemctl is-active csmd-utility" > /dev/null
check_return_exit $? 1 "Test Case 33: Utility is not active"
${CSM_PATH}/csm_infrastructure_health_check -v > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 33: Health Check"
Expand Down
6 changes: 3 additions & 3 deletions csmtest/buckets/error_injection/versioning.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# buckets/error_injection/versioning.sh
#
# © Copyright IBM Corporation 2015-2018. All Rights Reserved
# © Copyright IBM Corporation 2015-2021. All Rights Reserved
#
# This program is licensed under the terms of the Eclipse Public License
# v1.0 as published by the Eclipse Foundation and available at
Expand Down Expand Up @@ -70,7 +70,7 @@ systemctl start csmd-master > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Starting Master"
xdsh ${AGGREGATOR_A} "systemctl start csmd-aggregator" > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Starting Aggregator"
xdsh utility "systemctl start csmd-utility" > ${TEMP_LOG} 2>&1
xdsh ${UTILITY} "systemctl start csmd-utility" > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Starting Utility"
xdsh ${SINGLE_COMPUTE} "systemctl start csmd-compute" > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Starting Compute"
Expand All @@ -79,7 +79,7 @@ check_return_exit $? 0 "Starting Compute"
systemctl status csmd-master > ${TEMP_LOG} 2>&1
check_return_exit $? 0 "Test Case 1: Check Master status"

sleep 5
sleep 10
# Test Case 2: Check Compute is not active
xdsh ${SINGLE_COMPUTE} "systemctl is-active csmd-compute" > ${TEMP_LOG} 2>&1
check_return_flag_value $? 1 "Test Case 2: Check Compute is not active"
Expand Down
8 changes: 8 additions & 0 deletions csmtest/config.template
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export RPM_DIR=
export BIG_DATA_DIR=
export SQL_DIR=
export SSL_KEY=
export CAST_ELASTIC=

# Node Types
export XCATMN=
Expand All @@ -22,8 +23,15 @@ export AGGREGATOR_B=
export COMPUTE_NODES=
export SINGLE_COMPUTE=
export UFM_ADDR=
export XCATMN_IP=
export LOGSTASH=

# Node Types
export SERVICE=
export COMPUTE_B=
export COMPUTE_A=
export UTILITY=

# Users
export USER=
export SECOND_USER=
Expand Down
13 changes: 11 additions & 2 deletions csmtest/include/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
#
#================================================================================

# Try to source the configuration file to get global configuration variables
if [ -f "${BASH_SOURCE%/*}/../csm_test.cfg" ]
then
. "${BASH_SOURCE%/*}/../csm_test.cfg"
else
echo "Could not find csm_test.cfg file expected at "${BASH_SOURCE%/*}/../csm_test.cfg", exitting."
exit 1
fi

# ----------------------------------------------------------------
# LogMsg Date/Time Function
# Functionality: This helps track the date/timing of each bucket
Expand Down Expand Up @@ -48,8 +57,8 @@ check_all_output () {
shutdown_daemons () {
systemctl stop csmd-master
xdsh ${AGGREGATOR_A} "systemctl stop csmd-aggregator"
xdsh utility "systemctl stop csmd-utility"
xdsh csm_comp "systemctl stop csmd-compute"
xdsh ${UTILITY} "systemctl stop csmd-utility"
xdsh ${COMPUTE_NODES} "systemctl stop csmd-compute"
echo "y" | /opt/ibm/csm/db/csm_db_script.sh -d csmdb
/opt/ibm/csm/db/csm_db_script.sh -n csmdb
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
#
#================================================================================

if [ -f "${BASH_SOURCE%/*}/../../csm_test.cfg" ]
then
. "${BASH_SOURCE%/*}/../../csm_test.cfg"
else
echo "Could not find csm_test.cfg file expected at "${BASH_SOURCE%/*}/../csm_test.cfg", exitting."
exit 1
fi

#---------------------------------------
# Output formatter
#---------------------------------------
Expand Down Expand Up @@ -212,7 +220,7 @@ fi
# Check to ensure the return count is not -gt 1.
# Find the pattern in the test.properties file to replace.
#-------------------------------------------------------------
smt_set=`xdsh $COMPUTE_NODES "/usr/sbin/ppc64_cpu --smt | cut -d '=' -f2" | xcoll | grep -v csm_comp | grep -v ==================================== | grep -v "No route to host" | grep -v compute | awk 'NR>1 {print last} {last=$0}'`
smt_set=`xdsh $COMPUTE_NODES "/usr/sbin/ppc64_cpu --smt | cut -d '=' -f2" | xcoll | grep -v $COMPUTE_NODES | grep -v ==================================== | grep -v "No route to host" | grep -v compute | awk 'NR>1 {print last} {last=$0}'`
wc_smt_set=$(echo -n $smt_set | wc -w)
smt_tp_file=`grep -A 3 "\[tests.chk-smt\\b" $ORIG_FILE | awk 'FNR == 4 {print}' | awk '{ print $3}'`

Expand Down
Loading

0 comments on commit c6d4f28

Please sign in to comment.