Skip to content

Commit

Permalink
Merge pull request os-migrate#680 from matbu/e2e/16/18
Browse files Browse the repository at this point in the history
dev: Improve stability for end to end CI testing
  • Loading branch information
davidjpeacock authored Jul 9, 2024
2 parents 298bc29 + 32190d8 commit c7cac32
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 0 deletions.
58 changes: 58 additions & 0 deletions os_migrate/playbooks/deploy_conversion_hosts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
tasks_from: link_prepare.yml
when: os_migrate_link_conversion_hosts|default(true)|bool

- name: pause to let sshd start on the conversion hosts
ansible.builtin.pause:
minutes: 2

- hosts: os_migrate_conv_src
environment:
OS_CLIENT_CONFIG_FILE: "{{ os_migrate_clouds_path|default(os_migrate_data_dir ~ '/clouds.yaml') }}"
Expand Down Expand Up @@ -127,6 +131,60 @@
os_migrate_conversion_host_pre_content_hook: "{{ os_migrate_dst_conversion_host_pre_content_hook|default(false) }}"
os_migrate_conversion_host_post_content_hook: "{{ os_migrate_dst_conversion_host_post_content_hook|default(false) }}"

- hosts: migrator
environment:
OS_CLIENT_CONFIG_FILE: "{{ os_migrate_clouds_path|default(os_migrate_data_dir ~ '/clouds.yaml') }}"
any_errors_fatal: true
tasks:
- name: reboot the src conversion host if required
ansible.builtin.include_role:
name: os_migrate.os_migrate.conversion_host
tasks_from: reboot.yml
vars:
os_migrate_conversion_host_name: "{{ os_migrate_src_conversion_host_name }}"
os_migrate_conversion_cloud: src
os_migrate_conversion_validate_certs: "{{ os_migrate_src_validate_certs|default(omit) }}"
os_migrate_conversion_ca_cert: "{{ os_migrate_src_ca_cert|default(omit) }}"
os_migrate_conversion_client_cert: "{{ os_migrate_src_client_cert|default(omit) }}"
os_migrate_conversion_client_key: "{{ os_migrate_src_client_key|default(omit) }}"
when: os_migrate_reboot_conversion_hosts|default(false)|bool

- name: wait for src conversion host reachability
ansible.builtin.wait_for:
port: 22
host: "{{ hostvars['os_migrate_conv_src']['ansible_ssh_host'] }}"
search_regex: OpenSSH
sleep: 5
timeout: 600
when: os_migrate_reboot_conversion_hosts|default(false)|bool

- hosts: migrator
environment:
OS_CLIENT_CONFIG_FILE: "{{ os_migrate_clouds_path|default(os_migrate_data_dir ~ '/clouds.yaml') }}"
any_errors_fatal: true
tasks:
- name: reboot the dst conversion host if required
ansible.builtin.include_role:
name: os_migrate.os_migrate.conversion_host
tasks_from: reboot.yml
vars:
os_migrate_conversion_host_name: "{{ os_migrate_dst_conversion_host_name }}"
os_migrate_conversion_cloud: dst
os_migrate_conversion_validate_certs: "{{ os_migrate_dst_validate_certs|default(omit) }}"
os_migrate_conversion_ca_cert: "{{ os_migrate_dst_ca_cert|default(omit) }}"
os_migrate_conversion_client_cert: "{{ os_migrate_dst_client_cert|default(omit) }}"
os_migrate_conversion_client_key: "{{ os_migrate_dst_client_key|default(omit) }}"
when: os_migrate_reboot_conversion_hosts|default(false)|bool

- name: wait for dst conversion host reachability
ansible.builtin.wait_for:
port: 22
host: "{{ hostvars['os_migrate_conv_dst']['ansible_ssh_host'] }}"
search_regex: OpenSSH
sleep: 5
timeout: 600
when: os_migrate_reboot_conversion_hosts|default(false)|bool

- hosts: conversion_hosts
environment:
OS_CLIENT_CONFIG_FILE: "{{ os_migrate_clouds_path|default(os_migrate_data_dir ~ '/clouds.yaml') }}"
Expand Down
1 change: 1 addition & 0 deletions os_migrate/playbooks/export_workloads.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- hosts: migrator
environment:
OS_BLOCK_STORAGE_DEFAULT_MICROVERSION: 3.10
OS_CLIENT_CONFIG_FILE: "{{ os_migrate_clouds_path|default(os_migrate_data_dir ~ '/clouds.yaml') }}"
roles:
- os_migrate.os_migrate.export_workloads
1 change: 1 addition & 0 deletions os_migrate/playbooks/import_workloads.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- hosts: migrator
environment:
OS_BLOCK_STORAGE_DEFAULT_MICROVERSION: 3.10
OS_CLIENT_CONFIG_FILE: "{{ os_migrate_clouds_path|default(os_migrate_data_dir ~ '/clouds.yaml') }}"
roles:
- os_migrate.os_migrate.import_workloads
2 changes: 2 additions & 0 deletions os_migrate/roles/conversion_host/tasks/link_prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
search_regex: OpenSSH
sleep: 5
timeout: 600
retries: 10

- name: wait for dst conversion host reachability
ansible.builtin.wait_for:
Expand All @@ -26,3 +27,4 @@
search_regex: OpenSSH
sleep: 5
timeout: 600
retries: 10
10 changes: 10 additions & 0 deletions os_migrate/roles/conversion_host/tasks/reboot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- name: Reboot conversion host if required
openstack.cloud.server_action:
action: reboot_hard
server: "{{ os_migrate_conversion_host_name }}"
wait: true
cloud: "{{ os_migrate_conversion_cloud }}"
validate_certs: "{{ os_migrate_conversion_validate_certs|default(omit) }}"
ca_cert: "{{ os_migrate_conversion_ca_cert|default(omit) }}"
client_cert: "{{ os_migrate_conversion_client_cert|default(omit) }}"
client_key: "{{ os_migrate_conversion_client_key|default(omit) }}"
1 change: 1 addition & 0 deletions tests/e2e/test_as_admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- name: Migration tests
hosts: migrator
environment:
OS_BLOCK_STORAGE_DEFAULT_MICROVERSION: 3.10
OS_CLIENT_CONFIG_FILE: "{{ os_migrate_clouds_path|default(os_migrate_data_dir ~ '/clouds.yaml') }}"
tasks:
- name: clean the environment
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/test_as_tenant.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
- name: Migration tests
hosts: migrator
environment:
OS_BLOCK_STORAGE_DEFAULT_MICROVERSION: 3.10
OS_CLIENT_CONFIG_FILE: "{{ os_migrate_clouds_path|default(os_migrate_data_dir ~ '/clouds.yaml') }}"
tasks:
- name: clean workloads
Expand Down

0 comments on commit c7cac32

Please sign in to comment.