summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Peck <bpeck@redhat.com>2014-06-18 16:01:17 -0400
committerBill Peck <bpeck@redhat.com>2014-06-18 16:01:17 -0400
commit28578152b71235ccd3525af39d33879133a37ff1 (patch)
treec59a1a675ee8fd6e8811c6874486c364a0f8eb38
parentb0ebdea3e19299c763e8bfb20f8e8bd9e86b1265 (diff)
downloadtests-28578152b71235ccd3525af39d33879133a37ff1.tar.gz
tests-28578152b71235ccd3525af39d33879133a37ff1.tar.xz
tests-28578152b71235ccd3525af39d33879133a37ff1.zip
Change the boot args for the guest image. Should run the new recipe.
-rwxr-xr-xdistribution/virt/import/runtest.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/distribution/virt/import/runtest.sh b/distribution/virt/import/runtest.sh
index ba8d8e3..958b015 100755
--- a/distribution/virt/import/runtest.sh
+++ b/distribution/virt/import/runtest.sh
@@ -60,6 +60,28 @@ function DeBug ()
fi
}
+function ChangeBootArgs ()
+{
+ DeBug "Enter ChangeBootArgs"
+ IMAGE=$1
+ GUESTRECIPEID=$2
+
+ # FIXME: check for first loop device is free
+
+ mkdir /mnt/boot
+ losetup /dev/loop0 $IMAGE
+ kpartx -a /dev/loop0
+ BOOT=$(blkid -l -o device -t LABEL="/boot")
+ mount $BOOT /mnt/boot
+ # Change recipeid
+ if [ -e "/mnt/boot/grub/grub.conf" ]; then
+ sed -i "s/\(BEAKER_RECIPE_ID=\)[^ ]*/\1$GUESTRECIPEID/" /mnt/boot/grub/grub.conf
+ fi
+ umount /mnt/boot
+ kpartx -d /dev/loop0
+ losetup -d /dev/loop0
+}
+
function SelectKernel ()
{
DeBug "Enter SelectKernel"
@@ -960,6 +982,8 @@ while read -r guest_recipeid guest_name guest_mac guest_args ; do
exit 1
fi
+ ChangeBootArgs $basedir/${guest_name}.img ${guest_recipeid}
+
#bridge=$(ip route list | awk '/^default / { print $NF }' | sed 's/^[^0-9]*//')
#CMDLINE="-b xenbr${bridge} -n ${guestname} -f ${IMAGE} $args"
CMDLINE="--name ${guest_name} --mac ${guest_mac} $guest_args --debug --nographics --noreboot --import"