test: update ansible checks for ostree mount points

This commit is contained in:
yih 2022-09-07 20:08:37 +08:00 committed by Tom Gundersen
parent 44cd7cbc76
commit 9ea694ef0a

View file

@ -134,47 +134,12 @@
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
# bios or uefi
- name: bios or uefi
stat:
path: /sys/firmware/efi
register: result_uefi
- set_fact:
device_name: /dev/vda2
- set_fact:
device_name: /dev/vda3
when: result_uefi.stat.exists
# Check if it is raw-image or simplified-installer, the disk are encrypted, and mount point starts with /dev/mapper/luks-
- name: check if it is simplified-installer or raw-image
- name: set mount point device name
command: findmnt -r -o SOURCE -n /sysroot
register: result_encrypted
register: result_sysroot_source
- set_fact:
device_name: "{{ result_encrypted.stdout }}"
when: "'/dev/mapper/luks-' in result_encrypted.stdout"
# case: check /sysroot moutn point
- name: check /sysroot mount point
command: findmnt -r -o SOURCE -n /sysroot
register: result_sysroot_mount_point
- name: "/sysroot should be mounted on {{ device_name }}"
block:
- assert:
that:
- result_sysroot_mount_point.stdout == "{{ device_name }}"
fail_msg: "/sysroot does not mount on {{ device_name }}"
success_msg: "/sysroot mounts on {{ device_name }}"
always:
- set_fact:
total_counter: "{{ total_counter | int + 1 }}"
rescue:
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
device_name: "{{ result_sysroot_source.stdout }}"
# case: check /sysroot mount status
- name: check /sysroot mount status