Test apt upgrade before all sub-tests

This commit is contained in:
Jeremy Gardais 2020-09-25 15:08:51 +02:00
parent 7c2edce71d
commit 62128c89bb
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 49 additions and 49 deletions

View File

@ -235,58 +235,58 @@ main() { # {{{
&& exit 0 && exit 0
## }}} ## }}}
## If SGE used slots is more than 75% of total slots AND {{{ ## If APT package upgrade(s) is available AND
is_apt_upgrade_present \
&& {
## If SGE used slots is more than 75% of total slots {{{
## APT package upgrade is available ## APT package upgrade is available
### Create a temp file ### Create a temp file
### Disable SGE queue ### Disable SGE queue
is_sge_slots_more_than_percentage "75" \ is_sge_slots_more_than_percentage "75" \
&& is_apt_upgrade_present \
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \ && touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
&& sh "${sge_disable_host_queue_script}" \ && sh "${sge_disable_host_queue_script}" \
&& exit 0 && exit 0
## }}} ## }}}
## If pending upgrade since 3~4 days AND {{{ ## If pending upgrade since 3~4 days {{{
## APT package upgrade is available ## APT package upgrade is available
### Create a temp file ### Create a temp file
### Disable SGE queue ### Disable SGE queue
is_pending_upgrade_more_than_days "3" \ is_pending_upgrade_more_than_days "3" \
&& is_apt_upgrade_present \
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \ && touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
&& sh "${sge_disable_host_queue_script}" \ && sh "${sge_disable_host_queue_script}" \
&& exit 0 && exit 0
## }}} ## }}}
## If SGE used slots is NULL AND {{{ ## If SGE used slots is NULL {{{
## APT package upgrade is available ## APT package upgrade is available
### Create a temp file ### Create a temp file
### Disable SGE queue ### Disable SGE queue
is_sge_slots_empty \ is_sge_slots_empty \
&& is_apt_upgrade_present \
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \ && touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
&& sh "${sge_disable_host_queue_script}" \ && sh "${sge_disable_host_queue_script}" \
&& exit 0 && exit 0
## }}} ## }}}
## If pending job list is empty AND {{{ ## If pending job list is empty {{{
## APT package upgrade is available ## APT package upgrade is available
### Create a temp file ### Create a temp file
### Disable SGE queue ### Disable SGE queue
is_pending_job_empty \ is_pending_job_empty \
&& is_apt_upgrade_present \
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \ && touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
&& sh "${sge_disable_host_queue_script}" \ && sh "${sge_disable_host_queue_script}" \
&& exit 0 && exit 0
## }}} ## }}}
## After all if APT package upgrade is available {{{ ## After all just add content to a temp file {{{
### Just add content to a temp file touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
is_apt_upgrade_present \ && debug_message "main Add content to temp file for pending upgrade(s)." \
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
&& exit 0 && exit 0
## }}} ## }}}
} }
}
# }}} # }}}
# Manage arguments # {{{ # Manage arguments # {{{