[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install



Wei Liu writes ("[PATCH RFC V2 4/6] Introduce ts-ovmf-debian-install"):
> 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.

> +    $preseed_file .= (<<END);
> +d-i netcfg/get_hostname string debian-hvm

This string should presumably be the guest ident or something.

> +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.

> +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.

> +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.

> +     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 ?

> +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!


> +    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.)

> +    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.

> +    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.

> +            md5sum `find -follow -type f` \> md5sum.txt

This should probably use find -print0 | xargs -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);
> +}
> +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.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.