Start collecting logs from virt-install
This commit is contained in:
parent
ee0c7b53dc
commit
38ed9a39be
4 changed files with 39 additions and 8 deletions
|
|
@ -355,6 +355,10 @@ sudo qemu-img create -f qcow2 "${LIBVIRT_IMAGE_PATH}" 20G
|
|||
#########################
|
||||
# Install image via anaconda.
|
||||
|
||||
VIRT_LOG="$ARTIFACTS/installers-sh-virt-install-console.log"
|
||||
touch "$VIRT_LOG"
|
||||
sudo chown qemu:qemu "$VIRT_LOG"
|
||||
|
||||
greenprint "💿 Install image via installer(ISO) on VM"
|
||||
sudo virt-install --name="${IMAGE_KEY}"\
|
||||
--disk path="${LIBVIRT_IMAGE_PATH}",format=qcow2 \
|
||||
|
|
@ -367,7 +371,8 @@ sudo virt-install --name="${IMAGE_KEY}"\
|
|||
--nographics \
|
||||
--noautoconsole \
|
||||
--wait=-1 \
|
||||
--noreboot
|
||||
--noreboot \
|
||||
--console pipe,source.path="$VIRT_LOG"
|
||||
|
||||
|
||||
# Start VM.
|
||||
|
|
|
|||
|
|
@ -283,6 +283,14 @@ sudo composer-cli blueprints delete minimal-raw > /dev/null
|
|||
greenprint "👿 Running restorecon on image directory"
|
||||
sudo restorecon -Rv /var/lib/libvirt/images/
|
||||
|
||||
# create artifacts folder
|
||||
ARTIFACTS="${ARTIFACTS:=/tmp/artifacts}"
|
||||
mkdir -p "${ARTIFACTS}"
|
||||
|
||||
VIRT_LOG="$ARTIFACTS/minimal-raw-virt-install-console.log"
|
||||
touch "$VIRT_LOG"
|
||||
sudo chown qemu:qemu "$VIRT_LOG"
|
||||
|
||||
##################################################################
|
||||
##
|
||||
## Install and test minimal-raw image (UEFI)
|
||||
|
|
@ -300,7 +308,9 @@ sudo virt-install --name="${IMAGE_KEY}-uefi"\
|
|||
--noautoconsole \
|
||||
--wait=-1 \
|
||||
--import \
|
||||
--noreboot
|
||||
--noreboot \
|
||||
--console pipe,source.path="$VIRT_LOG"
|
||||
|
||||
|
||||
# Start VM.
|
||||
greenprint "💻 Start UEFI VM"
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ EOF
|
|||
TEST_UUID=$(uuidgen)
|
||||
IMAGE_KEY="oscap-${TEST_UUID}"
|
||||
HTTP_GUEST_ADDRESS=192.168.100.50
|
||||
ARTIFACTS="ci-artifacts"
|
||||
# create artifacts folder
|
||||
ARTIFACTS="${ARTIFACTS:=/tmp/artifacts}"
|
||||
mkdir -p "${ARTIFACTS}"
|
||||
|
||||
# Set up temporary files.
|
||||
|
|
@ -303,6 +304,10 @@ sudo restorecon -Rv /var/lib/libvirt/images/
|
|||
greenprint "💿 Creating a cloud-init ISO"
|
||||
gen_iso
|
||||
|
||||
VIRT_LOG="$ARTIFACTS/oscap-sh-virt-install-console.log"
|
||||
touch "$VIRT_LOG"
|
||||
sudo chown qemu:qemu "$VIRT_LOG"
|
||||
|
||||
greenprint "📋 Install baseline image"
|
||||
VIRSH_DOMAIN="${IMAGE_KEY}-baseline"
|
||||
sudo virt-install --name="${VIRSH_DOMAIN}"\
|
||||
|
|
@ -317,7 +322,8 @@ sudo virt-install --name="${VIRSH_DOMAIN}"\
|
|||
--noautoconsole \
|
||||
--nographics \
|
||||
--wait=15 \
|
||||
--noreboot
|
||||
--noreboot \
|
||||
--console pipe,source.path="$VIRT_LOG"
|
||||
|
||||
# Installation can get stuck, destroying VM helps
|
||||
# See https://github.com/osbuild/osbuild-composer/issues/2413
|
||||
|
|
|
|||
|
|
@ -95,6 +95,12 @@ ARTIFACTS="${ARTIFACTS:-/tmp/artifacts}"
|
|||
SSH_DATA_DIR=$(/usr/libexec/osbuild-composer-test/gen-ssh.sh)
|
||||
SSH_KEY=${SSH_DATA_DIR}/id_rsa
|
||||
|
||||
VIRT_LOG="$ARTIFACTS/libvirt_tests-virt-install-console.log"
|
||||
if [ ! -f "$VIRT_LOG" ]; then
|
||||
touch "$VIRT_LOG"
|
||||
fi
|
||||
sudo chown qemu:qemu "$VIRT_LOG"
|
||||
|
||||
# Check for the smoke test file on the AWS instance that we start.
|
||||
smoke_test_check () {
|
||||
# Ensure the ssh key has restricted permissions.
|
||||
|
|
@ -255,7 +261,8 @@ if [[ $ARCH == 'ppc64le' ]]; then
|
|||
--os-variant rhel8-unknown \
|
||||
--noautoconsole \
|
||||
--network network=integration,mac=34:49:22:B0:83:30 \
|
||||
--qemu-commandline="-machine pseries,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,cap-ccf-assist=off,cap-large-decr=off"
|
||||
--qemu-commandline="-machine pseries,cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,cap-ccf-assist=off,cap-large-decr=off" \
|
||||
--console pipe,source.path="$VIRT_LOG"
|
||||
elif [[ $ARCH == 's390x' ]]; then
|
||||
# Our s390x machines are highly constrained on resources.
|
||||
sudo virt-install \
|
||||
|
|
@ -267,7 +274,8 @@ elif [[ $ARCH == 's390x' ]]; then
|
|||
--import \
|
||||
--os-variant rhel8-unknown \
|
||||
--noautoconsole \
|
||||
--network network=integration,mac=34:49:22:B0:83:30
|
||||
--network network=integration,mac=34:49:22:B0:83:30 \
|
||||
--console pipe,source.path="$VIRT_LOG"
|
||||
else
|
||||
case "${ID}-${VERSION_ID}" in
|
||||
"rhel-8"*)
|
||||
|
|
@ -314,7 +322,8 @@ else
|
|||
--os-variant "${OS_VARIANT}" \
|
||||
--noautoconsole \
|
||||
--boot uefi,"${NVRAM_TEMPLATE}" \
|
||||
--network network=integration,mac=34:49:22:B0:83:30
|
||||
--network network=integration,mac=34:49:22:B0:83:30 \
|
||||
--console pipe,source.path="$VIRT_LOG"
|
||||
else
|
||||
sudo virt-install \
|
||||
--name "$IMAGE_KEY" \
|
||||
|
|
@ -325,7 +334,8 @@ else
|
|||
--import \
|
||||
--os-variant "${OS_VARIANT}" \
|
||||
--noautoconsole \
|
||||
--network network=integration,mac=34:49:22:B0:83:30
|
||||
--network network=integration,mac=34:49:22:B0:83:30 \
|
||||
--console pipe,source.path="$VIRT_LOG"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue