test: add test for cifs remediation#309
Conversation
|
[citest] |
|
Please rebase, tests should be all green now |
spetrosi
left a comment
There was a problem hiding this comment.
e2e tests are pretty heavy already. Did you consider placing this test to a remediation role tests? So that it won't do any upgrade, just trigger an inhibitor and remediate it and check if remediation worked.
|
Well not all green, there is a selinux failing on 8to9 update due to a known bug. |
I think in order to test remediations, I need to do most of what common_upgrade_tasks.yml does, except for doing the actual upgrade - run analysis, show inhibitors, map inhibitors to remediations, run remediations, check remediations, run analysis after remediation. So, I could add another test in https://github.com/redhat-cop/infra.leapp/tree/main/tests e.g. wdyt? |
ee2d8cf to
4257462
Compare
|
[citest] |
Yep, good idea. Ff this works, it's better than make the current upgrade tests larger. In this case, we can do a similar test for #312 too. It's a lot of work to cover all existing remediations with tests. But I am for adding tests for what we develop going forward. |
4257462 to
575d9ef
Compare
Ok - check out the latest commit |
575d9ef to
0a24cd2
Compare
|
[citest] |
| vars: | ||
| setup_task_files: "{{ setup_tasks.files | map(attribute='path') | reject('search', reject_pattern) | list }}" | ||
| reject_pattern: "{{ '/remediate_' if not leapp_test_remediations | d(false) else 'NOMATCH' }}" | ||
| when: setup_task_files | length > 0 |
There was a problem hiding this comment.
You don't have this test below for verify_remediation_tasks.files. Is it really necessary?
There was a problem hiding this comment.
not sure what you mean
There was a problem hiding this comment.
I see now, you do setup only when leapp_test_remediations=true. Will this simplification work? I was looking at how you did the common_upgrade_tasks | Verify remediations task below.
- name: common_upgrade_tasks | Do setup tasks
ansible.builtin.include_tasks: "{{ setup_task_file }}"
loop: "{{ setup_tasks.files | map(attribute='path' | list }}"
loop_control:
loop_var: setup_task_file
when: leapp_test_remediations0a24cd2 to
686c69c
Compare
|
[citest] |
plans/test_playbooks.fmf
Outdated
| # environment-file: | ||
| # - https://<GitLab CEE RedHat instance>/oamg/tests-ansible-collection-leapp/-/raw/main/leapp_coll_env_file.yml | ||
| environment-file: | ||
| - leapp_coll_env_file.yml |
There was a problem hiding this comment.
Please keep this commented out, adding this will break the CI
| vars: | ||
| setup_task_files: "{{ setup_tasks.files | map(attribute='path') | reject('search', reject_pattern) | list }}" | ||
| reject_pattern: "{{ '/remediate_' if not leapp_test_remediations | d(false) else 'NOMATCH' }}" | ||
| when: setup_task_files | length > 0 |
There was a problem hiding this comment.
I see now, you do setup only when leapp_test_remediations=true. Will this simplification work? I was looking at how you did the common_upgrade_tasks | Verify remediations task below.
- name: common_upgrade_tasks | Do setup tasks
ansible.builtin.include_tasks: "{{ setup_task_file }}"
loop: "{{ setup_tasks.files | map(attribute='path' | list }}"
loop_control:
loop_var: setup_task_file
when: leapp_test_remediationsAdd a test to trigger and verify the cifs remediation, and test playbooks for 7to8, 8to9, and 9to10 in order to run remediations for those cases. This adds a sort of test framework for doing test setup and test verify, by adding `tests/tasks/setup/` and `tests/tasks/verify/` sub-directories with task files for those purposes. We currently use it only for doing remediation setup and verify, but I could imagine using it for other purposes, or adding a `cleanup/` sub-directory for cleanup tasks. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
For now, but I think this could be used for more general setup tasks.
It will work for now, but I would like to support setup for other than remediation in the future. What I'm trying to do with task |
|
I see, thanks for the explanation. Good to have it as you wrote it then. |
spetrosi
left a comment
There was a problem hiding this comment.
Please rebase and merge
686c69c to
e8365ed
Compare
|
[citest] |
Add a test to trigger and verify the cifs remediation, and test
playbooks for 7to8, 8to9, and 9to10 in order to run remediations
for those cases.
This adds a sort of test framework for doing test setup and test
verify, by adding
tests/tasks/setup/andtests/tasks/verify/sub-directories with task files for those purposes. We currently
use it only for doing remediation setup and verify, but I could
imagine using it for other purposes, or adding a
cleanup/sub-directory for cleanup tasks.
Signed-off-by: Rich Megginson rmeggins@redhat.com