-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathtests_create_lvm_cache_then_remove.yml
More file actions
88 lines (79 loc) · 2.69 KB
/
tests_create_lvm_cache_then_remove.yml
File metadata and controls
88 lines (79 loc) · 2.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
- name: Test lvm cache create and remove
hosts: all
become: true
vars:
storage_safe_mode: false
storage_use_partitions: true
volume_group_size: '10g'
volume_size: '5g'
cache_size: '4g'
__storage_min_size: "{{ volume_group_size }}"
__storage_max_return: 2
__storage_disks_needed: 2
__storage_match_sector_size: true
tags:
- tests::lvm
tasks:
- name: Storage test setup
ansible.builtin.include_tasks: tasks/setup.yml
vars:
__storage_get_package_facts: true
- name: Create a cached LVM logical volume under volume group 'foo'
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
storage_pools:
- name: foo
disks: "{{ unused_disks }}"
volumes:
- name: test
size: "{{ volume_size }}"
cached: true
cache_size: "{{ cache_size }}"
cache_devices: "{{ [unused_disks[1]] }}"
- name: Verify role results
include_tasks: verify-role-results.yml
- name: Remove (detach) cache from the 'test' LV created above
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
storage_pools:
- name: foo
disks: "{{ unused_disks }}"
volumes:
- name: test
size: "{{ volume_size }}"
cached: false
- name: Verify role results - 2
include_tasks: verify-role-results.yml
- name: Run test on supported platforms
when: ((is_fedora and blivet_pkg_version is version("3.5.0-1", ">=")) or
(is_rhel8 and blivet_pkg_version is version("3.4.0-10", ">=")) or
(is_rhel9 and blivet_pkg_version is version("3.4.0-14", ">=")) or
is_rhel10)
block:
- name: Attach the cache to the 'test' LV created above
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
storage_pools:
- name: foo
disks: "{{ unused_disks }}"
volumes:
- name: test
size: "{{ volume_size }}"
cached: true
cache_size: "{{ cache_size }}"
cache_devices: "{{ [unused_disks[1]] }}"
- name: Verify role results - 3
include_tasks: verify-role-results.yml
- name: Clean up
include_tasks: tasks/run_role_with_clear_facts.yml
vars:
storage_pools:
- name: foo
disks: "{{ unused_disks }}"
state: "absent"
volumes:
- name: test
size: "{{ volume_size }}"
- name: Verify role results - 4
include_tasks: verify-role-results.yml