#!/bin/bash +ex
# Find the right error message in the output log and write the grep result to a file
grep "Error calling advance_wp2_wp3" run_scripts/advance_wp2_wp3_bad_wp2 > output
# Check if 'output' file is empty (-s is TRUE is the file is not empty)
if [ -s output ]; then
echo "Error message 'Error calling advance_wp2_wp3' found in log"
echo "CAM CLUBB error handling test for advance_wp2_wp3 was SUCCESSFUL"
rm output
# Trigger SUCCESS state for Jenkins (this is for clarity, since exit code 0 is default)
exit 0
else
echo "Error message 'Error calling advance_wp2_wp3' NOT found in log"
echo "CAM CLUBB error handling test for advance_wp2_wp3 FAILED"
rm output
# Trigger FAIL state for Jenkins
exit 1
fi
#!/bin/bash +ex
# Find the right error message in the output log and write the grep result to a file
grep "Error calling advance_xm_wpxp" run_scripts/advance_xm_wpxp_bad_wp2 > output
# Check if 'output' file is empty (-s is TRUE is the file is not empty)
if [ -s output ]; then
echo "Error message 'Error calling advance_xm_wpxp' found in log"
echo "CAM CLUBB error handling test for advance_xm_wpxp was SUCCESSFUL"
rm output
# Trigger SUCCESS state for Jenkins (this is for clarity, since exit code 0 is default)
exit 0
else
echo "Error message 'Error calling advance_xm_wpxp' NOT found in log"
echo "CAM CLUBB error handling test for advance_xm_wpxp FAILED"
rm output
# Trigger FAIL state for Jenkins
exit 1
fi