test: Update tests to support embeded container image feature

Container image can only be embeded on commit Use fedora image
instead of ubi8 and only run embeded image checking on  RHEL
8.7, 9.1, CS8 and CS9.
This commit is contained in:
Xiaofeng Wang 2022-07-22 17:40:43 +08:00 committed by Christian Kellner
parent 89c2bb0d3e
commit c71ae8f455
4 changed files with 82 additions and 6 deletions

View file

@ -5,6 +5,7 @@
workspace: "{{ lookup('env', 'WORKSPACE') }}"
skip_rollback_test: "false"
fdo_credential: "false"
embeded_container: "false"
total_counter: "0"
failed_counter: "0"
@ -150,7 +151,7 @@
- name: check if it is simplified-installer or raw-image
command: findmnt -r -o SOURCE -n /sysroot
register: result_encrypted
- set_fact:
device_name: "{{ result_encrypted.stdout }}"
when: "'/dev/mapper/luks-' in result_encrypted.stdout"
@ -342,6 +343,36 @@
shell: dmesg --notime | grep -i "error\|fail" || true
register: result_dmesg_error
- name: check embeded container image with podman
command: podman images
become: yes
register: result_podman_images
when:
- embeded_container == "true"
- (ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('9.0', '>')) or
(ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('8.6', '>') and ansible_facts ['distribution_version'] is version('9.0', '!=')) or
(ansible_facts['distribution'] == 'CentOS')
- name: embded container should be listed by podman images
block:
- assert:
that:
- "'quay.io/fedora/fedora' in result_podman_images.stdout"
fail_msg: "fedora image is not built in image"
success_msg: "fedora image is built in image"
always:
- set_fact:
total_counter: "{{ total_counter | int + 1 }}"
rescue:
- name: failed count + 1
set_fact:
failed_counter: "{{ failed_counter | int + 1 }}"
when:
- embeded_container == "true"
- (ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('9.0', '>')) or
(ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('8.6', '>') and ansible_facts ['distribution_version'] is version('9.0', '!=')) or
(ansible_facts['distribution'] == 'CentOS')
# case: check running container with podman
- name: run ubi8 image
command: podman run registry.access.redhat.com/ubi8/ubi-minimal:latest cat /etc/redhat-release