|
137 | 137 | }} |
138 | 138 | ansible.builtin.assert: |
139 | 139 | that: "cifmw_cls_namespace not in ns_names" |
| 140 | + |
| 141 | + - name: Test oc-debug fallback path (uncovered_node_dirs.yml) |
| 142 | + vars: |
| 143 | + cifmw_cls_pv_count: 3 |
| 144 | + cifmw_cls_local_storage_name: /mnt/openstack-fallback |
| 145 | + cifmw_cls_oc_debug_fallback: true |
| 146 | + block: |
| 147 | + - name: Get k8s node names for fallback test |
| 148 | + kubernetes.core.k8s_info: |
| 149 | + kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
| 150 | + kind: Node |
| 151 | + register: _fb_k8s_nodes |
| 152 | + |
| 153 | + - name: Simulate no SSH-reachable hosts matching k8s nodes |
| 154 | + ansible.builtin.set_fact: |
| 155 | + cifmw_ci_local_storage_k8s_hostnames: |
| 156 | + - "{{ _fb_k8s_nodes.resources[0].metadata.name }}" |
| 157 | + _hostnames: |
| 158 | + results: [] |
| 159 | + |
| 160 | + - name: Run uncovered_node_dirs.yml (create) |
| 161 | + vars: |
| 162 | + cifmw_cls_action: create |
| 163 | + ansible.builtin.include_tasks: |
| 164 | + file: "{{ playbook_dir }}/../../tasks/uncovered_node_dirs.yml" |
| 165 | + |
| 166 | + - name: Assert uncovered nodes were identified |
| 167 | + ansible.builtin.assert: |
| 168 | + that: |
| 169 | + - _cls_uncovered_nodes | length == 1 |
| 170 | + |
| 171 | + - name: Verify directories created on node |
| 172 | + delegate_to: crc |
| 173 | + become: true |
| 174 | + register: _fb_check |
| 175 | + ansible.builtin.stat: |
| 176 | + path: "/mnt/openstack-fallback/pv{{ '%02d' | format(item | int) }}" |
| 177 | + loop: "{{ range(1, 4) }}" |
| 178 | + |
| 179 | + - name: Assert all fallback directories exist |
| 180 | + ansible.builtin.assert: |
| 181 | + that: item.stat.exists |
| 182 | + loop: "{{ _fb_check.results }}" |
| 183 | + loop_control: |
| 184 | + label: "{{ item.invocation.module_args.path }}" |
| 185 | + |
| 186 | + - name: Run uncovered_node_dirs.yml (cleanup) |
| 187 | + vars: |
| 188 | + cifmw_cls_action: clean |
| 189 | + ansible.builtin.include_tasks: |
| 190 | + file: "{{ playbook_dir }}/../../tasks/uncovered_node_dirs.yml" |
| 191 | + |
| 192 | + - name: Verify fallback directories removed |
| 193 | + delegate_to: crc |
| 194 | + become: true |
| 195 | + register: _fb_removed |
| 196 | + ansible.builtin.stat: |
| 197 | + path: "/mnt/openstack-fallback" |
| 198 | + |
| 199 | + - name: Assert fallback directory tree is gone |
| 200 | + ansible.builtin.assert: |
| 201 | + that: not _fb_removed.stat.exists |
0 commit comments