Skip to content

Commit

Permalink
fix: Use blkid instead of lsblk in tests to get partition table
Browse files Browse the repository at this point in the history
Older versions of lsblk cannot print the PTTYPE column.
  • Loading branch information
vojtechtrefny authored and richm committed Aug 27, 2024
1 parent 59fd1c6 commit 762cda3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/tests_lvm_pool_members.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@
disks: "{{ [unused_disks[0]] }}"

- name: Get the partition table type on disk removed from the VG
command: lsblk -o PTTYPE --noheadings --nodeps /dev/{{ unused_disks[1] }}
command: blkid -p -ovalue -s PTTYPE /dev/{{ unused_disks[1] }}
register: storage_test_removed_pttype
changed_when: false
failed_when: not storage_test_removed_pttype.rc in [0, 2]

- name: Verify that removing the PV from the VG also removed the partition table
assert:
Expand Down Expand Up @@ -289,9 +290,10 @@
size: "{{ volume_size }}"

- name: Get the partition table type on disk removed from the VG
command: lsblk -o PTTYPE --noheadings --nodeps /dev/{{ unused_disks[0] }}
command: blkid -p -ovalue -s PTTYPE /dev/{{ unused_disks[0] }}
register: storage_test_removed_pttype
changed_when: false
failed_when: not storage_test_removed_pttype.rc in [0, 2]

- name: Verify that removing the PV from the VG also removed the partition table
assert:
Expand Down

0 comments on commit 762cda3

Please sign in to comment.