|
|
|
@ -2,7 +2,7 @@
|
|
|
|
|
|
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
|
|
declare -g EXCEPTED_DOC_BASE_PATH='/usr/share/nginx/html/octocat/hello-world'
|
|
|
|
|
declare -g EXPECTED_DOC_BASE_PATH='/usr/share/nginx/html/octocat/hello-world'
|
|
|
|
|
declare -g VERBOSE='false'
|
|
|
|
|
|
|
|
|
|
root_dir=$(readlink -f $(dirname $(realpath "$0"))/..)
|
|
|
|
@ -51,7 +51,7 @@ cleanup() {
|
|
|
|
|
|
|
|
|
|
assert_file_exists() {
|
|
|
|
|
# Assert that the given file exists in the codefirst-nginx volume.
|
|
|
|
|
if check_on_deployed test -f "$EXCEPTED_DOC_BASE_PATH/$1"; then
|
|
|
|
|
if check_on_deployed test -f "$EXPECTED_DOC_BASE_PATH/$1"; then
|
|
|
|
|
echo -e "$1 exists: \e[32mOK\e[0m"
|
|
|
|
|
else
|
|
|
|
|
echo -e "$1 does not exist: \e[31mFAILED\e[0m"
|
|
|
|
@ -63,12 +63,12 @@ assert_file_exists() {
|
|
|
|
|
|
|
|
|
|
assert_file_contains() {
|
|
|
|
|
# Assert that the given file contains the given string.
|
|
|
|
|
if check_on_deployed grep -q $2 "$EXCEPTED_DOC_BASE_PATH/$1"; then
|
|
|
|
|
if check_on_deployed grep -q $2 "$EXPECTED_DOC_BASE_PATH/$1"; then
|
|
|
|
|
echo -e "$1 exists and matches content: \e[32mOK\e[0m"
|
|
|
|
|
elif check_on_deployed test -f "$EXCEPTED_DOC_BASE_PATH/$1"; then
|
|
|
|
|
elif check_on_deployed test -f "$EXPECTED_DOC_BASE_PATH/$1"; then
|
|
|
|
|
echo -e "$1 exists but does not match content: \e[31mFAILED\e[0m"
|
|
|
|
|
if [[ "$VERBOSE" == 'true' ]]; then
|
|
|
|
|
check_on_deployed cat "$EXCEPTED_DOC_BASE_PATH/$1"
|
|
|
|
|
check_on_deployed cat "$EXPECTED_DOC_BASE_PATH/$1"
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
echo -e "$1 does not exist: \e[31mFAILED\e[0m"
|
|
|
|
|