test(system_baseline): run the vzdump guard cases against the guard alone
Each of the seven vzdump cases ran the whole update entry point in check mode, when they assert only the guard's decision. The guard now lives in an internal tasks/vzdump_guard.yml, imported by update.yml so the update tag, when and main-flow vars still reach it. Six cases include it alone; the ubuntu_lxc case keeps running tasks_from: update end to end, and a static check asserts the guard is imported before the upgrade and that the upgrade's when reads its fact. The purge of unwanted packages becomes one apt call over the installed ones, skipped when none is installed. The scenario's gathering plays use gather_subset min: the role reads only os_family and package_facts. Closes #456 Assisted-by: Claude Code
This commit is contained in:
1 parent
716baa19c7
commit
f766666476
8 files changed
+93
-65
No files matched your search
@@ -1,7 +1,7 @@
|
||||
---
|
||||
# One case of the vzdump guard: a pvesh stub answers with system_baseline_case_answer, the update entry point runs in check mode, and the
|
||||
# fact that decides the upgrade, and whether pvesh was asked at all, are compared with what the case expects. Kept outside the role's own tasks:
|
||||
# no CI image is a Proxmox node, so the stub stands for the real `pvesh get /nodes/<node>/tasks` answer.
|
||||
# One case of the vzdump guard: a pvesh stub answers with system_baseline_case.answer, the role's tasks_from file (the guard alone unless the
|
||||
# case names update) runs in check mode, and the fact that decides the upgrade, and whether pvesh was asked at all, are compared with what the
|
||||
# case expects. Kept outside the role's own tasks: no CI image is a Proxmox node, so the stub stands for the real `pvesh get` answer.
|
||||
- name: Write the pvesh stub
|
||||
check_mode: false
|
||||
ansible.builtin.copy:
|
||||
@@ -14,8 +14,9 @@
|
||||
{{ system_baseline_case.answer | to_json }}
|
||||
JSON
|
||||
|
||||
- name: Create the apt scratch directory, which a check mode run does not
|
||||
- name: Create the apt scratch directory, which a check mode run of the update entry point does not
|
||||
check_mode: false
|
||||
when: system_baseline_case.tasks_from | default('vzdump_guard') == 'update'
|
||||
ansible.builtin.file:
|
||||
path: /var/cache/system-baseline-apt-tmp
|
||||
state: directory
|
||||
@@ -26,13 +27,13 @@
|
||||
path: /var/tmp/pvesh-calls
|
||||
state: absent
|
||||
|
||||
- name: Run the update entry point in check mode
|
||||
- name: Run the case's tasks in check mode
|
||||
check_mode: true
|
||||
block:
|
||||
- name: Include system_baseline, tasks_from update
|
||||
- name: Include system_baseline, tasks_from {{ system_baseline_case.tasks_from | default('vzdump_guard') }}
|
||||
ansible.builtin.include_role:
|
||||
name: mortis.kamino.system_baseline
|
||||
tasks_from: update
|
||||
tasks_from: "{{ system_baseline_case.tasks_from | default('vzdump_guard') }}"
|
||||
vars:
|
||||
system_baseline_system_type: "{{ system_baseline_case.type }}"
|
||||
system_baseline_skip_upgrade_during_vzdump: "{{ system_baseline_case.input }}"
|
||||
|
||||
Reference in new issue
Block a user