Skip to content
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

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Merging dev into main. #4

merged 2 commits into from
Feb 19, 2024

Conversation

ThatStasGuy
Copy link
Contributor

Merging changes proposed offline into main.

Stanislav Uschakow added 2 commits February 19, 2024 13:25
* Improving & streamlining tests
* Adding some more sanity checks validating restarted services
@@ -28,12 +29,22 @@ echo -e "=========================== ${YELLOW}$TEST_NAME${COLOR_OFF} started "==

. $UUT

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
ShellCheck can't follow non-constant source. Use a directive to specify location. SC1090

# 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=()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
SERVICES appears unused. Verify use (or export if used externally). SC2034

# reset_test_environment resets them so every test starts from a clean state
reset_test_environment() {
SERVICES=()
BLOCKED_SERVICES=()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
BLOCKED_SERVICES appears unused. Verify use (or export if used externally). SC2034

reset_test_environment() {
SERVICES=()
BLOCKED_SERVICES=()
PRE_RESTART_HEALTHY="0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
PRE_RESTART_HEALTHY appears unused. Verify use (or export if used externally). SC2034

SERVICES=()
BLOCKED_SERVICES=()
PRE_RESTART_HEALTHY="0"
POST_RESTART_HEALTHY="0"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
POST_RESTART_HEALTHY appears unused. Verify use (or export if used externally). SC2034

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Command appears to be unreachable. Check usage (or ignore if invoked indirectly). SC2317

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Command appears to be unreachable. Check usage (or ignore if invoked indirectly). SC2317

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Command appears to be unreachable. Check usage (or ignore if invoked indirectly). SC2317

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"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Command appears to be unreachable. Check usage (or ignore if invoked indirectly). SC2317

if [[ $retval == 2 && -f "$(pwd)/reboot-hint-marker" ]]; then
PASSED "$DESCRIPTION"
else
FAILED "$DESCRIPTION (error: $retval)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Command appears to be unreachable. Check usage (or ignore if invoked indirectly). SC2317

local all_services=($($NEEDS_RESTARTING_COMMAND -s | xargs))

# shellcheck disable=SC2048
BLOCKED_SERVICES=("$(sed "s/#.*//g" ${DENYLISTS[*]})")

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 🐶

Suggested change
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}

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 🐶

Suggested change
$SYSCTL_COMMAND is-active ${SERVICE}
$SYSCTL_COMMAND is-active "${SERVICE}"

@ThatStasGuy ThatStasGuy merged commit 7565d8d into main Feb 19, 2024
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant