Skip to contentSkip to conversation

OSSTest: OVMF test job

RFC PATCH Superseded Wei Liu 3 participants 23 messages Dec 12, 2013 – Mar 20, 2014

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

v3 cover OSSTest: OVMF test job

RFC v3 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.

I've tried my best to factor out common code. :-)

Now the preseed data in the test case only contains essential items - partitioning recipe, late_command and two other items.

As for the file manipulation code, it has a small portion (first 6 lines as IanJ pointed out) that's copied from ts-redhat-install, but I don't see a sensible to factor out that 6 lines of command.

I basically didn't touch that last two patches as IanJ will take care of them when he takes this series.

Wei.

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
* add $flight $job and $gn to all file paths

Changes in v2:
* factor out preseed_base
* make installation CD work with seabios

Wei Liu (7):
make-flight: disable OVMF build for 4.3 TestSupport.pm: add bios option to guest config file TestSupport.pm: functions for creating isos Debian.pm: factor out preseed_base Introduce ts-debian-hvm-install
make-flight: OVMF test filght
sg-run-job: OVMF job

 Osstest/Debian.pm      |  143 +++++++++++++++++++---------------
 Osstest/TestSupport.pm |   33 ++++++++
 make-flight            |    7 ++
 sg-run-job             |    6 ++
 ts-debian-hvm-install  |  202 ++++++++++++++++++++++++++++++++++++++++++++++++
 ts-redhat-install      |   13 +---
 6 files changed, 332 insertions(+), 72 deletions(-)
 create mode 100755 ts-debian-hvm-install
Signature · 1 line
1.7.10.4
author
#1 lore raw

RFC PATCH v3 1/7 make-flight: disable OVMF build for 4.3

This was missing from previous patch. We should only build OVMF from 4.4 onwards.

---
 make-flight |    1 +
 1 file changed, 1 insertion(+)
make-flight +1 -0
index dcfdfe6..7d19af7 100755
@@ -93,6 +93,7 @@ if [ x$buildflight = x ]; then
     xen-4.0-testing) enable_ovmf=false;;
     xen-4.1-testing) enable_ovmf=false;;
     xen-4.2-testing) enable_ovmf=false;;
+    xen-4.3-testing) enable_ovmf=false;;
     *) enable_ovmf=true;
     esac
 
Signature · 1 line
1.7.10.4
author
#3 lore raw

RFC PATCH v3 2/7 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
index a513540..ebe313c 100644
@@ -1442,6 +1442,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
author
#4 lore raw

RFC PATCH v3 3/7 TestSupport.pm: functions for creating isos

In reply to Wei Liu

I would have replaced genisoimage with xorriso but I think it is better to keep it for compatibility.

create_iso_xorriso is mainly used to create a EFI bootable ISO image. As far as I can tell Wheezy's genisoimage cannot do that.

---
 Osstest/TestSupport.pm |   28 ++++++++++++++++++++++++++++
 ts-redhat-install      |   13 ++++---------
 2 files changed, 32 insertions(+), 9 deletions(-)
Osstest/TestSupport.pm +28 -0
index ebe313c..31ca102 100644
@@ -97,6 +97,9 @@ BEGIN {
                       await_webspace_fetch_byleaf create_webfile
                       file_link_contents get_timeout
                       setup_pxeboot setup_pxeboot_local host_pxefile
+
+                      create_iso_genisoimage
+                      create_iso_xorriso
                       );
     %EXPORT_TAGS = ( );
 
@@ -1859,4 +1862,29 @@ default local
 END
 }
 
+#---------- ISO images ----------
+sub create_iso_genisoimage ($$$$;@) {
+    my ($ho,$iso,$dir,$isotimeout,@xopts) = @_;
+
+    target_install_packages_norec($ho, qw(genisoimage));
+
+    target_cmd_root($ho, <<END, 60);
+        mkdir -p $dir
+        genisoimage @xopts -o $iso $dir/.
+END
+
+}
+
+sub create_iso_xorriso ($$$$;@) {
+    my ($ho,$iso,$dir,$isotimeout,@xopts) = @_;
+
+    target_install_packages_norec($ho, qw(xorriso));
+
+    target_cmd_root($ho, <<END, 60);
+        mkdir -p $dir
+        xorriso @xopts -o $iso $dir/.
+END
+
+}
+
 1;
ts-redhat-install +4 -9
index a945033..87f2335 100755
@@ -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));
 
     my $isotimeout= 600;
 
