test: update for minimal raw new xz format
This commit is contained in:
parent
3bbcc8a7cc
commit
8ba6487b82
2 changed files with 92 additions and 12 deletions
|
|
@ -8,6 +8,10 @@ source /usr/libexec/tests/osbuild-composer/shared_lib.sh
|
|||
# Provision the software under test.
|
||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||
|
||||
# Start firewalld
|
||||
greenprint "Start firewalld"
|
||||
sudo systemctl enable --now firewalld
|
||||
|
||||
# Start libvirtd and test it.
|
||||
greenprint "🚀 Starting libvirt daemon"
|
||||
sudo systemctl start libvirtd
|
||||
|
|
@ -24,7 +28,7 @@ sudo tee /tmp/integration.xml > /dev/null << EOF
|
|||
<port start='1024' end='65535'/>
|
||||
</nat>
|
||||
</forward>
|
||||
<bridge name='integration' stp='on' delay='0'/>
|
||||
<bridge name='integration' zone='trusted' stp='on' delay='0'/>
|
||||
<mac address='52:54:00:36:46:ef'/>
|
||||
<ip address='192.168.100.1' netmask='255.255.255.0'>
|
||||
<dhcp>
|
||||
|
|
@ -57,7 +61,8 @@ TEST_UUID=$(uuidgen)
|
|||
IMAGE_KEY="minimal-raw-${TEST_UUID}"
|
||||
UEFI_GUEST_ADDRESS=192.168.100.51
|
||||
MINIMAL_RAW_TYPE=minimal-raw
|
||||
MINIMAL_RAW_FILENAME=raw.img
|
||||
MINIMAL_RAW_DECOMPRESSED=raw.img
|
||||
MINIMAL_RAW_FILENAME=raw.img.xz
|
||||
BOOT_ARGS="uefi"
|
||||
|
||||
# Set up temporary files.
|
||||
|
|
@ -73,12 +78,33 @@ SSH_KEY=${SSH_DATA_DIR}/id_rsa
|
|||
SSH_KEY_PUB=$(cat "${SSH_KEY}".pub)
|
||||
EDGE_USER_PASSWORD=foobar
|
||||
|
||||
if [[ $ID != fedora ]]; then
|
||||
echo "unsupported distro: ${ID}-${VERSION_ID}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
OS_VARIANT="fedora-unknown"
|
||||
case "${ID}-${VERSION_ID}" in
|
||||
"rhel-8.9")
|
||||
OS_VARIANT="rhel8-unknown"
|
||||
;;
|
||||
"rhel-9.3")
|
||||
OS_VARIANT="rhel9-unknown"
|
||||
;;
|
||||
"centos-8")
|
||||
OS_VARIANT="centos-stream8"
|
||||
;;
|
||||
"centos-9")
|
||||
OS_VARIANT="centos-stream9"
|
||||
BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
|
||||
;;
|
||||
"fedora-37")
|
||||
OS_VARIANT="fedora37"
|
||||
;;
|
||||
"fedora-38")
|
||||
OS_VARIANT="fedora-unknown"
|
||||
;;
|
||||
"fedora-39")
|
||||
OS_VARIANT="fedora-rawhide"
|
||||
;;
|
||||
*)
|
||||
echo "unsupported distro: ${ID}-${VERSION_ID}"
|
||||
exit 1;;
|
||||
esac
|
||||
|
||||
# Get the compose log.
|
||||
get_compose_log () {
|
||||
|
|
@ -239,11 +265,12 @@ build_image minimal-raw "${MINIMAL_RAW_TYPE}"
|
|||
# Download the image
|
||||
greenprint "📥 Downloading the minimal-raw image"
|
||||
sudo composer-cli compose image "${COMPOSE_ID}" > /dev/null
|
||||
MINIMAL_RAW_FILENAME="${COMPOSE_ID}-${MINIMAL_RAW_FILENAME}"
|
||||
|
||||
greenprint "Extracting and converting the raw image to a qcow2 file"
|
||||
MINIMAL_RAW_FILENAME="${COMPOSE_ID}-${MINIMAL_RAW_FILENAME}"
|
||||
sudo xz -d "${MINIMAL_RAW_FILENAME}"
|
||||
LIBVIRT_IMAGE_PATH_UEFI=/var/lib/libvirt/images/"${IMAGE_KEY}-uefi.qcow2"
|
||||
sudo qemu-img convert -f raw "$MINIMAL_RAW_FILENAME" -O qcow2 "$LIBVIRT_IMAGE_PATH_UEFI"
|
||||
sudo qemu-img convert -f raw "${COMPOSE_ID}-${MINIMAL_RAW_DECOMPRESSED}" -O qcow2 "$LIBVIRT_IMAGE_PATH_UEFI"
|
||||
# Remove raw file
|
||||
sudo rm -f "$MINIMAL_RAW_FILENAME"
|
||||
|
||||
|
|
@ -309,7 +336,7 @@ ansible_become_pass=${EDGE_USER_PASSWORD}
|
|||
EOF
|
||||
|
||||
# Test IoT/Edge OS
|
||||
sudo ansible-playbook -v -i "${TEMPDIR}"/inventory /usr/share/tests/osbuild-composer/ansible/check-minimal.yaml || RESULTS=0
|
||||
sudo ansible-playbook -v -i "${TEMPDIR}"/inventory -e download_node="$DOWNLOAD_NODE" /usr/share/tests/osbuild-composer/ansible/check-minimal.yaml || RESULTS=0
|
||||
check_result
|
||||
|
||||
# Final success clean up
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
vars:
|
||||
total_counter: "0"
|
||||
failed_counter: "0"
|
||||
download_node: ""
|
||||
|
||||
tasks:
|
||||
# current target host's IP address
|
||||
|
|
@ -57,6 +58,58 @@
|
|||
set_fact:
|
||||
failed_counter: "{{ failed_counter | int + 1 }}"
|
||||
|
||||
- name: enable persistent logging for the systemd journal
|
||||
file:
|
||||
path: /var/log/journal
|
||||
state: directory
|
||||
become: yes
|
||||
when: ansible_facts['distribution'] == 'RedHat' or ansible_facts['distribution'] == 'CentOS'
|
||||
|
||||
- name: enable persistent logging on RHEL 9 and CS9 only
|
||||
command: journalctl --flush
|
||||
become: yes
|
||||
when: ansible_facts['distribution_version'] == "9.3" or ansible_facts['distribution_version'] == "9"
|
||||
|
||||
- name: add RHEL 9.3 BaseOS repository
|
||||
yum_repository:
|
||||
name: baseos
|
||||
description: RHEL repository
|
||||
baseurl: "http://{{ download_node }}/rhel-9/nightly/RHEL-9/latest-RHEL-9.3.0/compose/BaseOS/{{ ansible_facts['architecture'] }}/os/"
|
||||
gpgcheck: no
|
||||
file: rhel_repo
|
||||
become: yes
|
||||
when: ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('9.3', '==')
|
||||
|
||||
- name: add RHEL 9.3 AppStream repository
|
||||
yum_repository:
|
||||
name: appstream
|
||||
description: RHEL repository
|
||||
baseurl: "http://{{ download_node }}/rhel-9/nightly/RHEL-9/latest-RHEL-9.3.0/compose/AppStream/{{ ansible_facts['architecture'] }}/os/"
|
||||
gpgcheck: no
|
||||
file: rhel_repo
|
||||
become: yes
|
||||
when: ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('9.3', '==')
|
||||
|
||||
- name: add RHEL 8.9 BaseOS repository
|
||||
yum_repository:
|
||||
name: baseos
|
||||
description: RHEL repository
|
||||
baseurl: "http://{{ download_node }}/rhel-8/nightly/RHEL-8/latest-RHEL-8.9.0/compose/BaseOS/{{ ansible_facts['architecture'] }}/os/"
|
||||
gpgcheck: no
|
||||
file: rhel_repo
|
||||
become: yes
|
||||
when: ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('8.9', '==')
|
||||
|
||||
- name: add RHEL 8.9 AppStream repository
|
||||
yum_repository:
|
||||
name: appstream
|
||||
description: RHEL repository
|
||||
baseurl: "http://{{ download_node }}/rhel-8/nightly/RHEL-8/latest-RHEL-8.9.0/compose/AppStream/{{ ansible_facts['architecture'] }}/os/"
|
||||
gpgcheck: no
|
||||
file: rhel_repo
|
||||
become: yes
|
||||
when: ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('8.9', '==')
|
||||
|
||||
- name: install podman
|
||||
dnf:
|
||||
name:
|
||||
|
|
@ -157,7 +210,7 @@
|
|||
- name: check journald has persistent logging
|
||||
block:
|
||||
- name: list boots
|
||||
shell: journalctl --list-boots
|
||||
shell: journalctl --list-boots -q
|
||||
register: result_list_boots
|
||||
|
||||
- assert:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue