|
42 | 42 | - "adoption_vars.edpm_nodes.cell2['cell2-osp-compute-uni05epsilon-0'].ansible.ansibleHost == '192.168.122.120'" |
43 | 43 | fail_msg: "Multi-cell edpm_nodes structure is incorrect" |
44 | 44 | success_msg: "Successfully verified multi-cell edpm_nodes structure" |
| 45 | + - name: "Load args override results" |
| 46 | + ansible.builtin.set_fact: |
| 47 | + args_override_results: "{{ hostvars[inventory_hostname].args_override_results }}" |
| 48 | + |
| 49 | + - name: "Assert default args are preserved when no overrides" |
| 50 | + ansible.builtin.assert: |
| 51 | + that: |
| 52 | + - "args_override_results.default == args_override_results.mock_args_joined" |
| 53 | + fail_msg: >- |
| 54 | + Default args mismatch. |
| 55 | + Got: '{{ args_override_results.default }}' |
| 56 | + Expected: '{{ args_override_results.mock_args_joined }}' |
| 57 | +
|
| 58 | + - name: "Assert removing an arg works" |
| 59 | + ansible.builtin.assert: |
| 60 | + that: |
| 61 | + - "'--libvirt-type qemu' not in args_override_results.remove" |
| 62 | + - "'--timeout 90' in args_override_results.remove" |
| 63 | + - "'--deployed-server' in args_override_results.remove" |
| 64 | + |
| 65 | + - name: "Assert adding an arg appends it" |
| 66 | + ansible.builtin.assert: |
| 67 | + that: |
| 68 | + - "'--libvirt-type kvm' in args_override_results.add" |
| 69 | + - "'--libvirt-type qemu' in args_override_results.add" |
| 70 | + - "args_override_results.add.endswith('--libvirt-type kvm')" |
| 71 | + |
| 72 | + - name: "Assert replace pattern (remove + add)" |
| 73 | + ansible.builtin.assert: |
| 74 | + that: |
| 75 | + - "'--libvirt-type qemu' not in args_override_results.replace" |
| 76 | + - "'--libvirt-type kvm' in args_override_results.replace" |
| 77 | + - "args_override_results.replace.endswith('--libvirt-type kvm')" |
| 78 | + - "'--timeout 90' in args_override_results.replace" |
| 79 | + |
| 80 | + - name: "Assert removing multiple args works" |
| 81 | + ansible.builtin.assert: |
| 82 | + that: |
| 83 | + - "'--libvirt-type qemu' not in args_override_results.remove_multi" |
| 84 | + - "'--timeout 90' not in args_override_results.remove_multi" |
| 85 | + - "'--deployed-server' in args_override_results.remove_multi" |
| 86 | + |
| 87 | + - name: "Assert removing non-existent arg is a no-op" |
| 88 | + ansible.builtin.assert: |
| 89 | + that: |
| 90 | + - "args_override_results.remove_noop == args_override_results.default" |
0 commit comments