Skip to content

Commit

Permalink
ci/e2e: soft-link the ISO image
Browse files Browse the repository at this point in the history
This is to avoid a sporadic "Could not define storage pool" error from libvirt.

Signed-off-by: Loic Devulder <ldevulder@suse.com>
  • Loading branch information
ldevulder committed Feb 16, 2023
1 parent 190f40a commit b8fcda2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/scripts/install-vm
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ if [[ ${EMULATE_TPM} != "true" ]]; then
EMULATED_TPM="emulator,model=tpm-crb,version=2.0"
fi

# Create directories: dedicated one for storage pool + logs one
mkdir -p logs ${VM_NAME}

# iPXE stuff will not be used if ISO is set
if [[ ${ISO_BOOT} == "true" ]]; then
ISO=$(realpath ../../elemental-*.iso 2>/dev/null)
Expand All @@ -40,8 +43,11 @@ if [[ ${ISO_BOOT} == "true" ]]; then
&& echo "File ${ISO} not found! Exiting!" >&2 \
&& exit 1

# Soft-link the ISO to avoid "Could not define storage pool" error
ln -s ${ISO} ${VM_NAME}/

# Force ISO boot
INSTALL_FLAG="--cdrom ${ISO}"
INSTALL_FLAG="--cdrom ${VM_NAME}/${ISO##*/}"
else
# Create symlink for binary but only if it doesn't exist
SYM_LINK=../../ipxe.efi
Expand All @@ -62,12 +68,6 @@ else
INSTALL_FLAG="--pxe"
fi

# Create logs directory if needed
mkdir -p logs

# Create a dedicated directory for storage pool
mkdir -p ${VM_NAME}

# Wait randomly until 20s to avoid running virt-install at the same time
# Because it can lead to some issues with hugepages
sleep $((RANDOM % 20))
Expand Down

0 comments on commit b8fcda2

Please sign in to comment.