-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for disabling specific tests in scenarios
This commit adds several environment variables that allow more granular control over which tests are run by an integration test scenario. Signed-off-by: Christopher A. Snapp <[email protected]>
- Loading branch information
1 parent
492aea3
commit 32baadf
Showing
36 changed files
with
1,320 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
terraform/aws/scenarios/omnibus-chef-backend/files/test_chef_backend-demotion.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
set -evx | ||
|
||
if [ "${ENABLE_CHEF_BACKEND_DEMOTION:-true}" = 'true' ]; then | ||
ret=0 | ||
|
||
echo -e '\nBEGIN TEST CHEF BACKEND DEMOTION\n' | ||
|
||
echo 'Original Chef Backend leader status' | ||
sudo chef-backend-ctl cluster-status | tee /tmp/chef-backend-status.orig | ||
|
||
echo 'Demoting current leader' | ||
sudo chef-backend-ctl demote >/dev/null 2>&1 | ||
sleep 30 | ||
|
||
echo 'Current Chef Backend leader status' | ||
sudo chef-backend-ctl cluster-status | tee /tmp/chef-backend-status.cur | ||
|
||
leaders=$(sudo awk '/leader.*leader/{print $3}' /tmp/chef-backend-status.{orig,cur} | sort -u | wc -l) | ||
|
||
if [[ $leaders -ne 2 ]]; then | ||
ret=1 | ||
|
||
echo 'ERROR: Leadership transfer was not successful' | ||
|
||
sudo diff /tmp/chef-backend-status.{orig,cur} | ||
fi | ||
|
||
echo -e '\nEND TEST CHEF BACKEND DEMOTION\n' | ||
|
||
exit $ret | ||
else | ||
echo -e '\n**SKIP** TEST CHEF BACKEND DEMOTION **SKIP**\n' | ||
fi |
Oops, something went wrong.