Test apt upgrade before all sub-tests
This commit is contained in:
parent
7c2edce71d
commit
62128c89bb
|
@ -235,56 +235,56 @@ main() { # {{{
|
|||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If SGE used slots is more than 75% of total slots AND {{{
|
||||
## APT package upgrade is available
|
||||
### Create a temp file
|
||||
### Disable SGE queue
|
||||
is_sge_slots_more_than_percentage "75" \
|
||||
&& is_apt_upgrade_present \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& sh "${sge_disable_host_queue_script}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If pending upgrade since 3~4 days AND {{{
|
||||
## APT package upgrade is available
|
||||
### Create a temp file
|
||||
### Disable SGE queue
|
||||
is_pending_upgrade_more_than_days "3" \
|
||||
&& is_apt_upgrade_present \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& sh "${sge_disable_host_queue_script}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If SGE used slots is NULL AND {{{
|
||||
## APT package upgrade is available
|
||||
### Create a temp file
|
||||
### Disable SGE queue
|
||||
is_sge_slots_empty \
|
||||
&& is_apt_upgrade_present \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& sh "${sge_disable_host_queue_script}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If pending job list is empty AND {{{
|
||||
## APT package upgrade is available
|
||||
### Create a temp file
|
||||
### Disable SGE queue
|
||||
is_pending_job_empty \
|
||||
&& is_apt_upgrade_present \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& sh "${sge_disable_host_queue_script}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## After all if APT package upgrade is available {{{
|
||||
### Just add content to a temp file
|
||||
## If APT package upgrade(s) is available AND
|
||||
is_apt_upgrade_present \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
&& {
|
||||
## If SGE used slots is more than 75% of total slots {{{
|
||||
## APT package upgrade is available
|
||||
### Create a temp file
|
||||
### Disable SGE queue
|
||||
is_sge_slots_more_than_percentage "75" \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& sh "${sge_disable_host_queue_script}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If pending upgrade since 3~4 days {{{
|
||||
## APT package upgrade is available
|
||||
### Create a temp file
|
||||
### Disable SGE queue
|
||||
is_pending_upgrade_more_than_days "3" \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& sh "${sge_disable_host_queue_script}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If SGE used slots is NULL {{{
|
||||
## APT package upgrade is available
|
||||
### Create a temp file
|
||||
### Disable SGE queue
|
||||
is_sge_slots_empty \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& sh "${sge_disable_host_queue_script}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## If pending job list is empty {{{
|
||||
## APT package upgrade is available
|
||||
### Create a temp file
|
||||
### Disable SGE queue
|
||||
is_pending_job_empty \
|
||||
&& touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& sh "${sge_disable_host_queue_script}" \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
## After all just add content to a temp file {{{
|
||||
touch "${APT_TMP_FILE}" && echo "APT upgrade is available." >> "${APT_TMP_FILE}" \
|
||||
&& debug_message "main − Add content to temp file for pending upgrade(s)." \
|
||||
&& exit 0
|
||||
## }}}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
# }}}
|
||||
|
|
Loading…
Reference in New Issue