OSSTest: OVMF test job
v5 cover OSSTest: OVMF test job
Round 5 of this series.
The first one in a new patch to fix a bug in standalone-reset.
This series was tested with OSSTest standalone mode:
$ sg-run-job build-amd64 $ OSSTEST_HOST_REUSE=1 sg-run-job build-amd64-pvops $ JOBNAME=test-amd64-amd64-xl-qemuu-ovmf-amd64 ts-debain-hvm-install host=cam-st12
Wei.
Changes in v5:
* rebase on top of master branch
* rename ISO related functions
* minor changes to ts-debain-hvm-install
* make-flight output attached
Changes in v4:
* rebase on top of master branch
* ditch genisoimage and switch to xorriso
* factor out even more common code
Changes in v3:
* consolidate more config items into preseed_base
* ts-ovmf-debian-install -> ts-debian-hvm-install
* factor out functions to create ISOs.
* $xl -> $toolstack in test case script
Changes in v2:
* factor out preseed_base
* make installation CD work with seabios
Wei Liu (13):
standalone-reset: fix typo
TestSupport.pm: add bios option to guest config file TestSupport.pm: introduce iso_create_xorriso TestSupport.pm: move rewrite_config_nocd to support library TestSupport.pm: introduce guest_create
ts-redhat-install: use $flight, $job and $gn when creating iso TestSupport.pm: introduce iso_create_empty TestSupport.pm: introduce iso_gen_flags_basic TestSupport.pm: introduce iso_copy_content_from_image Debian.pm: factor out preseed_base
Introduce ts-debian-hvm-install
sg-run-job: OVMF job
make-flight: OVMF test flight
Osstest/Debian.pm | 143 ++++++++++++++++++++----------------- Osstest/TestSupport.pm | 74 +++++++++++++++++++- make-flight | 13 ++++ sg-run-job | 6 ++ standalone-reset | 2 +- ts-debian-hvm-install | 183 ++++++++++++++++++++++++++++++++++++++++++++++++ ts-redhat-install | 54 +++----------- 7 files changed, 366 insertions(+), 109 deletions(-) create mode 100755 ts-debian-hvm-install
Signature · 1 line
1.7.10.4
PATCH v5 1/13 standalone-reset: fix typo
The script name is sa-init-db not sa-db-init.
--- standalone-reset | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
standalone-reset +1 -1
@@ -133,7 +133,7 @@ esac if test -f standalone.db; then ./sa-forget-flight standalone.db "$flight" else - ./sa-db-init standalone.db + ./sa-init-db standalone.db fi : ${BUILD_LVEXTEND_MAX:=50}
Signature · 1 line
1.7.10.4
Re: [PATCH v5 01/13] standalone-reset: fix typo
Wei Liu writes ("[PATCH v5 01/13] standalone-reset: fix typo"):
Quoted 3 lines
The script name is sa-init-db not sa-db-init.
Signed-off-by Wei Liu <[email protected]>
PATCH v5 2/13 TestSupport.pm: add bios option to guest config file
In reply to Wei Liu--- Osstest/TestSupport.pm | 5 +++++ 1 file changed, 5 insertions(+)
Osstest/TestSupport.pm +5 -0
@@ -1471,6 +1471,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
PATCH v5 3/13 TestSupport.pm: introduce iso_create_xorriso
In reply to Wei Liu... and convert ts-redhat-install to make use of it.
--- Osstest/TestSupport.pm | 16 ++++++++++++++++ ts-redhat-install | 15 +++++---------- 2 files changed, 21 insertions(+), 10 deletions(-)
Osstest/TestSupport.pm +16 -0
@@ -100,6 +100,8 @@ BEGIN { setup_pxeboot setup_pxeboot_local host_pxefile ether_prefix + + iso_create_xorriso ); %EXPORT_TAGS = ( );
@@ -1888,4 +1890,18 @@ default local END } +#---------- ISO images ---------- +sub iso_create_xorriso ($$$$;@) { + my ($ho,$iso,$dir,$isotimeout,@xopts) = @_; + + # These options forces ISO creation even if input directory is + # empty. They have to go last. + my @force_iso_creation = qw(-- -changes_pending yes); + + target_cmd_root($ho, <<END, 60); + mkdir -p $dir + xorriso @xopts -o $iso $dir/. @force_iso_creation +END +} + 1;
ts-redhat-install +5 -10
@@ -112,7 +112,7 @@ END our $emptyiso= '/root/empty.iso'; sub prep () { - target_install_packages_norec($ho, qw(lvm2 rsync genisoimage)); + target_install_packages_norec($ho, qw(lvm2 rsync xorriso)); my $isotimeout= 600;
@@ -123,18 +123,15 @@ sub prep () { my $newiso= '/root/newiso'; my $emptydir= '/root/empty-dir'; - my @isogen_base= qw(-R -J -T); + my @isogen_base= qw(-as mkisofs -R -J); my @isogen_boot= qw(-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table); + my @isogen= (@isogen_base, @isogen_boot); - target_cmd_root($ho, <<END, 60); - set -e - mkdir -p $emptydir - genisoimage -o $emptyiso @isogen_base $emptydir/. -END + iso_create_xorriso($ho, $emptyiso, $emptydir, 60, @isogen_base); more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, OnReboot => 'preserve',
@@ -163,9 +160,7 @@ END target_putfilecontents_root_stash($ho, 10, kickstart(), "$newiso/ks.cfg"); - target_cmd_root($ho, <<END, $isotimeout); - genisoimage -o $gho->{Rimage} @isogen_base @isogen_boot $newiso/. -END + iso_create_xorriso($ho, $gho->{Rimage}, $newiso, $isotimeout, @isogen); }); }
Signature · 1 line
1.7.10.4
Re: [PATCH v5 03/13] TestSupport.pm: introduce iso_create_xorriso
Wei Liu writes ("[PATCH v5 03/13] TestSupport.pm: introduce iso_create_xorriso"):
Quoted 1 line
... and convert ts-redhat-install to make use of it.
PATCH v5 4/13 TestSupport.pm: move rewrite_config_nocd to support library
In reply to Wei Liu... and rename it to guest_editconfig_nocd.
--- Osstest/TestSupport.pm | 11 +++++++++++ ts-redhat-install | 11 +---------- 2 files changed, 12 insertions(+), 10 deletions(-)
Osstest/TestSupport.pm +11 -0
@@ -102,6 +102,7 @@ BEGIN { ether_prefix iso_create_xorriso + guest_editconfig_nocd ); %EXPORT_TAGS = ( );
@@ -1904,4 +1905,14 @@ sub iso_create_xorriso ($$$$;@) { END } +sub guest_editconfig_nocd ($$) { + my ($gho,$emptyiso) = @_; + guest_editconfig($gho->{Host}, $gho, sub { + if (m/^\s*disk\s*\=/ .. /\]/) { + s/\Q$gho->{Rimage}\E/$emptyiso/; + } + s/^on_reboot.*/on_reboot='restart'/; + }); +} + 1;
ts-redhat-install +1 -10
@@ -168,15 +168,6 @@ 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();
@@ -188,7 +179,7 @@ if ($stage<2) { guest_destroy($ho,$gho); } -rewrite_config_nocd(); +guest_editconfig_nocd($gho,$emptyiso); start(); guest_await_dhcp_tcp($gho,300); guest_check_up($gho);
Signature · 1 line
1.7.10.4
Re: [PATCH v5 04/13] TestSupport.pm: move rewrite_config_nocd to support library
Wei Liu writes ("[PATCH v5 04/13] TestSupport.pm: move rewrite_config_nocd to support library"):
Quoted 1 line
... and rename it to
guest_editconfig_nocd.
PATCH v5 5/13 TestSupport.pm: introduce guest_create
In reply to Wei Liu--- Osstest/TestSupport.pm | 10 ++++++++-- ts-redhat-install | 8 ++------ 2 files changed, 10 insertions(+), 8 deletions(-)
Osstest/TestSupport.pm +8 -2
@@ -93,7 +93,7 @@ BEGIN { guest_vncsnapshot_begin guest_vncsnapshot_stash guest_check_remus_ok guest_editconfig host_involves_pcipassthrough host_get_pcipassthrough_devs - toolstack + toolstack guest_create await_webspace_fetch_byleaf create_webfile file_link_contents get_timeout
@@ -1243,7 +1243,13 @@ sub guest_await_reboot ($$$) { sub guest_destroy ($$) { my ($ho,$gho) = @_; target_cmd_root($ho, toolstack()->{Command}." destroy $gho->{Name}", 40); -} +} + +sub guest_create ($$) { + my ($gho,$toolstack) = @_; + target_cmd_root($gho->{Host}, "$toolstack create $gho->{CfgPath}", 100); +} + sub target_choose_vg ($$) { my ($ho, $mbneeded) = @_;
ts-redhat-install +2 -6
@@ -164,13 +164,9 @@ END }); } -sub start () { - target_cmd_root($ho, "$xl create $gho->{CfgPath}", 100); -} - if (!$stage) { prep(); - start(); + guest_create($gho,$xl); } else { $gho= selectguest($gn,$gho); }
@@ -180,6 +176,6 @@ if ($stage<2) { } guest_editconfig_nocd($gho,$emptyiso); -start(); +guest_create($gho,$xl); guest_await_dhcp_tcp($gho,300); guest_check_up($gho);
Signature · 1 line
1.7.10.4
PATCH v5 6/13 ts-redhat-install: use $flight, $job and $gn when creating iso
In reply to Wei Liu--- ts-redhat-install | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
ts-redhat-install +3 -3
@@ -109,7 +109,7 @@ ENDKEYS END } -our $emptyiso= '/root/empty.iso'; +our $emptyiso= '/root/$flight.$job.$gn-empty.iso'; sub prep () { target_install_packages_norec($ho, qw(lvm2 rsync xorriso));
@@ -120,8 +120,8 @@ sub prep () { $disk_mb + 1, 100); - my $newiso= '/root/newiso'; - my $emptydir= '/root/empty-dir'; + my $newiso= '/root/$flight.$job.$gn-newiso'; + my $emptydir= '/root/$flight.$job.$gn-empty-dir'; my @isogen_base= qw(-as mkisofs -R -J); my @isogen_boot= qw(-b isolinux/isolinux.bin
Signature · 1 line
1.7.10.4
PATCH v5 7/13 TestSupport.pm: introduce iso_create_empty
In reply to Wei Liu--- Osstest/TestSupport.pm | 8 ++++++++ ts-redhat-install | 17 ++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-)
Osstest/TestSupport.pm +8 -0
@@ -102,6 +102,7 @@ BEGIN { ether_prefix iso_create_xorriso + iso_create_empty guest_editconfig_nocd ); %EXPORT_TAGS = ( );
@@ -1911,6 +1912,13 @@ sub iso_create_xorriso ($$$$;@) { END } +sub iso_create_empty($$$) { + my ($ho,$emptyiso,$emptydir) = @_; + my @isogen_opts= qw(-as mkisofs -R -J); + + iso_create_xorriso($ho, $emptyiso, $emptydir, 60, @isogen_opts); +} + sub guest_editconfig_nocd ($$) { my ($gho,$emptyiso) = @_; guest_editconfig($gho->{Host}, $gho, sub {
ts-redhat-install +8 -9
@@ -123,15 +123,14 @@ sub prep () { my $newiso= '/root/$flight.$job.$gn-newiso'; my $emptydir= '/root/$flight.$job.$gn-empty-dir'; - my @isogen_base= qw(-as mkisofs -R -J); - my @isogen_boot= qw(-b isolinux/isolinux.bin - -c isolinux/boot.cat - -no-emul-boot - -boot-load-size 4 - -boot-info-table); - my @isogen= (@isogen_base, @isogen_boot); - - iso_create_xorriso($ho, $emptyiso, $emptydir, 60, @isogen_base); + iso_create_empty($ho, $emptyiso, $emptydir); + + my @isogen= qw(-as mkisofs -R -J + -b isolinux/isolinux.bin + -c isolinux/boot.cat + -no-emul-boot + -boot-load-size 4 + -boot-info-table); more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, OnReboot => 'preserve',
Signature · 1 line
1.7.10.4
Re: [PATCH v5 07/13] TestSupport.pm: introduce iso_create_empty
Wei Liu writes ("[PATCH v5 07/13] TestSupport.pm: introduce iso_create_empty"):
Quoted 1 line
Signed-off-by Wei Liu <[email protected]>
PATCH v5 8/13 TestSupport.pm: introduce iso_gen_flags_basic
In reply to Wei Liu... which returns the flags that can be passed to xorriso to create a bootable image (not EFI capable though).
--- Osstest/TestSupport.pm | 10 ++++++++++ ts-redhat-install | 7 +------ 2 files changed, 11 insertions(+), 6 deletions(-)
Osstest/TestSupport.pm +10 -0
@@ -103,6 +103,7 @@ BEGIN { iso_create_xorriso iso_create_empty + iso_gen_flags_basic guest_editconfig_nocd ); %EXPORT_TAGS = ( );
@@ -1919,6 +1920,15 @@ sub iso_create_empty($$$) { iso_create_xorriso($ho, $emptyiso, $emptydir, 60, @isogen_opts); } +sub iso_gen_flags_basic() { + return qw(-as mkisofs -R -J + -b isolinux/isolinux.bin + -c isolinux/boot.cat + -no-emul-boot + -boot-load-size 4 + -boot-info-table); +} + sub guest_editconfig_nocd ($$) { my ($gho,$emptyiso) = @_; guest_editconfig($gho->{Host}, $gho, sub {
ts-redhat-install +1 -6
@@ -125,12 +125,7 @@ sub prep () { iso_create_empty($ho, $emptyiso, $emptydir); - my @isogen= qw(-as mkisofs -R -J - -b isolinux/isolinux.bin - -c isolinux/boot.cat - -no-emul-boot - -boot-load-size 4 - -boot-info-table); + my @isogen= iso_gen_flags_basic(); more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, OnReboot => 'preserve',
Signature · 1 line
1.7.10.4
PATCH v5 9/13 TestSupport.pm: introduce iso_copy_content_from_image
In reply to Wei Liu... which returns a string of commands to pass into target_cmd_root.
--- Osstest/TestSupport.pm | 14 ++++++++++++++ ts-redhat-install | 10 +--------- 2 files changed, 15 insertions(+), 9 deletions(-)
Osstest/TestSupport.pm +14 -0
@@ -104,6 +104,7 @@ BEGIN { iso_create_xorriso iso_create_empty iso_gen_flags_basic + iso_copy_content_from_image guest_editconfig_nocd ); %EXPORT_TAGS = ( );
@@ -1929,6 +1930,19 @@ sub iso_gen_flags_basic() { -boot-info-table); } +sub iso_copy_content_from_image($$) { + my ($gho,$newiso) = @_; + return <<"END"; + set -ex + umount /mnt ||: + rm -rf $newiso + mount -o loop -r $gho->{Rimage} /mnt + mkdir $newiso + cp -a /mnt/. $newiso/. + umount /mnt +END +} + sub guest_editconfig_nocd ($$) { my ($gho,$emptyiso) = @_; guest_editconfig($gho->{Host}, $gho, sub {
ts-redhat-install +1 -9
@@ -130,15 +130,7 @@ sub prep () { more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, OnReboot => 'preserve', PostImageHook => sub { - target_cmd_root($ho, <<END, $isotimeout); - set -ex - umount /mnt ||: - rm -rf $newiso - mount -o loop -r $gho->{Rimage} /mnt - mkdir $newiso - cp -a /mnt/. $newiso/. - umount /mnt -END + target_cmd_root($ho, copy_iso_content_to_dir($gho,$newiso), $isotimeout); target_editfile_root($ho, "$newiso/isolinux/isolinux.cfg", sub { while (<EI>) { if (m/^\s+append/) {
Signature · 1 line
1.7.10.4
PATCH v5 10/13 Debian.pm: factor out preseed_base
In reply to Wei Liu--- Osstest/Debian.pm | 143 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 80 insertions(+), 63 deletions(-)
Osstest/Debian.pm +80 -63
@@ -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
@@ -423,7 +424,83 @@ sub di_installcmdline_core ($$;@) { if defined $debconf_priority; return @cl; -} +} + +sub preseed_base ($$;@) { + my ($suite,$extra_packages,%xopts) = @_; + + 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} +d-i apt-setup/use_mirror boolean yes +d-i apt-setup/another boolean false +d-i apt-setup/non-free boolean false +d-i apt-setup/contrib boolean false + +d-i pkgsel/include string openssh-server, ntp, ntpdate, $extra_packages + +$xopts{ExtraPreseed} + +### END OF DEBIAN PRESEED BASE + +END +} sub preseed_create ($$;@) { my ($ho, $sfx, %xopts) = @_;
@@ -613,45 +690,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,$extra_packages,%xopts); + $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
@@ -679,33 +723,6 @@ 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 foreach my $di_key (keys %preseed_cmds) {
Signature · 1 line
1.7.10.4
PATCH v5 11/13 Introduce ts-debian-hvm-install
In reply to Wei LiuThis is debian hvm guest test case. It resembles ts-redhat-install:
1. prepare a auto install CD
2. install debian hvm guest, currently using OVMF
3. test if the guest is up
The installtion CD is also bootable with seabios.
--- ts-debian-hvm-install | 183 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100755 ts-debian-hvm-install
ts-debian-hvm-install new file +183 -0
@@ -0,0 +1,183 @@ +#!/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= 6000; +our $disk_mb= 10000; + +our $guesthost= "$gn.guest.osstest"; +our $gho; + +our $toolstack= toolstack()->{Command}; + + +sub preseed () { + + my $preseed_file = preseed_base('wheezy','',()); + my $authkeys = join('\\n', split(/\n/, authorized_keys())); + + $preseed_file .= (<<END); +d-i netcfg/get_hostname string $gn + +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/cdrom/set-first boolean false + +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; \\ + in-target sh -c "echo -e '$authkeys'> /root/.ssh/authorized_keys"; +END + return $preseed_file; +} + +sub grub_cfg () { + + return <<"END"; +set default="0" +set timeout=5 + +menuentry 'debian 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 +} + +sub prepare_initrd ($$$) { + my ($initrddir,$newiso,$preseed_file_path) = @_; + return <<"END"; + rm -rf $initrddir + mkdir $initrddir + cd $initrddir + gzip -d < $newiso/install.amd/initrd.gz | cpio --extract --make-directories --no-absolute-filename + cp $preseed_file_path preseed.cfg + find . | cpio -H newc --create | gzip -9 > $newiso/install.amd/initrd.gz + cd - + rm -rf $initrddir + cd $newiso + md5sum `find -L -type f -print0 | xargs -0` > md5sum.txt + cd - +END +} + +our $emptyiso= "/root/$flight.$job.$gn-empty.iso"; + +sub prep () { + target_install_packages_norec($ho, qw(lvm2 rsync xorriso)); + + my $isotimeout= 600; + + $gho= prepareguest($ho, $gn, $guesthost, 22, + $disk_mb + 1, + 100); + my $base = "/root/$flight.$job.$gn-"; + my $newiso= $base . "newiso"; + my $emptydir= $base . "empty-dir"; + my $initrddir= $base . "initrd-dir"; + my $preseed_file_path = $base . "preseed"; + + my @xorriso_extra = qw(-eltorito-alt-boot + -e boot/grub/efi.img + -no-emul-boot + -r); + my @xorriso_opts = (iso_gen_flags_basic(), @xorriso_extra); + + iso_create_empty($ho, $emptyiso, $emptydir); + + target_putfilecontents_root_stash($ho, 10, preseed(), + $preseed_file_path); + + more_prepareguest_hvm($ho,$gho, $ram_mb, $disk_mb, + OnReboot => 'preserve', + Bios => 'ovmf', + PostImageHook => sub { + my $cmds = iso_copy_content_from_image($gho, $newiso); + $cmds .= prepare_initrd($initrddir,$newiso,$preseed_file_path); + target_cmd_root($ho, $cmds, $isotimeout); + 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"); + + iso_create_xorriso($ho, $gho->{Rimage}, $newiso, $isotimeout, @xorriso_opts); + }); +} + +if (!$stage) { + prep(); + guest_create($gho,$toolstack); +} else { + $gho= selectguest($gn,$gho); +} +if ($stage<2) { + guest_await_reboot($ho,$gho,2000); + guest_destroy($ho,$gho); +} + +guest_editconfig_nocd($gho,$emptyiso); +guest_create($gho,$toolstack); +guest_await_dhcp_tcp($gho,300); +guest_check_up($gho);
Signature · 1 line
1.7.10.4
Re: [PATCH v5 11/13] Introduce ts-debian-hvm-install
Wei Liu writes ("[PATCH v5 11/13] Introduce ts-debian-hvm-install"):
Quoted 8 lines
This is debian hvm guest test case. It resembles ts-redhat-install:
1. prepare a auto install CD
2. install debian hvm guest, currently using OVMF
3. test if the guest is upThe installtion CD is also bootable with seabios.
Signed-off-by Wei Liu <[email protected]>
PATCH v5 12/13 sg-run-job: OVMF job
In reply to Wei Liu--- sg-run-job | 6 ++++++ 1 file changed, 6 insertions(+)
sg-run-job +6 -0
@@ -265,6 +265,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-debian-hvm-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
PATCH v5 13/13 make-flight: OVMF test flight
In reply to Wei Liu---
./mg-show-flight-runvars standalone | grep ovmf | sed 's/[ \t]*$//'
test-amd64-amd64-xl-qemuu-ovmf-amd64 all_hostflags arch-amd64,arch-xen-amd64,suite-wheezy,purpose-test,hvm test-amd64-i386-xl-qemuu-ovmf-amd64 all_hostflags arch-i386,arch-xen-amd64,suite-wheezy,purpose-test,hvm test-amd64-amd64-xl-qemuu-ovmf-amd64 arch amd64 test-amd64-i386-xl-qemuu-ovmf-amd64 arch i386 test-amd64-amd64-xl-qemuu-ovmf-amd64 buildjob build-amd64 test-amd64-i386-xl-qemuu-ovmf-amd64 buildjob build-i386 test-amd64-amd64-xl-qemuu-ovmf-amd64 console hvc0 test-amd64-amd64-xl-qemuu-ovmf-amd64 device_model_version qemu-xen test-amd64-i386-xl-qemuu-ovmf-amd64 device_model_version qemu-xen build-amd64 enable_ovmf true build-amd64-xend enable_ovmf true build-armhf enable_ovmf true build-i386 enable_ovmf true build-i386-xend enable_ovmf true test-amd64-amd64-xl-qemuu-ovmf-amd64 host cam-st12 test-amd64-amd64-xl-qemuu-ovmf-amd64 kernbuildjob build-amd64-pvops test-amd64-i386-xl-qemuu-ovmf-amd64 kernbuildjob build-i386-pvops test-amd64-amd64-xl-qemuu-ovmf-amd64 kernkind pvops test-amd64-i386-xl-qemuu-ovmf-amd64 kernkind pvops standalone ovmf_boot_timeout 100 test-amd64-amd64-xl ovmf_boot_timeout 100 test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_boot_timeout 100 test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_cfgpath /etc/xen/ovmf.guest.osstest.cfg standalone ovmf_disk_lv ovmf.guest.osstest-disk test-amd64-amd64-xl ovmf_disk_lv ovmf.guest.osstest-disk test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_disk_lv ovmf.guest.osstest-disk standalone ovmf_domname ovmf.guest.osstest test-amd64-amd64-xl ovmf_domname ovmf.guest.osstest test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_domname ovmf.guest.osstest standalone ovmf_ether 5e:36:06:59:00:02 test-amd64-amd64-xl ovmf_ether 5e:36:06:59:00:03 test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_ether 5e:36:06:59:00:01 standalone ovmf_hostname ovmf.guest.osstest test-amd64-amd64-xl ovmf_hostname ovmf.guest.osstest test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_hostname ovmf.guest.osstest test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_image debian-7.2.0-amd64-CD-1.iso test-amd64-i386-xl-qemuu-ovmf-amd64 ovmf_image debian-7.2.0-amd64-CD-1.iso standalone ovmf_tcpcheckport 22 test-amd64-amd64-xl ovmf_tcpcheckport 22 test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_tcpcheckport 22 standalone ovmf_vg cam-st12 test-amd64-amd64-xl ovmf_vg cam-st12 test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_vg cam-st12 test-amd64-amd64-xl-qemuu-ovmf-amd64 toolstack xl test-amd64-i386-xl-qemuu-ovmf-amd64 toolstack xl test-amd64-amd64-xl-qemuu-ovmf-amd64 xen_kernel_path /boot/vmlinuz-3.4.83+ test-amd64-amd64-xl-qemuu-ovmf-amd64 xen_kernel_ver 3.4.83+ test-amd64-amd64-xl-qemuu-ovmf-amd64 xenbuildjob build-amd64 test-amd64-i386-xl-qemuu-ovmf-amd64 xenbuildjob build-amd64 --- --- make-flight | 13 +++++++++++++ 1 file changed, 13 insertions(+)
make-flight +13 -0
@@ -167,6 +167,17 @@ do_hvm_win7_x64_tests () { all_hostflags=$most_hostflags,hvm } +do_hvm_debian_ovmf_tests() { + if [ $xenarch != amd64 -o "x$qemuu_suffix" != "x-qemuu" ]; then + return + fi + + job_create_test test-$xenarch$kern-$dom0arch-xl$qemuu_suffix-ovmf-amd64 \ + test-debianhvm xl $xenarch $dom0arch $qemuu_runvar \ + ovmf_image=debian-7.2.0-amd64-CD-1.iso \ + all_hostflags=$most_hostflags,hvm +} + do_hvm_rhel6_tests () { if [ $xenarch != amd64 -o $dom0arch != i386 -o "$kern" != "" ]; then return
@@ -268,6 +279,8 @@ test_matrix_do_one () { do_hvm_win7_x64_tests do_hvm_rhel6_tests + do_hvm_debian_ovmf_tests + done # qemuu_suffix # Test live migration
Signature · 1 line
1.7.10.4
Re: [PATCH v5 13/13] make-flight: OVMF test flight
Wei Liu writes ("[PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 3 lines
Signed-off-by Wei Liu <[email protected]>---
./mg-show-flight-runvars standalone | grep ovmf | sed 's/[ \t]*$//'
...
Quoted 1 line
standalone
ovmf_boot_timeout100
???
Ian.
Re: [PATCH v5 13/13] make-flight: OVMF test flight
Quoted 6 lines · Ian Jackson
Wei Liu writes ("[PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 3 lines
Signed-off-by Wei Liu <[email protected]>---
./mg-show-flight-runvars standalone | grep ovmf | sed 's/[ \t]*$//'...
Quoted 1 line
standalone
ovmf_boot_timeout100
Oh, I once manually edited this database. :-(
I did a fresh standalone-reset then ran the same rune. Here's the result. In fact it's much shorter now.
test-amd64-amd64-xl-qemuu-ovmf-amd64 all_hostflags arch-amd64,arch-xen-amd64,suite-wheezy,purpose-test,hvm test-amd64-i386-xl-qemuu-ovmf-amd64 all_hostflags arch-i386,arch-xen-amd64,suite-wheezy,purpose-test,hvm test-amd64-amd64-xl-qemuu-ovmf-amd64 arch amd64 test-amd64-i386-xl-qemuu-ovmf-amd64 arch i386 test-amd64-amd64-xl-qemuu-ovmf-amd64 buildjob build-amd64 test-amd64-i386-xl-qemuu-ovmf-amd64 buildjob build-i386 test-amd64-amd64-xl-qemuu-ovmf-amd64 device_model_version qemu-xen test-amd64-i386-xl-qemuu-ovmf-amd64 device_model_version qemu-xen build-amd64 enable_ovmf true build-armhf enable_ovmf true build-i386 enable_ovmf true test-amd64-amd64-xl-qemuu-ovmf-amd64 kernbuildjob build-amd64-pvops test-amd64-i386-xl-qemuu-ovmf-amd64 kernbuildjob build-i386-pvops test-amd64-amd64-xl-qemuu-ovmf-amd64 kernkind pvops test-amd64-i386-xl-qemuu-ovmf-amd64 kernkind pvops test-amd64-amd64-xl-qemuu-ovmf-amd64 ovmf_image debian-7.2.0-amd64-CD-1.iso test-amd64-i386-xl-qemuu-ovmf-amd64 ovmf_image debian-7.2.0-amd64-CD-1.iso test-amd64-amd64-xl-qemuu-ovmf-amd64 toolstack xl test-amd64-i386-xl-qemuu-ovmf-amd64 toolstack xl test-amd64-amd64-xl-qemuu-ovmf-amd64 xenbuildjob build-amd64 test-amd64-i386-xl-qemuu-ovmf-amd64 xenbuildjob build-amd64
Sorry for the confusion.
Wei.
Quoted 4 lines
???
Ian.
Re: [PATCH v5 13/13] make-flight: OVMF test flight
Quoted 10 lines · Wei Liu
Quoted 6 lines · Ian Jackson
Wei Liu writes ("[PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 3 lines
Signed-off-by Wei Liu <[email protected]>---
./mg-show-flight-runvars standalone | grep ovmf | sed 's/[ \t]*$//'...
Quoted 1 line
standalone
ovmf_boot_timeout100Oh, I once manually edited this database. :-(
And I will re-run my testing runes in cover letter and report back.
Wei.
Ian Jackson
Acked-byRe: [PATCH v5 13/13] make-flight: OVMF test flight
In reply to Wei LiuWei Liu writes ("Re: [PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 5 lines · Ian Jackson
Quoted 4 lines
Wei Liu writes ("[PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 3 lines
Signed-off-by Wei Liu <[email protected]>---
./mg-show-flight-runvars standalone | grep ovmf | sed 's/[ \t]*$//'
Quoted 7 lines
Quoted 2 lines
...
Quoted 1 line
standalone
ovmf_boot_timeout100Oh, I once manually edited this database. :-(
I did a fresh standalone-reset then ran the same rune. Here's the result. In fact it's much shorter now.
Good. Thanks. In that case:
assuming you adjust the commit message to reflect reality.
I think that's the whole series acked, so could you provide a git branch somewhere with the acks folded in and this commit message fixed, and I'll push it.
Thanks,
Ian.
Re: [PATCH v5 13/13] make-flight: OVMF test flight
Quoted 14 lines · Ian Jackson
Wei Liu writes ("Re: [PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 5 lines · Ian Jackson
Quoted 4 lines
Wei Liu writes ("[PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 3 lines
Signed-off-by Wei Liu <[email protected]>---
./mg-show-flight-runvars standalone | grep ovmf | sed 's/[ \t]*$//'Quoted 7 lines
Quoted 2 lines
...
Quoted 1 line
standalone
ovmf_boot_timeout100Oh, I once manually edited this database. :-(
I did a fresh standalone-reset then ran the same rune. Here's the result. In fact it's much shorter now.
Quoted 9 lines
Good. Thanks. In that case:
Acked-by Ian Jackson <[email protected]>assuming you adjust the commit message to reflect reality.
I think that's the whole series acked, so could you provide a git branch somewhere with the acks folded in and this commit message fixed, and I'll push it.
Please pull from:
git://xenbits.xen.org/people/liuw/osstest.git debian-hvm-testcase
Wei.
Quoted 2 lines
Thanks,
Ian.
Re: [PATCH v5 13/13] make-flight: OVMF test flight
Wei Liu writes ("Re: [PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 7 lines · Ian Jackson
Quoted 3 lines
I think that's the whole series acked, so could you provide a git branch somewhere with the acks folded in and this commit message fixed, and I'll push it.
Please pull from:
git://xenbits.xen.org/people/liuw/osstest.gitdebian-hvm-testcase
Pushed, thanks.
Ian.
Re: [PATCH v5 13/13] make-flight: OVMF test flight
In reply to Ian JacksonQuoted 7 lines · Ian Jackson
Wei Liu writes ("[PATCH v5 13/13] make-flight: OVMF test flight"):
Quoted 3 lines
Signed-off-by Wei Liu <[email protected]>---
./mg-show-flight-runvars standalone | grep ovmf | sed 's/[ \t]*$//'...
Quoted 1 line
standalone
ovmf_boot_timeout100
And this is because I once ran:
JOBNAME=standalone ts-debian-hvm-install host=cam-st12
which inserted this garbage value into the database.
Wei.
Quoted 3 lines
???
Ian.