@@ -129,12 +129,9 @@ sub prep () {
                         -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
+    create_iso_genisoimage($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
+        create_iso_genisoimage($ho, $gho->{Rimage}, $newiso, $isotimeout, @isogen);
     });
 }
 
Signature · 1 line
1.7.10.4
author
#8 lore raw

RFC PATCH v3 4/7 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
index 6759263..485e165 100644
@@ -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) = @_;
@@ -610,45 +687,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
 
@@ -676,33 +720,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
author
#10 lore raw

RFC PATCH v3 5/7 Introduce ts-debian-hvm-install

In reply to Wei Liu

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 up

The installtion CD is also bootable with seabios.

---
 ts-debian-hvm-install |  202 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 202 insertions(+)
 create mode 100755 ts-debian-hvm-install
ts-debian-hvm-install new file +202 -0
new file mode 100755
index 0000000..66b5257
@@ -0,0 +1,202 @@
+#!/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 $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
+}
+
+our $emptyiso= "/root/$flight.$job.$gn-empty.iso";
+
+sub prep () {
+    target_install_packages_norec($ho, qw(lvm2 rsync));
+
+    my $isotimeout= 600;
+
+    $gho= prepareguest($ho, $gn, $guesthost, 22,
+                       $disk_mb + 1,
+                       100);
+
+    my $newiso= "/root/$flight.$job.$gn-newiso";
+    my $emptydir= "/root/$flight.$job.$gn-empty-dir";
+    my $initrddir= "/root/$flight.$job.$gn-initrd-dir";
+    my $preseed_file_path = "/root/$flight.$job.$gn-preseed";
+
+    my @isogen_opts= 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(),
+                                      $preseed_file_path);
+
+    create_iso_genisoimage($ho, $emptyiso, $emptydir, 60, @isogen_opts);
+
+    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 $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
+        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");
+
+        create_iso_xorriso($ho, $gho->{Rimage}, $newiso, $isotimeout, @xorriso_opts);
+    });
+}
+
+sub start () {
+    target_cmd_root($ho, "$toolstack 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
author
#15 lore raw

RFC PATCH v3 6/7 make-flight: OVMF test filght

In reply to Wei Liu
---
 make-flight |    6 ++++++
 1 file changed, 6 insertions(+)
make-flight +6 -0
index 7d19af7..3192f5e 100755
@@ -420,7 +420,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
author
#16 lore raw

RFC PATCH v3 7/7 sg-run-job: OVMF job

In reply to Wei Liu
---
 sg-run-job |    6 ++++++
 1 file changed, 6 insertions(+)
sg-run-job +6 -0
index db62365..daa018d 100755
@@ -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
author
#2 lore raw

Re: [PATCH RFC V3 1/7] make-flight: disable OVMF build for 4.3

In reply to Wei Liu
Quoted 13 lines · Wei Liu

This was missing from previous patch. We should only build OVMF from 4.4 onwards.

---
 make-flight |    1 +
 1 file changed, 1 insertion(+)
make-flight +0 -0
index dcfdfe6..7d19af7 100755

make-flight if [ x$buildflight = x ]; then · line 96

Quoted 4 lines
make-flight +1 -0
@@ -93,6 +93,7 @@ if [ x$buildflight = x ]; then
     xen-4.0-testing) enable_ovmf=false;;
     xen-4.1-testing) enable_ovmf=false;;
     xen-4.2-testing) enable_ovmf=false;;
+    xen-4.3-testing) enable_ovmf=false;;

Oh, this one is certainly not RFC. This should be considered a bug fix. :-)

Wei.

Quoted 5 lines
make-flight +0 -0
     *) enable_ovmf=true;
     esac
 
Signature · 1 line
1.7.10.4
author
#18 lore raw
In reply to Wei Liu

Ian, ping.

Quoted 51 lines · Wei Liu

RFC v3 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.

I've tried my best to factor out common code. :-)

Now the preseed data in the test case only contains essential items - partitioning recipe, late_command and two other items.

As for the file manipulation code, it has a small portion (first 6 lines as IanJ pointed out) that's copied from ts-redhat-install, but I don't see a sensible to factor out that 6 lines of command.

I basically didn't touch that last two patches as IanJ will take care of them when he takes this series.

Wei.

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
* add $flight $job and $gn to all file paths

Changes in v2:
* factor out preseed_base
* make installation CD work with seabios

