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.
|
# Provision the software under test.
|
||||||
/usr/libexec/osbuild-composer-test/provision.sh none
|
/usr/libexec/osbuild-composer-test/provision.sh none
|
||||||
|
|
||||||
|
# Start firewalld
|
||||||
|
greenprint "Start firewalld"
|
||||||
|
sudo systemctl enable --now firewalld
|
||||||
|
|
||||||
# Start libvirtd and test it.
|
# Start libvirtd and test it.
|
||||||
greenprint "🚀 Starting libvirt daemon"
|
greenprint "🚀 Starting libvirt daemon"
|
||||||
sudo systemctl start libvirtd
|
sudo systemctl start libvirtd
|
||||||
|
|
@ -24,7 +28,7 @@ sudo tee /tmp/integration.xml > /dev/null << EOF
|
||||||
<port start='1024' end='65535'/>
|
<port start='1024' end='65535'/>
|
||||||
</nat>
|
</nat>
|
||||||
</forward>
|
</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'/>
|
<mac address='52:54:00:36:46:ef'/>
|
||||||
<ip address='192.168.100.1' netmask='255.255.255.0'>
|
<ip address='192.168.100.1' netmask='255.255.255.0'>
|
||||||
<dhcp>
|
<dhcp>
|
||||||
|
|
@ -57,7 +61,8 @@ TEST_UUID=$(uuidgen)
|
||||||
IMAGE_KEY="minimal-raw-${TEST_UUID}"
|
IMAGE_KEY="minimal-raw-${TEST_UUID}"
|
||||||
UEFI_GUEST_ADDRESS=192.168.100.51
|
UEFI_GUEST_ADDRESS=192.168.100.51
|
||||||
MINIMAL_RAW_TYPE=minimal-raw
|
MINIMAL_RAW_TYPE=minimal-raw
|
||||||
MINIMAL_RAW_FILENAME=raw.img
|
MINIMAL_RAW_DECOMPRESSED=raw.img
|
||||||
|
MINIMAL_RAW_FILENAME=raw.img.xz
|
||||||
BOOT_ARGS="uefi"
|
BOOT_ARGS="uefi"
|
||||||
|
|
||||||
# Set up temporary files.
|
# Set up temporary files.
|
||||||
|
|
@ -73,12 +78,33 @@ SSH_KEY=${SSH_DATA_DIR}/id_rsa
|
||||||
SSH_KEY_PUB=$(cat "${SSH_KEY}".pub)
|
SSH_KEY_PUB=$(cat "${SSH_KEY}".pub)
|
||||||
EDGE_USER_PASSWORD=foobar
|
EDGE_USER_PASSWORD=foobar
|
||||||
|
|
||||||
if [[ $ID != fedora ]]; then
|
case "${ID}-${VERSION_ID}" in
|
||||||
echo "unsupported distro: ${ID}-${VERSION_ID}"
|
"rhel-8.9")
|
||||||
exit 1
|
OS_VARIANT="rhel8-unknown"
|
||||||
fi
|
;;
|
||||||
|
"rhel-9.3")
|
||||||
OS_VARIANT="fedora-unknown"
|
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 the compose log.
|
||||||
get_compose_log () {
|
get_compose_log () {
|
||||||
|
|
@ -239,11 +265,12 @@ build_image minimal-raw "${MINIMAL_RAW_TYPE}"
|
||||||
# Download the image
|
# Download the image
|
||||||
greenprint "📥 Downloading the minimal-raw image"
|
greenprint "📥 Downloading the minimal-raw image"
|
||||||
sudo composer-cli compose image "${COMPOSE_ID}" > /dev/null
|
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"
|
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"
|
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
|
# Remove raw file
|
||||||
sudo rm -f "$MINIMAL_RAW_FILENAME"
|
sudo rm -f "$MINIMAL_RAW_FILENAME"
|
||||||
|
|
||||||
|
|
@ -309,7 +336,7 @@ ansible_become_pass=${EDGE_USER_PASSWORD}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Test IoT/Edge OS
|
# 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
|
check_result
|
||||||
|
|
||||||
# Final success clean up
|
# Final success clean up
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
vars:
|
vars:
|
||||||
total_counter: "0"
|
total_counter: "0"
|
||||||
failed_counter: "0"
|
failed_counter: "0"
|
||||||
|
download_node: ""
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
# current target host's IP address
|
# current target host's IP address
|
||||||
|
|
@ -57,6 +58,58 @@
|
||||||
set_fact:
|
set_fact:
|
||||||
failed_counter: "{{ failed_counter | int + 1 }}"
|
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
|
- name: install podman
|
||||||
dnf:
|
dnf:
|
||||||
name:
|
name:
|
||||||
|
|
@ -157,7 +210,7 @@
|
||||||
- name: check journald has persistent logging
|
- name: check journald has persistent logging
|
||||||
block:
|
block:
|
||||||
- name: list boots
|
- name: list boots
|
||||||
shell: journalctl --list-boots
|
shell: journalctl --list-boots -q
|
||||||
register: result_list_boots
|
register: result_list_boots
|
||||||
|
|
||||||
- assert:
|
- assert:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue