This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
WIP: iso-sanity: New test for ISO installs #89
Open
cgwalters
wants to merge
1
commit into
projectatomic:master
Choose a base branch
from
cgwalters:iso-sanity
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+45
−0
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Run `virt-install` to install an ISO using both BIOS and EFI. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
set -xeuo pipefail | ||
ISO=$1 | ||
shift | ||
dn=$(dirname $0) | ||
|
||
tempdir=$(mktemp -d /var/tmp/isosanity.XXXXX) | ||
function cleanup () { | ||
fusermount -u ${tempdir}/mnt || true | ||
rm "${tempdir}" -rf | ||
} | ||
trap cleanup EXIT | ||
|
||
export LIBGUESTFS_BACKEND=direct | ||
mkdir ${tempdir}/mnt | ||
guestmount --ro -a ${ISO} -m /dev/sda1 ${tempdir}/mnt | ||
(cd ${tmpdir}/mnt && python -m SimpleHTTPServer 0 >../httpd.txt) | ||
success=false | ||
# FIXME - detect from libvirt/define our own? | ||
hostip=192.168.122.1 | ||
for x in $(seq 30); do | ||
sed -e s',Serving HTTP on 0.0.0.0 port \([0-9]*\) \.\.\.,\1,' < ${tempdir}/httpd.txt > ${tempdir}/port.txt | ||
if cmp ${tempdir}/httpd.txt ${tempdir}/port.txt; then | ||
port=$(tr -d '\n' < ${tempdir}/port.txt) | ||
if curl "http://${hostip}:${port}"; then | ||
success=true | ||
break | ||
fi | ||
fi | ||
sleep 0.1 | ||
done | ||
if !${success}; then | ||
echo "Failed to wait for http server" | ||
exit 1 | ||
fi | ||
|
||
# --initrd-inject ${dn}/default.ks --extra-args=inst.ks=file:/default.ks | ||
base_args="--ram 3192 --vcpus 4 --disk size=20 --os-variant rhel7 --location http://${hostip}:${port}/" | ||
|
||
virsh -c qemu:///system undefine isosanity-efi || true | ||
virt-install ${base_args} --name isosanity-efi --boot uefi | ||
virsh -c qemu:///system undefine isosanity-bios || true | ||
virt-install ${base_args} --name isosanity-bios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
%include /usr/share/anaconda/interactive-defaults.ks |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I'm guessing we don't have to specify a ks here because anaconda automatically falls back on the default one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do need the above bits, but this was me trying to debug why it doesn't work even if we don't inject a kickstart. That appears to be an anaconda behavioral change when booted from ISO vs network.