Wei Liu (7):
make-flight: disable OVMF build for 4.3 TestSupport.pm: add bios option to guest config file TestSupport.pm: functions for creating isos Debian.pm: factor out preseed_base Introduce ts-debian-hvm-install
make-flight: OVMF test filght
sg-run-job: OVMF job

 Osstest/Debian.pm      |  143 +++++++++++++++++++---------------
 Osstest/TestSupport.pm |   33 ++++++++
 make-flight            |    7 ++
 sg-run-job             |    6 ++
 ts-debian-hvm-install  |  202 ++++++++++++++++++++++++++++++++++++++++++++++++
 ts-redhat-install      |   13 +---
 6 files changed, 332 insertions(+), 72 deletions(-)
 create mode 100755 ts-debian-hvm-install
Signature · 1 line
1.7.10.4
#19 lore raw

One more time, with Ian on the To: this time.

TBH I think this might need rebasing and reposting though

FWIW my "distro flight" to test Debian installer based guests has already been rebased onto this. (it's also a bit back burnered right now...)

Quoted 54 lines · Wei Liu

Ian, ping.

Quoted 51 lines · Wei Liu

RFC v3 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.

I've tried my best to factor out common code. :-)

Now the preseed data in the test case only contains essential items - partitioning recipe, late_command and two other items.

As for the file manipulation code, it has a small portion (first 6 lines as IanJ pointed out) that's copied from ts-redhat-install, but I don't see a sensible to factor out that 6 lines of command.

I basically didn't touch that last two patches as IanJ will take care of them when he takes this series.

Wei.

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
* add $flight $job and $gn to all file paths

Changes in v2:
* factor out preseed_base
* make installation CD work with seabios

Wei Liu (7):
make-flight: disable OVMF build for 4.3 TestSupport.pm: add bios option to guest config file TestSupport.pm: functions for creating isos Debian.pm: factor out preseed_base Introduce ts-debian-hvm-install
make-flight: OVMF test filght
sg-run-job: OVMF job

 Osstest/Debian.pm      |  143 +++++++++++++++++++---------------
 Osstest/TestSupport.pm |   33 ++++++++
 make-flight            |    7 ++
 sg-run-job             |    6 ++
 ts-debian-hvm-install  |  202 ++++++++++++++++++++++++++++++++++++++++++++++++
 ts-redhat-install      |   13 +---
 6 files changed, 332 insertions(+), 72 deletions(-)
 create mode 100755 ts-debian-hvm-install
Signature · 1 line
1.7.10.4
#5 lore raw

Re: [PATCH RFC V3 3/7] TestSupport.pm: functions for creating isos

In reply to Wei Liu

Wei Liu writes ("[PATCH RFC V3 3/7] TestSupport.pm: functions for creating isos"):

Quoted 2 lines

I would have replaced genisoimage with xorriso but I think it is better to keep it for compatibility.

ISTM that switching everything to xorriso would be better, surely ?

We have the self-test push gate so don't worry too much about accidentally breaking unrelated things. A reasonable effort to fix the existing usages would do.

Thanks,
Ian.

#11 lore raw

Re: [PATCH RFC V3 5/7] Introduce ts-debian-hvm-install

In reply to Wei Liu

Wei Liu writes ("[PATCH RFC V3 5/7] Introduce ts-debian-hvm-install"):

Quoted 4 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 up

...

Quoted 1 line
 ts-debian-hvm-install |  202 +++++++++++++++++++++++++++++++++++++++++++++++++

This script has, I'm afraid, far too much clone-and-hack from ts-redhat-install.

I think you may need to make an Osstest/Redhat.pm module to contain the parts which are common to these scripts but specific to Redhat-family distros. (Of course some of the commonality which is not RH-family-specific should go into TestSupport.pm.)

Thanks,
Ian.

#12 lore raw

Re: [PATCH RFC V3 5/7] Introduce ts-debian-hvm-install

Ian Jackson writes ("Re: [PATCH RFC V3 5/7] Introduce ts-debian-hvm-install"):

Quoted 7 lines

Wei Liu writes ("[PATCH RFC V3 5/7] Introduce ts-debian-hvm-install"):

Quoted 4 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 up

...

Quoted 1 line
 ts-debian-hvm-install |  202 +++++++++++++++++++++++++++++++++++++++++++++++++

Uh, I am a total snooze today.

Quoted 2 lines

This script has, I'm afraid, far too much clone-and-hack from ts-redhat-install.

This is true.

Quoted 4 lines

I think you may need to make an Osstest/Redhat.pm module to contain the parts which are common to these scripts but specific to Redhat-family distros. (Of course some of the commonality which is not RH-family-specific should go into TestSupport.pm.)

But this is nonsense, in context, since your new script is for Debianish distros...

Ian.

#20 lore raw
In reply to Ian Campbell

Ian Campbell writes ("Re: [PATCH RFC V3 0/7] OSSTest: OVMF test job"):

Quoted 1 line

One more time, with Ian on the To: this time.

Thanks for pinging me about this.

Quoted 1 line

TBH I think this might need rebasing and reposting though

Yes. I have commented as far as seems plausible to do before that. Wei, would you incorporate what I've said so far, and rebase and repost ?

Thanks,
Ian.

author
#6 lore raw

Re: [PATCH RFC V3 3/7] TestSupport.pm: functions for creating isos

In reply to Ian Jackson
Quoted 10 lines · Ian Jackson

Wei Liu writes ("[PATCH RFC V3 3/7] TestSupport.pm: functions for creating isos"):

Quoted 2 lines

I would have replaced genisoimage with xorriso but I think it is better to keep it for compatibility.

ISTM that switching everything to xorriso would be better, surely ?

We have the self-test push gate so don't worry too much about accidentally breaking unrelated things. A reasonable effort to fix the existing usages would do.

The main concern is that it may break RHEL testcase. In order to be sure I will need to test RHEL testcase with the change. I wasn't able to grab RHEL image at that time so I kept the old function.

Wei.

Quoted 2 lines

Thanks,
Ian.

author
#13 lore raw

Re: [PATCH RFC V3 5/7] Introduce ts-debian-hvm-install

In reply to Ian Jackson
Quoted 7 lines · Ian Jackson

Ian Jackson writes ("Re: [PATCH RFC V3 5/7] Introduce ts-debian-hvm-install"):

Quoted 6 lines

Wei Liu writes ("[PATCH RFC V3 5/7] Introduce ts-debian-hvm-install"):

Quoted 4 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 up

...

Quoted 9 lines
Quoted 1 line
Quoted 1 line
 ts-debian-hvm-install |  202 +++++++++++++++++++++++++++++++++++++++++++++++++

Uh, I am a total snooze today.

Quoted 2 lines

This script has, I'm afraid, far too much clone-and-hack from ts-redhat-install.

This is true.

What will you suggest? One thing I can think of is to move rewrite_config_nocd to TestSupport.pm. The major body looks Debian-centric to me.

The process is similar to ts-redhat-install -- they both have prep(), rewrite etc. But inside the prep() function there are actually many differences.

Wei.

author
#21 lore raw
In reply to Ian Campbell
Quoted 8 lines · Ian Campbell

One more time, with Ian on the To: this time.

TBH I think this might need rebasing and reposting though

FWIW my "distro flight" to test Debian installer based guests has already been rebased onto this. (it's also a bit back burnered right now...)

IIRC you also modified make-flight so I should drop my change. Can you send your patch to me?

Wei.

#7 lore raw

Re: [PATCH RFC V3 3/7] TestSupport.pm: functions for creating isos

In reply to Wei Liu

Wei Liu writes ("Re: [PATCH RFC V3 3/7] TestSupport.pm: functions for creating isos"):

Quoted 3 lines

The main concern is that it may break RHEL testcase. In order to be sure I will need to test RHEL testcase with the change. I wasn't able to grab RHEL image at that time so I kept the old function.

Please go ahead and make the changes anyway. I can test them for you (either by throwing it at the osstest push gate, or by hand).

Ian.

#14 lore raw

Re: [PATCH RFC V3 5/7] Introduce ts-debian-hvm-install

In reply to Wei Liu

Wei Liu writes ("Re: [PATCH RFC V3 5/7] Introduce ts-debian-hvm-install"):

Quoted 3 lines

What will you suggest? One thing I can think of is to move rewrite_config_nocd to TestSupport.pm. The major body looks Debian-centric to me.

Everything that's common to both scripts should be in TestSupport. Like, the fragments for supporting editing the iso, and perhaps several of the iso generation flags.

Also perhaps the default ram_mb and disk_mb settings.

Ian.

#22 lore raw
In reply to Wei Liu
Quoted 5 lines · Wei Liu
Quoted 4 lines · Ian Campbell

One more time, with Ian on the To: this time.

TBH I think this might need rebasing and reposting though

Quoted 7 lines
Quoted 4 lines

FWIW my "distro flight" to test Debian installer based guests has already been rebased onto this. (it's also a bit back burnered right now...)

IIRC you also modified make-flight so I should drop my change. Can you send your patch to me?

I refactored make-flight so the changes are different.

git://xenbits.xen.org/people/ianc/osstest.git for-wei/debian-ovmf-merge-up

has the merge in it, which itself is unreadable but hopefully a bit of git diff magic will get you the hunks you need.

Ian.