Skip to content

Commit c92e933

Browse files
committed
Finished integration test.
1 parent 80bf661 commit c92e933

7 files changed

+301
-152
lines changed

config.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@
4949
# than 24 hours for the encrypt key.
5050
readonly KEY_ROTATION='0 0,12 * * *'
5151

52-
# The nginx restart interval as cron mask.
52+
# The nginx rotation interval as cron mask.
5353
#
5454
# This should be after the keys have been rotated (see $KEY_ROTATION). Note
55-
# that keys are only in-use after nginx has been restarted. This is very
56-
# important if you're syncing the keys within a cluster.
57-
readonly SERVER_RELOAD='30 0,12 * * *'
55+
# that keys are only in-use after nginx has read them. This is very important if
56+
# you're syncing the keys within a cluster.
57+
readonly SERVER_ROTATION='30 0,12 * * *'
5858

5959
# Absolute path to the web server system startup program.
6060
readonly SERVER_INIT_PATH='/etc/init.d/nginx'
@@ -165,11 +165,11 @@ change_owner_and_make_scripts_executable()
165165
# 1 - Not available
166166
check_filesystem()
167167
{
168-
if grep -qs ramfs "${1}"
168+
if grep -q ramfs "${1}"
169169
then
170170
FILESYSTEM='ramfs'
171171
ok "Using ${YELLOW}ramfs${NORMAL}"
172-
elif grep -qs tmpfs "${1}"
172+
elif grep -q tmpfs "${1}"
173173
then
174174
FILESYSTEM='tmpfs'
175175
warn "Using ${YELLOW}tmpfs${NORMAL} which means that your keys \
@@ -289,7 +289,7 @@ least version ${YELLOW}${2}${NORMAL}"
289289
#
290290
# GLOBALS:
291291
# $KEY_ROTATION - The key rotation cron mask.
292-
# $SERVER_RELOAD - The server reload cron mask.
292+
# $SERVER_ROTATION - The server rotation cron mask.
293293
# $SERVER - The name of the server daemon.
294294
# ARGS:
295295
# $1 - Absolute path to the cron file.
@@ -308,7 +308,7 @@ create_cron_job()
308308
# ------------------------------------------------------------------------------
309309
310310
${KEY_ROTATION} sh -- '${2}' ${3}
311-
${SERVER_RELOAD} service ${SERVER} reload
311+
${SERVER_ROTATION} service ${SERVER} reload
312312
313313
EOT
314314
ok "Created cron rotation job ${YELLOW}${1}${NORMAL}"
@@ -576,7 +576,7 @@ uninstall()
576576
[ "${VERBOSE}" = true ] && printf -- 'Uninstalling ...\n'
577577

578578
INIT_NAME="${INIT_PATH##*/}"
579-
if grep -qs -- " \$${INIT_NAME}" "${SERVER_INIT_PATH}"
579+
if grep -q -- " \$${INIT_NAME}" "${SERVER_INIT_PATH}"
580580
then
581581
sed -i -- "s/ \$${INIT_NAME}//g" "${SERVER_INIT_PATH}"
582582
ok "Removed system startup dependency in ${YELLOW}${SERVER_INIT_PATH}${NORMAL}"
@@ -603,15 +603,15 @@ uninstall()
603603
ok "Cron program ${YELLOW}${CRON_PATH}${NORMAL} already removed"
604604
fi
605605

606-
if grep -qs -- "${FSTAB_COMMENT}" /etc/fstab
606+
if grep -q -- "${FSTAB_COMMENT}" /etc/fstab
607607
then
608608
sed -i -- "/${FSTAB_COMMENT}/,+1 d" '/etc/fstab'
609609
ok "Removed ${YELLOW}/etc/fstab${NORMAL} entry"
610610
else
611611
ok "No entry found in ${YELLOW}/etc/fstab${NORMAL}"
612612
fi
613613

614-
if grep -qs -- "${KEY_PATH}" /proc/mounts
614+
if grep -q -- "${KEY_PATH}" /proc/mounts
615615
then
616616
umount -fl -- "${KEY_PATH}"
617617
ok "Unmounted ${YELLOW}${KEY_PATH}${NORMAL}"
@@ -631,14 +631,14 @@ uninstall()
631631
return 0
632632
}
633633

634-
# Display usage text.
634+
# Print usage text.
635635
#
636636
# GLOBAL:
637637
# $ARGUMENTS - Program argument description.
638638
# $DESCRIPTION - Description what the program does.
639639
# RETURN:
640-
# 0 - If usage was printed to `stdout`.
641-
# 1 - If printing failed.
640+
# 0 - Printing successful.
641+
# 1 - Printing failed.
642642
usage()
643643
{
644644
cat << EOT

generator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ fi
6060
super_user
6161

6262
# Generate keys for all passed servers.
63-
generate_keys ${@}
63+
generate_keys "${@}"
6464

6565
exit 0

makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ GROUP := ${USER}
6363
all:
6464
clear
6565
make test
66-
make integration
66+
make nginx_integration_test
6767
-make install
6868
make clean
6969

@@ -80,8 +80,9 @@ install:
8080
sh install.sh -v $(SERVER_NAMES)
8181

8282
# Execute the integration test.
83-
integration:
84-
sh test/integration_test.sh
83+
nginx_integration_test:
84+
rm -f test/nginx.log
85+
sh test/nginx_integration_test.sh
8586

8687
# Rotate existing TLS session ticket keys for defined servers.
8788
rotate:

test/integration_test.sh

Lines changed: 0 additions & 133 deletions
This file was deleted.

0 commit comments

Comments
 (0)