-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The reinforced checking states logic
The checking states logic is now based on scores. Add checking states scripts (See the README) Add the checking states logic one more before Up the Containers.
- Loading branch information
1 parent
986668a
commit 96be344
Showing
8 changed files
with
250 additions
and
198 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
sed -i -e "s/\r$//g" $(basename $0) | ||
set -e | ||
|
||
git config apply.whitespace nowarn | ||
git config core.filemode false | ||
|
||
source ./util.sh | ||
|
||
cache_global_vars | ||
cache_all_states |
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
51 changes: 51 additions & 0 deletions
51
tests/spring-sample-h-auth/run-and-make-consul-pointing-error-and-recovered.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,51 @@ | ||
#!/bin/bash | ||
sed -i -e "s/\r$//g" $(basename $0) | ||
set -eu | ||
|
||
cd ../../ | ||
|
||
sudo chmod a+x *.sh | ||
|
||
echo "[NOTICE] Substituting CRLF with LF to prevent possible CRLF errors..." | ||
bash prevent-crlf.sh | ||
git config apply.whitespace nowarn | ||
git config core.filemode false | ||
|
||
container=$(docker ps --format '{{.Names}}' | grep "spring-sample-h-auth-[bg]") | ||
if [ -z "$container" ]; then | ||
echo "[NOTICE] There is NO spring-sample-h-auth container, now we will build it." | ||
cp -f .env.java.real .env | ||
sudo bash run.sh | ||
else | ||
echo "[NOTICE] $container exists." | ||
fi | ||
|
||
sleep 3 | ||
source ./util.sh | ||
|
||
cache_global_vars | ||
|
||
consul_pointing=$(docker exec ${project_name}-nginx curl ${consul_key_value_store}?raw 2>/dev/null || echo "failed") | ||
the_opposite_of_consul_pointing='' | ||
if [[ ${consul_pointing} == 'blue' ]]; then | ||
the_opposite_of_consul_pointing='green' | ||
else | ||
the_opposite_of_consul_pointing='blue' | ||
fi | ||
|
||
echo "[TEST][DEBUG] the_opposite_of_consul_pointing : ${the_opposite_of_consul_pointing}" | ||
|
||
echo "[TEST][NOTICE] To make a Nginx error, get consul_pointing to the wrong(=NOT running) container" | ||
bash emergency-nginx-down-and-up.sh ${the_opposite_of_consul_pointing} || echo "" | ||
#echo "[TEST][NOTICE] Run 'emergency-nginx-down-and-up.sh'" | ||
#bash emergency-nginx-down-and-up.sh | ||
|
||
echo "[TEST][NOTICE] Run check_availability_out_of_container" | ||
cache_global_vars | ||
re=$(check_availability_out_of_container | tail -n 1); | ||
|
||
if [[ ${re} != 'true' ]]; then | ||
echo "[TEST][NOTICE] : FAILURE" | ||
else | ||
echo "[TEST][NOTICE] : SUCCESS" | ||
fi |
Oops, something went wrong.