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

Add configuration variables for control plane testing during update. #2618

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions roles/update/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Role to run update
* `cifmw_update_ping_loss_second` : (Integer) Number of seconds that the ping test is allowed to fail. Default to `0`. Note that 1 packet loss is always accepted to avoid false positive.
* `cifmw_update_ping_loss_percent` : (Integer) Maximum percentage of ping loss accepted. Default to `0`. Only relevant when `cifmw_update_ping_loss_second` is not 0.
* `cifmw_update_control_plane_check`: (Boolean) Activate a continuous control plane testing. Default to `False`
* `cifmw_update_ctl_plane_max_cons_fail`: (Integer) For continuous control plane testing, maximum number of consecutive failures allowed. Default to 2.
* `cifmw_update_ctl_plane_max_fail`: (Integer) For continuous control plane testing, maximum number of failures allowed. Default to 3.
* `cifmw_update_ctl_plane_max_tries`: (Integer) For continuous control plane testing, number of retries allowed to stop and destroy the last vm created. Each retry is 5 seconds apart. Default to 84, so 7 minutes.
* `cifmw_update_openstackclient_pod_timeout`: (Integer) Maximum number of seconds to wait for the openstackclient Pod to be available during control plane testing, as it is being restarted during update. Default to `10` seconds.

## Examples
3 changes: 3 additions & 0 deletions roles/update/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ cifmw_update_ping_loss_percent: 0
# Control plane Testing
cifmw_update_control_plane_check: false
cifmw_update_openstackclient_pod_timeout: 10 # in seconds.
cifmw_update_ctl_plane_max_cons_fail: 2
cifmw_update_ctl_plane_max_fail: 3
cifmw_update_ctl_plane_max_tries: 84
2 changes: 1 addition & 1 deletion roles/update/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@
when:
- cifmw_update_control_plane_check | bool
- not cifmw_update_run_dryrun | bool
ansible.builtin.shell: |
ansible.builtin.command: |
{{ cifmw_update_artifacts_basedir }}/control_plane_test_stop.sh
6 changes: 3 additions & 3 deletions roles/update/templates/control_plane_test_stop.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
# Get the pid, kill it and wait for the end of the last run.
set -eu

MAX_CONS_FAIL=${1:-2}
MAX_FAIL=${2:-3}
MAX_CONS_FAIL=${1:-{{ cifmw_update_ctl_plane_max_cons_fail }}}
MAX_FAIL=${2:-{{ cifmw_update_ctl_plane_max_fail }}}
BASE_DIR="${3:-{{ cifmw_update_artifacts_basedir }}}"
STOP_MAX_TRIES=${4:-60} # 5 seconds x MAX_TRIES = 5 min by default
STOP_MAX_TRIES=${4:-{{ cifmw_update_ctl_plane_max_tries }}} # times 5 seconds

pid_file="${BASE_DIR}/control-plane-test.pid"

Expand Down
Loading