forked from linux-system-roles/storage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for volume/filesystem resize
Based on @yizhanglinux's code in linux-system-roles#139. Remove a disabled resize test from tests_lvm_errors where it does not belong anymore.
- Loading branch information
Showing
2 changed files
with
63 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
- hosts: all | ||
vars: | ||
mount_location: '/opt/test1' | ||
volume_group_size: '10g' | ||
volume_size_before: '5g' | ||
volume_size_after: '9g' | ||
|
||
tasks: | ||
- include_role: | ||
name: storage | ||
|
||
- include_tasks: get_unused_disk.yml | ||
vars: | ||
min_size: "{{ volume_group_size }}" | ||
max_return: 1 | ||
|
||
- name: Create one LVM logical volume with "{{ volume_size_before }}" under one volume group | ||
include_role: | ||
name: storage | ||
vars: | ||
storage_pools: | ||
- name: foo | ||
disks: "{{ unused_disks }}" | ||
type: lvm | ||
volumes: | ||
- name: test1 | ||
# resizing is currently supported only for ext2/3/4 | ||
fs_type: 'ext4' | ||
size: "{{ volume_size_before }}" | ||
mount_point: "{{ mount_location }}" | ||
|
||
- include_tasks: verify-role-results.yml | ||
|
||
- name: Change volume_size to "{{ volume_size_after }}" | ||
include_role: | ||
name: storage | ||
vars: | ||
storage_pools: | ||
- name: foo | ||
type: lvm | ||
disks: "{{ unused_disks }}" | ||
volumes: | ||
- name: test1 | ||
fs_type: 'ext4' | ||
size: "{{ volume_size_after }}" | ||
mount_point: "{{ mount_location }}" | ||
|
||
- include_tasks: verify-role-results.yml | ||
|
||
- name: Clean up | ||
include_role: | ||
name: storage | ||
vars: | ||
storage_pools: | ||
- name: foo | ||
disks: "{{ unused_disks }}" | ||
state: absent | ||
volumes: | ||
- name: test1 | ||
size: "{{ volume_size_after }}" | ||
mount_point: "{{ mount_location }}" | ||
|
||
- include_tasks: verify-role-results.yml |