Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: fix sector-based disk size calculation from ansible_devices #433

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions tests/tests_create_lv_size_equal_to_vg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
volume_group_size: '10g'
lv_size: '10g'
unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}'
disk_size: '{{ unused_disk_subfact.sectors | int *
unused_disk_subfact.sectorsize | int }}'
disk_size: '{{ unused_disk_subfact.sectors | int * 512 }}'
tags:
- tests::lvm

Expand Down
3 changes: 1 addition & 2 deletions tests/tests_misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
volume_group_size: "5g"
volume1_size: "4g"
unused_disk_subfact: "{{ ansible_devices[unused_disks[0]] }}"
too_large_size: "{{ (unused_disk_subfact.sectors | int * 1.2) *
unused_disk_subfact.sectorsize | int }}"
too_large_size: "{{ (unused_disk_subfact.sectors | int * 1.2) * 512 }}"
tags:
- tests::lvm
tasks:
Expand Down
6 changes: 2 additions & 4 deletions tests/tests_resize.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
invalid_size1: xyz GiB
invalid_size2: none
unused_disk_subfact: '{{ ansible_devices[unused_disks[0]] }}'
too_large_size: '{{ unused_disk_subfact.sectors | int * 1.2 *
unused_disk_subfact.sectorsize | int }}'
disk_size: '{{ unused_disk_subfact.sectors | int *
unused_disk_subfact.sectorsize | int }}'
too_large_size: '{{ unused_disk_subfact.sectors | int * 1.2 * 512 }}'
disk_size: '{{ unused_disk_subfact.sectors | int * 512 }}'
tags:
- tests::lvm
tasks:
Expand Down
Loading