-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merging dev into main. #4
Conversation
* Improving & streamlining tests * Adding some more sanity checks validating restarted services
@@ -28,12 +29,22 @@ echo -e "=========================== ${YELLOW}$TEST_NAME${COLOR_OFF} started "== | |||
|
|||
. $UUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# We're testing here sourced bash scripts, global variables keep their values in between tests. | ||
# reset_test_environment resets them so every test starts from a clean state | ||
reset_test_environment() { | ||
SERVICES=() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# reset_test_environment resets them so every test starts from a clean state | ||
reset_test_environment() { | ||
SERVICES=() | ||
BLOCKED_SERVICES=() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reset_test_environment() { | ||
SERVICES=() | ||
BLOCKED_SERVICES=() | ||
PRE_RESTART_HEALTHY="0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SERVICES=() | ||
BLOCKED_SERVICES=() | ||
PRE_RESTART_HEALTHY="0" | ||
POST_RESTART_HEALTHY="0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SYS_RESTART_FAILED=0 count_pre_restart_health | ||
OS_VERSION="2023" NEED_RESTART_1=1 SYS_RESTART_FAILED=1 generate_reboot_hint_marker || retval=$? | ||
|
||
if [[ $retval == 2 && -f "$(pwd)/reboot-hint-marker" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SYS_RESTART_FAILED=0 count_pre_restart_health | ||
OS_VERSION="2023" NEED_RESTART_1=1 SYS_RESTART_FAILED=1 generate_reboot_hint_marker || retval=$? | ||
|
||
if [[ $retval == 2 && -f "$(pwd)/reboot-hint-marker" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SYS_RESTART_FAILED=0 count_pre_restart_health | ||
OS_VERSION="2023" NEED_RESTART_1=1 SYS_RESTART_FAILED=1 generate_reboot_hint_marker || retval=$? | ||
|
||
if [[ $retval == 2 && -f "$(pwd)/reboot-hint-marker" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OS_VERSION="2023" NEED_RESTART_1=1 SYS_RESTART_FAILED=1 generate_reboot_hint_marker || retval=$? | ||
|
||
if [[ $retval == 2 && -f "$(pwd)/reboot-hint-marker" ]]; then | ||
PASSED "$DESCRIPTION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if [[ $retval == 2 && -f "$(pwd)/reboot-hint-marker" ]]; then | ||
PASSED "$DESCRIPTION" | ||
else | ||
FAILED "$DESCRIPTION (error: $retval)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
local all_services=($($NEEDS_RESTARTING_COMMAND -s | xargs)) | ||
|
||
# shellcheck disable=SC2048 | ||
BLOCKED_SERVICES=("$(sed "s/#.*//g" ${DENYLISTS[*]})") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shellcheck (suggestion)] reported by reviewdog 🐶
BLOCKED_SERVICES=("$(sed "s/#.*//g" ${DENYLISTS[*]})") | |
BLOCKED_SERVICES=("$(sed "s/#.*//g" "${DENYLISTS[*]}")") |
if [[ "$PRE_RESTART_HEALTHY" != "$POST_RESTART_HEALTHY" ]]; then | ||
S=() | ||
for SERVICE in "${SERVICES[@]}"; do | ||
$SYSCTL_COMMAND is-active ${SERVICE} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[shellcheck (suggestion)] reported by reviewdog 🐶
$SYSCTL_COMMAND is-active ${SERVICE} | |
$SYSCTL_COMMAND is-active "${SERVICE}" |
Merging changes proposed offline into main.