OSSTest: OVMF test job
v2 cover OSSTest: OVMF test job
RFC v2 of this series
This series implements a basic test job for OVMF guest. The test case will install an OVMF guest and try to boot it.
It is also possible to derive a debian HVM installation test case from ts-ovmf-debian-install - the only difference should be the BIOS option. I tested running the test script without specifying BIOS, it worked fine. I just didn't figure out a sensible way to organize test cases and run jobs.
OVMF will need to build for amd64 target and used with QEMU upstream. Not very sure whether I did the right thing to make-flight and sg-run-job though.
Wei.
Changes in v2:
* factor out preseed_base
* make installation CD work with seabios
Wei Liu (6):
TestSupport.pm: add bios option to guest config file Build OVMF for Xen-unstable
Debian.pm: factor out preseed_base Introduce ts-ovmf-debian-install
make-flight: OVMF test filght
sg-run-job: OVMF job
Osstest/Debian.pm | 129 +++++++++++++++------------- Osstest/TestSupport.pm | 5 ++ make-flight | 16 +++- sg-run-job | 6 ++ ts-ovmf-debian-install | 218 ++++++++++++++++++++++++++++++++++++++++++++++++ ts-xen-build | 6 +- 6 files changed, 319 insertions(+), 61 deletions(-) create mode 100755 ts-ovmf-debian-install
Signature · 1 line
1.7.10.4
RFC PATCH v2 1/6 TestSupport.pm: add bios option to guest config file
--- Osstest/TestSupport.pm | 5 +++++ 1 file changed, 5 insertions(+)
Osstest/TestSupport.pm +5 -0
@@ -1424,6 +1424,11 @@ END $cfg .= "device_model_version='$devmodel'\n"; } + my $bios = $xopts{'Bios'}; + if (defined $bios) { + $cfg .= "bios='$bios'\n"; + } + my $cfgpath= prepareguest_part_xencfg($ho, $gho, $ram_mb, \%xopts, $cfg); target_cmd_root($ho, <<END); (echo $passwd; echo $passwd) | vncpasswd $gho->{Guest}.vncpw
Signature · 1 line
1.7.10.4
RFC PATCH v2 2/6 Build OVMF for Xen-unstable
In reply to Wei Liu--- make-flight | 10 +++++++++- ts-xen-build | 6 +++++- 2 files changed, 14 insertions(+), 2 deletions(-)
make-flight +9 -1
@@ -88,6 +88,14 @@ if [ x$buildflight = x ]; then *) enable_xend=false;; esac + case "$xenbranch" in + xen-3.*-testing) enable_ovmf=false;; + xen-4.0-testing) enable_ovmf=false;; + xen-4.1-testing) enable_ovmf=false;; + xen-4.2-testing) enable_ovmf=false;; + *) enable_ovmf=true; + esac + eval " arch_runvars=\"\$ARCH_RUNVARS_$arch\" "
@@ -95,7 +103,7 @@ if [ x$buildflight = x ]; then build_hostflags=share-build-$suite-$arch,arch-$arch,suite-$suite,purpose-build ./cs-job-create $flight build-$arch build \ - arch=$arch enable_xend=$enable_xend \ + arch=$arch enable_xend=$enable_xend enable_ovmf=$enable_ovmf \ tree_qemu=$TREE_QEMU \ tree_qemuu=$TREE_QEMU_UPSTREAM \ tree_xen=$TREE_XEN \
ts-xen-build +5 -1
@@ -125,14 +125,18 @@ sub build () { ' buildconfigs/enable-xen-config END my $xend_opt= $r{enable_xend} =~ m/true/ ? "--enable-xend" : "--disable-xend"; + my $ovmf_opt= $r{enable_ovmf} =~ m/true/ ? "--enable-ovmf" : "--disable-ovmf"; buildcmd_stamped_logged(300, 'configure', <<END,<<END,<<END); if test -f configure; then if grep -q -- $xend_opt tools/configure ; then xend=$xend_opt fi + if grep -q -- $ovmf_opt tools/configure ; then + ovmf=$ovmf_opt + fi END - ./configure --sysconfdir=/etc \$xend + ./configure --sysconfdir=/etc \$xend \$ovmf END fi END
Signature · 1 line
1.7.10.4
Re: [PATCH RFC V2 2/6] Build OVMF for Xen-unstable
Wei Liu writes ("[PATCH RFC V2 2/6] Build OVMF for Xen-unstable"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
...
Quoted 1 line
+ *) enable_ovmf=true;
This patch has made it into the live version of osstest and can be dropped from your series.
Ian.
Re: [PATCH RFC V2 2/6] Build OVMF for Xen-unstable
Quoted 8 lines · Ian Jackson
Wei Liu writes ("[PATCH RFC V2 2/6] Build OVMF for Xen-unstable"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>...
Quoted 1 line
+ *) enable_ovmf=true;
This patch has made it into the live version of osstest and can be dropped from your series.
I think there's one bit missing in the above patch, we should disable ovmf build for 4.3-testing branch as well.
I'm quite surprised it passed the push gate...
Wei.
Quoted 1 line
Ian.
Re: [PATCH RFC V2 2/6] Build OVMF for Xen-unstable
Quoted 6 lines · Wei Liu
Quoted 5 lines · Ian Jackson
Wei Liu writes ("[PATCH RFC V2 2/6] Build OVMF for Xen-unstable"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>...
Quoted 1 line
+ *) enable_ovmf=true;
Quoted 8 lines
Quoted 3 lines
This patch has made it into the live version of osstest and can be dropped from your series.
I think there's one bit missing in the above patch, we should disable ovmf build for 4.3-testing branch as well.
I'm quite surprised it passed the push gate...
Push gate only tests unstable...
Quoted 4 lines
Wei.
Quoted 1 line
Ian.
Re: [PATCH RFC V2 2/6] Build OVMF for Xen-unstable
Ian Campbell writes ("Re: [PATCH RFC V2 2/6] Build OVMF for Xen-unstable"):
Quoted 7 lines · Wei Liu
Quoted 4 lines
I think there's one bit missing in the above patch, we should disable ovmf build for 4.3-testing branch as well.
I'm quite surprised it passed the push gate...
Push gate only tests unstable...
Oops.
Ian, I'm going to kill the current wheezy attempt and force-push this into pretest. I'll rebase the wheezy stuff and hopefully it can go in tomorrow.
Ian.
Re: [PATCH RFC V2 2/6] Build OVMF for Xen-unstable
Quoted 7 lines · Ian Jackson
Ian Campbell writes ("Re: [PATCH RFC V2 2/6] Build OVMF for Xen-unstable"):
Quoted 6 lines · Wei Liu
Quoted 4 lines
I think there's one bit missing in the above patch, we should disable ovmf build for 4.3-testing branch as well.
I'm quite surprised it passed the push gate...
Quoted 7 lines
Quoted 1 line
Push gate only tests unstable...
Oops.
Ian, I'm going to kill the current wheezy attempt and force-push this into pretest. I'll rebase the wheezy stuff and hopefully it can go in tomorrow.
OK, I'll expect cron spam then ;-)
Quoted 2 lines
Ian.
RFC PATCH v2 3/6 Debian.pm: factor out preseed_base
In reply to Wei Liu--- Osstest/Debian.pm | 129 +++++++++++++++++++++++++++++------------------------ 1 file changed, 70 insertions(+), 59 deletions(-)
Osstest/Debian.pm +70 -59
@@ -33,6 +33,7 @@ BEGIN { @ISA = qw(Exporter); @EXPORT = qw(debian_boot_setup %preseed_cmds + preseed_base preseed_create preseed_hook_command preseed_hook_installscript di_installcmdline_core
@@ -432,7 +433,73 @@ sub di_installcmdline_core ($$;@) { if defined $debconf_priority; return @cl; -} +} + +sub preseed_base ($) { + my ($suite) = @_; + + return <<'END'; +d-i mirror/suite string $suite + +d-i debian-installer/locale string en_GB +d-i console-keymaps-at/keymap select gb +d-i keyboard-configuration/xkb-keymap string en_GB + +#d-i debconf/frontend string readline + +d-i mirror/country string manual +d-i mirror/http/proxy string + +d-i clock-setup/utc boolean true +d-i time/zone string Europe/London +d-i clock-setup/ntp boolean true + +d-i partman-md/device_remove_md boolean true +d-i partman-lvm/device_remove_lvm boolean true +d-i partman-partitioning/confirm_write_new_label boolean true +d-i partman/choose_partition select finish +d-i partman/confirm boolean true +d-i partman-lvm/confirm boolean true + +d-i partman/confirm_nooverwrite true +d-i partman-lvm/confirm_nooverwrite true +d-i partman-md/confirm_nooverwrite true +d-i partman-crypto/confirm_nooverwrite true + +#d-i netcfg/disable_dhcp boolean true +d-i netcfg/get_nameservers string $c{NetNameservers} +#d-i netcfg/get_netmask string \$c{NetNetmask} +#d-i netcfg/get_gateway string \$c{NetGateway} +d-i netcfg/confirm_static boolean true +d-i netcfg/get_domain string $c{TestHostDomain} +d-i netcfg/wireless_wep string + +d-i passwd/root-password password xenroot +d-i passwd/root-password-again password xenroot +d-i passwd/user-fullname string FLOSS Xen Test +d-i passwd/username string osstest +d-i passwd/user-password password osstest +d-i passwd/user-password-again password osstest + +console-common console-data/keymap/policy select Don't touch keymap +console-data console-data/keymap/policy select Don't touch keymap +console-data console-data/keymap/family select qwerty +console-data console-data/keymap/template/layout select British + +popularity-contest popularity-contest/participate boolean false +tasksel tasksel/first multiselect standard, web-server + +d-i grub-installer/only_debian boolean true + +d-i finish-install/keep-consoles boolean true +d-i finish-install/reboot_in_progress note +d-i cdrom-detect/eject boolean false + +d-i mirror/http/hostname string $c{DebianMirrorHost} +d-i mirror/http/directory string /$c{DebianMirrorSubpath} + +END +} sub preseed_create ($$;@) { my ($ho, $sfx, %xopts) = @_;
@@ -619,45 +686,12 @@ END my $extra_packages = join(",",@extra_packages); - my $preseed_file= (<<END); -d-i mirror/suite string $suite - -d-i debian-installer/locale string en_GB -d-i console-keymaps-at/keymap select gb -d-i keyboard-configuration/xkb-keymap string en_GB - -#d-i debconf/frontend string readline - -d-i mirror/country string manual -d-i mirror/http/proxy string - -d-i clock-setup/utc boolean true -d-i time/zone string Europe/London -d-i clock-setup/ntp boolean true + my $preseed_file= preseed_base($suite); + $preseed_file .= (<<END); d-i partman-auto/method string lvm #d-i partman-auto/method string regular -d-i partman-md/device_remove_md boolean true -d-i partman-lvm/device_remove_lvm boolean true -d-i partman-partitioning/confirm_write_new_label boolean true -d-i partman/choose_partition select finish -d-i partman/confirm boolean true -d-i partman-lvm/confirm boolean true - -d-i partman/confirm_nooverwrite true -d-i partman-lvm/confirm_nooverwrite true -d-i partman-md/confirm_nooverwrite true -d-i partman-crypto/confirm_nooverwrite true - -#d-i netcfg/disable_dhcp boolean true -d-i netcfg/get_nameservers string $c{NetNameservers} -#d-i netcfg/get_netmask string \$c{NetNetmask} -#d-i netcfg/get_gateway string \$c{NetGateway} -d-i netcfg/confirm_static boolean true -d-i netcfg/get_domain string $c{TestHostDomain} -d-i netcfg/wireless_wep string - #d-i partman-auto/init_automatically_partition select regular d-i partman-auto/disk string $disk
@@ -685,32 +719,9 @@ d-i partman-auto/expert_recipe string \\ lv_name{ dummy } \\ . -d-i passwd/root-password password xenroot -d-i passwd/root-password-again password xenroot -d-i passwd/user-fullname string FLOSS Xen Test -d-i passwd/username string osstest -d-i passwd/user-password password osstest -d-i passwd/user-password-again password osstest - -console-common console-data/keymap/policy select Don't touch keymap -console-data console-data/keymap/policy select Don't touch keymap -console-data console-data/keymap/family select qwerty -console-data console-data/keymap/template/layout select British - -popularity-contest popularity-contest/participate boolean false -tasksel tasksel/first multiselect standard, web-server d-i pkgsel/include string openssh-server, ntp, ntpdate, $extra_packages -d-i grub-installer/only_debian boolean true - -d-i finish-install/keep-consoles boolean true -d-i finish-install/reboot_in_progress note -d-i cdrom-detect/eject boolean false - -d-i mirror/http/hostname string $c{DebianMirrorHost} -d-i mirror/http/directory string /$c{DebianMirrorSubpath} - $xopts{ExtraPreseed} END
Signature · 1 line
1.7.10.4
Re: [PATCH RFC V2 3/6] Debian.pm: factor out preseed_base
Wei Liu writes ("[PATCH RFC V2 3/6] Debian.pm: factor out preseed_base"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
Re: [PATCH RFC V2 3/6] Debian.pm: factor out preseed_base
In reply to Wei LiuWei Liu writes ("[PATCH RFC V2 3/6] Debian.pm: factor out preseed_base"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
It occurs to me to ask:
Osstest/Debian.pm END · line 693
Quoted 7 lines
Osstest/Debian.pm +2
-2-d-i time/zone string Europe/London -d-i clock-setup/ntp boolean true + my $preseed_file= preseed_base($suite); + $preseed_file .= (<<END); d-i partman-auto/method string lvm #d-i partman-auto/method string regular
Why do you not put the base at the start of the preseed file ?
Ian.
Re: [PATCH RFC V2 3/6] Debian.pm: factor out preseed_base
Quoted 9 lines · Ian Jackson
Wei Liu writes ("[PATCH RFC V2 3/6] Debian.pm: factor out
preseed_base"):Quoted 1 line
Signed-off-by Wei Liu <[email protected]>It occurs to me to ask:
Quoted 4 lines
Osstest/Debian.pm +1
-2-d-i time/zone string Europe/London -d-i clock-setup/ntp boolean true + my $preseed_file= preseed_base($suite);
Quoted 6 lines
Quoted 3 lines
+ $preseed_file .= (<<END);
d-i partman-auto/method string lvm
#d-i partman-auto/method string regularWhy do you not put the base at the start of the preseed file ?
What do you mean? Data generated by preseed_base is at the start of preseed file.
Wei.
Quoted 1 line
Ian.
Re: [PATCH RFC V2 3/6] Debian.pm: factor out preseed_base
Wei Liu writes ("Re: [PATCH RFC V2 3/6] Debian.pm: factor out preseed_base"):
Quoted 6 lines · Ian Jackson
Quoted 2 lines
Why do you not put the base at the start of the preseed file ?
What do you mean? Data generated by
preseed_baseis at the start of preseed file.
I mean "I didn't read your diff carefully enough". Sorry!
Ian.
RFC PATCH v2 4/6 Introduce ts-ovmf-debian-install
In reply to Wei LiuThis is OVMF guest test case. It resembles ts-redhat-install:
1. prepare a auto install CD
2. install OVMF guest
3. test if the guets is up
The installtion CD is also bootable with seabios.
--- ts-ovmf-debian-install | 218 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100755 ts-ovmf-debian-install
ts-ovmf-debian-install new file +218 -0
@@ -0,0 +1,218 @@ +#!/usr/bin/perl -w +# This is part of "osstest", an automated testing framework for Xen. +# Copyright (C) 2009-2013 Citrix Inc. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +use strict qw(vars); +use DBI; +use Osstest; +use Osstest::Debian; +use Osstest::TestSupport; + +tsreadconfig(); + +our $stage=0; +if (@ARGV && $ARGV[0] =~ m/^--stage(\d+)$/) { $stage=$1; shift @ARGV; } + +our ($whhost,$gn) = @ARGV; +$whhost ||= 'host'; +$gn ||= 'ovmf'; + +our $ho= selecthost($whhost); + +our $ram_mb= 768; +our $disk_mb= 10000; + +our $guesthost= "$gn.guest.osstest"; +our $gho; + +our $xl= toolstack()->{Command}; + + +sub preseed () { + + my $preseed_file = preseed_base('wheezy'); + + $preseed_file .= (<<END); +d-i netcfg/get_hostname string debian-hvm + +d-i partman-auto/disk string /dev/xvda +d-i partman-auto/method string regular + +d-i partman-auto/expert_recipe string \\ + boot-root :: \\ + 512 50 512 vfat \\ + \$primary{ } \$bootable{ } \\ + method{ efi } format{ } \\ + use_filesystem{ } filesystem{ vfat } \\ + mountpoint{ /boot/efi } \\ + . \\ + 5000 50 5000 ext4 \\ + method{ format } format{ } \\ + use_filesystem{ } filesystem{ ext4 } \\ + mountpoint{ / } \\ + . \\ + 512 30 100% linux-swap \\ + method{ swap } format{ } \\ + . + +d-i apt-setup/use_mirror boolean false +d-i apt-setup/another boolean false +d-i apt-setup/non-free boolean false +d-i apt-setup/contrib boolean false +d-i apt-setup/cdrom/set-first boolean false + +d-i pkgsel/include string openssh-server, ntp, ntpdate, + +d-i preseed/early_command string + +d-i preseed/late_command string \\ + in-target mkdir -p /boot/efi/EFI/boot; \\ + in-target cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/boot/bootx64.efi ;\\ + in-target mkdir -p /root/.ssh; \\ + cp /authorized_keys /target/root/.ssh + +d-i clock-setup/ntp-server string ntp.uk.xensource.com + +END + return $preseed_file; +} + +sub grub_cfg () { + + return <<"END"; +set default="0" +set timeout=5 + +menuentry 'OVMF guest auto Install' { + linux /install.amd/vmlinuz console=vga console=ttyS0,115200n8 preseed/file=/preseed.cfg + initrd /install.amd/initrd.gz +} +END +} + +sub isolinux_cfg () { + return <<"END"; + default autoinstall + prompt 0 + timeout 0 + + label autoinstall + kernel /install.amd/vmlinuz + append video=vesa:ywrap,mtrr vga=788 console=ttyS0,115200n8 preseed/file=/preseed.cfg initrd=/install.amd/initrd.gz +END +} + +our $emptyiso= '/root/empty.iso'; + +sub prep () { + target_install_packages_norec($ho, qw(lvm2 rsync xorriso genisoimage)); + + my $isotimeout= 600; + + $gho= prepareguest($ho, $gn, $guesthost, 22, + $disk_mb + 1, + 100); + + my $newiso= '/root/newiso'; + my $emptydir= '/root/empty-dir'; + my $initrddir= '/root/initrd-dir'; + + my @isogen_base= qw(-R -J -T); + my @xorriso_opts= qw(-as mkisofs + -r + -b isolinux/isolinux.bin + -c isolinux/boot.cat + -no-emul-boot + -boot-load-size 4 + -boot-info-table + -eltorito-alt-boot + -e boot/grub/efi.img + -no-emul-boot); + + target_putfilecontents_root_stash($ho, 10, preseed(), + "/root/guest-preseed"); + target_putfilecontents_root_stash($ho, 10, authorized_keys(), + "/root/guest-authkeys"); + target_cmd_root($ho, <<END, 60); + mkdir -p $emptydir + genisoimage -o $emptyiso @isogen_base $emptydir/. +END + + more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, + OnReboot => 'preserve', + Bios => 'ovmf', + PostImageHook => sub { + target_cmd_root($ho, <<END, $isotimeout); + set -x + umount /mnt ||: + rm -rf $newiso + mount -o loop -r $gho->{Rimage} /mnt + mkdir $newiso + cp -a /mnt/. $newiso/. + umount /mnt + rm -rf $initrddir + mkdir $initrddir + cd $initrddir + gzip -d \< $newiso/install.amd/initrd.gz | cpio --extract --make-directories --no-absolute-filename + cp /root/guest-preseed preseed.cfg + cp /root/guest-authkeys authorized_keys + find . | cpio -H newc --create | gzip -9 \> $newiso/install.amd/initrd.gz + cd - + rm -rf $initrddir + cd $newiso + md5sum `find -follow -type f` \> md5sum.txt + cd - +END + target_putfilecontents_root_stash($ho, 10, grub_cfg(), + "$newiso/debian/boot/grub/grub.cfg"); + + target_putfilecontents_root_stash($ho, 10, isolinux_cfg(), + "$newiso/isolinux/isolinux.cfg"); + + target_cmd_root($ho, <<END, $isotimeout); + xorriso @xorriso_opts -o $gho->{Rimage} $newiso/. +END + }); +} + +sub start () { + target_cmd_root($ho, "$xl create $gho->{CfgPath}", 100); +} + +sub rewrite_config_nocd () { + guest_editconfig($ho, $gho, sub { + if (m/^\s*disk\s*\=/ .. /\]/) { + s/\Q$gho->{Rimage}\E/$emptyiso/; + } + s/^on_reboot.*/on_reboot='restart'/; + }); +} + +if (!$stage) { + prep(); + start(); +} else { + $gho= selectguest($gn,$gho); +} +if ($stage<2) { + guest_await_reboot($ho,$gho,2000); + guest_destroy($ho,$gho); +} + +rewrite_config_nocd(); +start(); +guest_await_dhcp_tcp($gho,300); +guest_check_up($gho);
Signature · 1 line
1.7.10.4
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
ts-ovmf-debian-install line 194
Quoted 10 lines · Wei Liu
ts-ovmf-debian-install new file +4
-0+sub start () { + target_cmd_root($ho, "$xl create $gho->{CfgPath}", 100); +} +
Something like "toolstack()->{Command}" instead of "xl" ?
I don't know how important this is, though, as I don't think this has much chances to work with xend, has it?
ts-ovmf-debian-install line 218
Quoted 5 lines
ts-ovmf-debian-install new file +4
-0+rewrite_config_nocd(); +start(); +guest_await_dhcp_tcp($gho,300); +guest_check_up($gho);
Does this mean that the guest remains up after the end of the test? This is also probably not a big deal, but, shouldn't we tear it down?
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
Quoted 7 lines · Dario Faggioli
Quoted 5 lines · Wei Liu
ts-ovmf-debian-install new file +0
-0
Quoted 6 lines
ts-ovmf-debian-install line 194
Quoted 4 lines
ts-ovmf-debian-install new file +4
-0+sub start () { + target_cmd_root($ho, "$xl create $gho->{CfgPath}", 100); +} +Something like "toolstack()->{Command}" instead of "xl" ?
$xl is in fact toolstack()->{Command}.
Quoted 3 lines
I don't know how important this is, though, as I don't think this has much chances to work with xend, has it?
No. Xend is deprecated so I don't bother fiddling with that.
However this doesn't prevent people using Xend from using OVMF. It's just firmware after all.
Quoted 8 lines
ts-ovmf-debian-install line 218
Quoted 5 lines
ts-ovmf-debian-install new file +4
-0+rewrite_config_nocd(); +start(); +guest_await_dhcp_tcp($gho,300); +guest_check_up($gho);Does this mean that the guest remains up after the end of the test? This is also probably not a big deal, but, shouldn't we tear it down?
I copied this from ts-redhat-install.
My guess would be we might need to check if there's anything wrong with DomU, especially when test fails. Destroying DomU will wipe out useful information.
Wei.
Quoted 9 lines
Regards,
DarioSignature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
Quoted 8 lines · Wei Liu
Quoted 7 lines · Dario Faggioli
Quoted 5 lines · Wei Liu
ts-ovmf-debian-install new file +0
-0
Quoted 9 lines
Quoted 6 lines
ts-ovmf-debian-install line 194
Quoted 4 lines
ts-ovmf-debian-install new file +4
-0+sub start () { + target_cmd_root($ho, "$xl create $gho->{CfgPath}", 100); +} +Something like "toolstack()->{Command}" instead of "xl" ?
$xl is in fact toolstack()->{Command}.
I know.
Quoted 6 lines
Quoted 3 lines
I don't know how important this is, though, as I don't think this has much chances to work with xend, has it?
No. Xend is deprecated so I don't bother fiddling with that.
Ok. I was also thinking that keeping these things general and abstract enough would be better if, at some point, we'd like to intdocude other toolstack (e.g., virsh/libvirt). However, changes will be needed anyway, e.g., to the "create" part... so, yeah, I guess this is a non issue.
Quoted 6 lines
Quoted 3 lines
Does this mean that the guest remains up after the end of the test? This is also probably not a big deal, but, shouldn't we tear it down?
I copied this from ts-redhat-install.
You're right, sorry for this. I thought I see gests being teared down somewhere, but just finished running a (similar) test myself, and the guest is up.
Sorry again for the noise. :-)
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
Quoted 24 lines · Dario Faggioli
Quoted 8 lines · Wei Liu
Quoted 7 lines · Dario Faggioli
Quoted 5 lines · Wei Liu
ts-ovmf-debian-install new file +0
-0Quoted 9 lines
Quoted 6 lines
ts-ovmf-debian-install line 194
Quoted 4 lines
ts-ovmf-debian-install new file +4
-0+sub start () { + target_cmd_root($ho, "$xl create $gho->{CfgPath}", 100); +} +Something like "toolstack()->{Command}" instead of "xl" ?
$xl is in fact toolstack()->{Command}.
I know.
Quoted 4 lines
Quoted 3 lines
I don't know how important this is, though, as I don't think this has much chances to work with xend, has it?
Quoted 7 lines
Quoted 2 lines
No. Xend is deprecated so I don't bother fiddling with that.
Ok. I was also thinking that keeping these things general and abstract enough would be better if, at some point, we'd like to intdocude other toolstack (e.g., virsh/libvirt). However, changes will be needed anyway, e.g., to the "create" part... so, yeah, I guess this is a non issue.
Correct. If we are to support more toolstack there's certainly more work to do...
Quoted 4 lines
Quoted 4 lines
Quoted 3 lines
Does this mean that the guest remains up after the end of the test? This is also probably not a big deal, but, shouldn't we tear it down?
Quoted 8 lines
Quoted 2 lines
I copied this from ts-redhat-install.
You're right, sorry for this. I thought I see gests being teared down somewhere, but just finished running a (similar) test myself, and the guest is up.
Sorry again for the noise. :-)
Not at all. It's not noise. Thanks for reviewing.
Wei.
Quoted 9 lines
Regards,
DarioSignature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
In reply to Dario FaggioliDario Faggioli writes ("Re: [Xen-devel] [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install"):
Quoted 4 lines · Wei Liu
Quoted 1 line
$xl is in fact toolstack()->{Command}.
I know.
So err, I'm not sure what your point was. Wei's code seems correct to me.
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
I don't know how important this is, though, as I don't think this has much chances to work with xend, has it?
No. Xend is deprecated so I don't bother fiddling with that.
I think it's better to be consistent and always use toolstack()->{Command} even in tests which aren't going to work with xend.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Does this mean that the guest remains up after the end of the test? This is also probably not a big deal, but, shouldn't we tear it down?
I copied this from ts-redhat-install.
You're right, sorry for this. I thought I see gests being teared down somewhere, but just finished running a (similar) test myself, and the guest is up.
Whether the script leaves the guest up is a matter for the individual script. ts-debian-install && ts-debian-fixup leaves it down, but most of the other ts-*-install scripts leave it up. I don't think an install script should do a shutdown just to provide a uniform interface.
The corresponding knowledge of whether to run start or not is in sg-run-job.
Thanks,
Ian.
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
Quoted 9 lines · Ian Jackson
Dario Faggioli writes ("Re: [Xen-devel] [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install"):
Quoted 4 lines · Wei Liu
Quoted 1 line
$xl is in fact toolstack()->{Command}.
I know.
So err, I'm not sure what your point was. Wei's code seems correct to me.
My point was that, even if it's obviously true that toolstack()->{Command}==xl, and hence Wei's code looks correct to me too, we better use toolstack()->{Command}.
Quoted 9 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines
I don't know how important this is, though, as I don't think this has much chances to work with xend, has it?
No. Xend is deprecated so I don't bother fiddling with that.
I think it's better to be consistent and always use toolstack()->{Command} even in tests which aren't going to work with xend.
So, err... Exactly my point. :-)
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
In reply to Wei LiuWei Liu writes ("[PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install"):
Quoted 1 line
This is OVMF guest test case. It resembles ts-redhat-install:
Thanks. This is coming along but it still has too much clone-and-hack in it. All duplicated code should be factored out into TestSupport.pm or Debian.pm.
ts-ovmf-debian-install line 49
Quoted 2 lines
ts-ovmf-debian-install new file +2
-0+ $preseed_file .= (<<END); +d-i netcfg/get_hostname string debian-hvm
This string should presumably be the guest ident or something.
Quoted 1 line
+d-i apt-setup/use_mirror boolean false
I think you need to use the mirror as specified for host installs, so I think you need to move the mirror stuff into preseed_base.
Quoted 1 line
+d-i pkgsel/include string openssh-server, ntp, ntpdate,
This is mostly common with preseed_create, so should be there. You will probably need to pass the xopts to preseed_base.
ts-ovmf-debian-install line 83
Quoted 5 lines
ts-ovmf-debian-install new file +5
-0+d-i preseed/early_command string + +d-i preseed/late_command string \\ + in-target mkdir -p /boot/efi/EFI/boot; \\ + in-target cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/boot/bootx64.efi ;\\
Yuk.
ts-ovmf-debian-install line 85
Quoted 2 lines
ts-ovmf-debian-install new file +2
-0+ in-target mkdir -p /root/.ssh; \\ + cp /authorized_keys /target/root/.ssh
There's already machinery for doing this (rather differently) in preseed-create. Surely you should use it ?
Quoted 1 line
+d-i clock-setup/ntp-server string ntp.uk.xensource.com
Firstly, if this is needed it should be in preseed-base. Secondly the hardcoded xensource.com is right out!
ts-ovmf-debian-install line 146
Quoted 2 lines
ts-ovmf-debian-install new file +2
-0+ target_putfilecontents_root_stash($ho, 10, preseed(), + "/root/guest-preseed");
These pathnames would ideally have the flight and job in them. Doing so will make it easier to run multiple tests on the same host install. (Yes, I know that the ts-redhat-install script doesn't do that.)
ts-ovmf-debian-install line 152
Quoted 4 lines
ts-ovmf-debian-install new file +4
-0+ target_cmd_root($ho, <<END, 60); + mkdir -p $emptydir + genisoimage -o $emptyiso @isogen_base $emptydir/. +END
This is straight clone-and-hack from ts-redhat-install.
ts-ovmf-debian-install line 165
Quoted 12 lines
ts-ovmf-debian-install new file +12
-0+ more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, + OnReboot => 'preserve', + Bios => 'ovmf', + PostImageHook => sub { + target_cmd_root($ho, <<END, $isotimeout); + set -x + umount /mnt ||: + rm -rf $newiso + mount -o loop -r $gho->{Rimage} /mnt + mkdir $newiso + cp -a /mnt/. $newiso/. + umount /mnt
More clone-and-hack from ts-redhat-install.
Quoted 1 line
+ md5sum
find -follow -type f\> md5sum.txt
This should probably use find -print0 | xargs -0.
Quoted 14 lines
ts-ovmf-debian-install new file +14
-0+sub rewrite_config_nocd () { + guest_editconfig($ho, $gho, sub { + if (m/^\s*disk\s*\=/ .. /\]/) { + s/\Q$gho->{Rimage}\E/$emptyiso/; + } + s/^on_reboot.*/on_reboot='restart'/; + }); +} + +if (!$stage) { + prep(); + start(); +} else { + $gho= selectguest($gn,$gho);
ts-ovmf-debian-install line 218
Quoted 10 lines
ts-ovmf-debian-install new file +10
-0+} +if ($stage<2) { + guest_await_reboot($ho,$gho,2000); + guest_destroy($ho,$gho); +} + +rewrite_config_nocd(); +start(); +guest_await_dhcp_tcp($gho,300); +guest_check_up($gho);
More clone and hack.
Thanks,
Ian.
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
The comment on preseed file makes sense to me.
My main question is wether you're suggesting I factor out a script call ts-hvm-install then calls it from ts-redhat-install and ts-debian-hvm-install?
Wei.
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
Wei Liu writes ("Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install"):
Quoted 5 lines
The comment on preseed file makes sense to me.
My main question is wether you're suggesting I factor out a script call ts-hvm-install then calls it from ts-redhat-install and ts-debian-hvm-install?
No, I think you should probably make additional perl functions in TestSupport.pm and/or Debian.pm.
Doing this as a separate script is going to be very tricky because you will want to specify complicated things as its arguments (for example, perhaps you will want some of the common code to take coderefs as hook-style callbacks).
Ian.
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
In reply to Ian JacksonQuoted 30 lines · Ian Jackson
Wei Liu writes ("[PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install"):
Quoted 1 line
This is OVMF guest test case. It resembles ts-redhat-install:
Thanks. This is coming along but it still has too much clone-and-hack in it. All duplicated code should be factored out into TestSupport.pm or Debian.pm.
ts-ovmf-debian-install line 49
Quoted 2 lines
ts-ovmf-debian-install new file +2
-0+ $preseed_file .= (<<END); +d-i netcfg/get_hostname string debian-hvmThis string should presumably be the guest ident or something.
Quoted 1 line
+d-i apt-setup/use_mirror boolean false
I think you need to use the mirror as specified for host installs, so I think you need to move the mirror stuff into
preseed_base.Quoted 1 line
+d-i pkgsel/include string openssh-server, ntp, ntpdate,
This is mostly common with
preseed_create, so should be there. You will probably need to pass the xopts topreseed_base.ts-ovmf-debian-install line 83
Quoted 5 lines
ts-ovmf-debian-install new file +5
-0+d-i preseed/early_command string + +d-i preseed/late_command string \\ + in-target mkdir -p /boot/efi/EFI/boot; \\ + in-target cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/boot/bootx64.efi ;\\Yuk.
Quoted 6 lines
ts-ovmf-debian-install line 85
Quoted 2 lines
ts-ovmf-debian-install new file +2
-0+ in-target mkdir -p /root/.ssh; \\ + cp /authorized_keys /target/root/.sshThere's already machinery for doing this (rather differently) in preseed-create. Surely you should use it ?
Using the web infrastructure for this looks overkill. I've replaced this part with a call to 'echo -e $authkeys > authorized_keys', elimiating the need for extra file.
Wei.
Re: [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install
Quoted 38 lines · Wei Liu
Quoted 30 lines · Ian Jackson
Wei Liu writes ("[PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install"):
Quoted 1 line
This is OVMF guest test case. It resembles ts-redhat-install:
Thanks. This is coming along but it still has too much clone-and-hack in it. All duplicated code should be factored out into TestSupport.pm or Debian.pm.
ts-ovmf-debian-install line 49
Quoted 2 lines
ts-ovmf-debian-install new file +2
-0+ $preseed_file .= (<<END); +d-i netcfg/get_hostname string debian-hvmThis string should presumably be the guest ident or something.
Quoted 1 line
+d-i apt-setup/use_mirror boolean false
I think you need to use the mirror as specified for host installs, so I think you need to move the mirror stuff into
preseed_base.Quoted 1 line
+d-i pkgsel/include string openssh-server, ntp, ntpdate,
This is mostly common with
preseed_create, so should be there. You will probably need to pass the xopts topreseed_base.ts-ovmf-debian-install line 83
Quoted 5 lines
ts-ovmf-debian-install new file +5
-0+d-i preseed/early_command string + +d-i preseed/late_command string \\ + in-target mkdir -p /boot/efi/EFI/boot; \\ + in-target cp /boot/efi/EFI/debian/grubx64.efi /boot/efi/EFI/boot/bootx64.efi ;\\Yuk.
Quoted 6 lines
ts-ovmf-debian-install line 85
Quoted 2 lines
ts-ovmf-debian-install new file +2
-0+ in-target mkdir -p /root/.ssh; \\ + cp /authorized_keys /target/root/.sshThere's already machinery for doing this (rather differently) in preseed-create. Surely you should use it ?
Quoted 4 lines
Using the web infrastructure for this looks overkill. I've replaced this part with a call to 'echo -e $authkeys >
authorized_keys', elimiating the need for extra file.
Phew, it didn't work. The rune failed to run as d-i late_command. Will need to look for another way to do this.
Wei.
Quoted 1 line
Wei.
RFC PATCH v2 5/6 make-flight: OVMF test filght
In reply to Wei Liu--- make-flight | 6 ++++++ 1 file changed, 6 insertions(+)
make-flight +6 -0
@@ -418,7 +418,13 @@ for xenarch in ${TEST_ARCHES- i386 amd64 armhf } ; do test-win xl $qemuu_runvar \ win_image=win7-x64.iso \ all_hostflags=$most_hostflags,hvm + fi + if [ $xenarch = amd64 -a "x$qemuu_suffix" = "x-qemuu" ]; then + job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-ovmf-amd64 \ + test-debianhvm xl $qemuu_runvar \ + ovmf_image=debian-7.2.0-amd64-CD-1.iso \ + all_hostflags=$most_hostflags,hvm fi if [ $xenarch = amd64 -a $dom0arch = i386 -a "$kern" = "" ]; then
Signature · 1 line
1.7.10.4
Re: [PATCH RFC V2 5/6] make-flight: OVMF test filght
Wei Liu writes ("[PATCH RFC V2 5/6] make-flight: OVMF test filght"):
Quoted 1 line
+
job_create_testtest-$xenarch$kern-$dom0arch-xl$qemuu_suffix-ovmf-amd64 \
I haven't checked the implications of this but when I take this series I'll probably mess with it. I hope that's OK :-).
Thanks,
Ian.
RFC PATCH v2 6/6 sg-run-job: OVMF job
In reply to Wei Liu--- sg-run-job | 6 ++++++ 1 file changed, 6 insertions(+)
sg-run-job +6 -0
@@ -264,6 +264,12 @@ proc run-job/test-rhelhvm {} { test-guest-nomigr redhat } +proc need-hosts/test-debianhvm {} { return host } +proc run-job/test-debianhvm {} { + run-ts . = ts-ovmf-debian-install + test-guest ovmf +} + proc need-hosts/test-pair {} { return {src_host dst_host} } proc run-job/test-pair {} { run-ts . = ts-debian-install dst_host
Signature · 1 line
1.7.10.4
Re: [PATCH RFC V2 6/6] sg-run-job: OVMF job
Wei Liu writes ("[PATCH RFC V2 6/6] sg-run-job: OVMF job"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
...
sg-run-job proc run-job/test-rhelhvm {} { · line 271
Quoted 5 lines
sg-run-job +5
-0+proc need-hosts/test-debianhvm {} { return host } +proc run-job/test-debianhvm {} { + run-ts . = ts-ovmf-debian-install + test-guest ovmf +}
Perhaps "ts-ovmf-debian-install" should be called
"ts-debian-hvm-install" ?
Ian.
Re: [PATCH RFC V2 6/6] sg-run-job: OVMF job
Quoted 12 lines · Ian Jackson
Wei Liu writes ("[PATCH RFC V2 6/6] sg-run-job: OVMF job"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>...
sg-run-job proc run-job/test-rhelhvm {} { · line 271
Quoted 5 lines
sg-run-job +5
-0+proc need-hosts/test-debianhvm {} { return host } +proc run-job/test-debianhvm {} { + run-ts . = ts-ovmf-debian-install + test-guest ovmf +}Perhaps "ts-ovmf-debian-install" should be called
"ts-debian-hvm-install" ?
That would work as well. I don't have strong preference on naming stuffs.
Wei.
Quoted 1 line
Ian.