diff options
Diffstat (limited to 'roles')
5 files changed, 66 insertions, 0 deletions
diff --git a/roles/configure-run-migration-tests/defaults/main.yaml b/roles/configure-run-migration-tests/defaults/main.yaml new file mode 100644 index 000000000..d9faae34f --- /dev/null +++ b/roles/configure-run-migration-tests/defaults/main.yaml @@ -0,0 +1,6 @@ +--- +migration_source_backend: lvm +migration_destination_backend: lvm +migration_test_regex: "(.*test_volume_retype_with_migration.*|.*test_volume_migrate_attached.*)" +migration_test_results: [] +tempest_run_result: {} diff --git a/roles/configure-run-migration-tests/tasks/main.yaml b/roles/configure-run-migration-tests/tasks/main.yaml new file mode 100644 index 000000000..65a153a97 --- /dev/null +++ b/roles/configure-run-migration-tests/tasks/main.yaml @@ -0,0 +1,33 @@ +--- +- name: Reconfigure tempest.conf + ini_file: + path: "{{ migration_tempest_conf }}" + section: volume + option: backend_names + value: "{{ migration_source_backend }},{{ migration_destination_backend }}" + become: true + become_user: tempest + +- set_fact: + tempest_run_result: {} + +- name: Run migration ({{ migration_source_backend }} -> {{ migration_destination_backend }}) + include_role: + name: run-tempest + apply: + # ignore the errors for this run, otherwise the other migration tests + # won't be executed + ignore_errors: yes + vars: + tempest_test_regex: "{{ migration_test_regex }}" + tox_envlist: all + +- set_fact: + _migration_result_item: + source: "{{ migration_source_backend }}" + destination: "{{ migration_destination_backend }}" + result: "{{ tempest_run_result.get('rc', 1) }}" + +- name: Update the migration test results + set_fact: + migration_test_results: "{{ migration_test_results + [ _migration_result_item ] }}" diff --git a/roles/save-cinder-migration-results/defaults/main.yaml b/roles/save-cinder-migration-results/defaults/main.yaml new file mode 100644 index 000000000..14d1d252a --- /dev/null +++ b/roles/save-cinder-migration-results/defaults/main.yaml @@ -0,0 +1,3 @@ +--- +devstack_base_dir: /opt/stack +tempest_work_dir: "{{ devstack_base_dir }}/tempest" diff --git a/roles/save-cinder-migration-results/tasks/main.yaml b/roles/save-cinder-migration-results/tasks/main.yaml new file mode 100644 index 000000000..e2c97943c --- /dev/null +++ b/roles/save-cinder-migration-results/tasks/main.yaml @@ -0,0 +1,14 @@ +--- +- block: + - template: + src: migration_results_reporter.py.j2 + dest: "{{ tempest_work_dir }}/migration_results_reporter.py" + + - name: Generate the results using stestr + shell: | + stestr run --no-discover --test-path . migration_results_reporter + args: + chdir: "{{ tempest_work_dir }}" + + become: true + become_user: tempest diff --git a/roles/save-cinder-migration-results/templates/migration_results_reporter.py.j2 b/roles/save-cinder-migration-results/templates/migration_results_reporter.py.j2 new file mode 100644 index 000000000..805eb33de --- /dev/null +++ b/roles/save-cinder-migration-results/templates/migration_results_reporter.py.j2 @@ -0,0 +1,10 @@ +import unittest + + +class CinderMigrationsMatrixTest(unittest.TestCase): + +{% for test_case in migration_test_results %} + def test__{{ test_case.source }}_to_{{ test_case.destination }}(self): + self.assertEqual({{ test_case.result }}, 0) + +{% endfor %} |