From: Dario Faggioli Subject: Re: [PATCH 23/27] ts-bench-hostcmp-host-reset: new script Date: Thu, 11 Dec 2014 14:20:11 +0100 Message-ID: <1418304011.31647.101.camel@Abyss.station> References: <20141210180651.26400.13356.stgit@Abyss.station> <20141210181200.26400.71485.stgit@Abyss.station> Reply-To: raistlin@linux.it Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6979308872276089674==" Return-path: In-Reply-To: <20141210181200.26400.71485.stgit@Abyss.station> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org Cc: Ian Jackson , Wei Liu , Ian Campbell List-Id: xen-devel@lists.xenproject.org --===============6979308872276089674== Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-mj5Bzatkn3G6DdFouvO5" --=-mj5Bzatkn3G6DdFouvO5 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2014-12-10 at 19:12 +0100, Dario Faggioli wrote: > From: Dario Faggioli >=20 Somehow, this patch lacks a changelog! :-O Sorry about this too, I'll write one for next version. Regards, Dario > Signed-off-by: Dario Faggioli > Cc: Wei Liu > Cc: Ian Campbell > Cc: Ian Jackson > --- > Osstest/Debian.pm | 32 +++++++++++++++++--------------- > Osstest/TestSupport.pm | 46 ++++++++++++++++++++++++++++++++++++++++++= +++- > ts-bench-hostcmp-post | 39 +++++++++++++++++++++++++++++++++++++++ > ts-xen-install | 38 ++------------------------------------ > 4 files changed, 103 insertions(+), 52 deletions(-) > create mode 100755 ts-bench-hostcmp-post >=20 > diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm > index 418d9f2..447d2d2 100644 > --- a/Osstest/Debian.pm > +++ b/Osstest/Debian.pm > @@ -87,25 +87,27 @@ sub debian_boot_setup ($$$$;$) { > my $kern=3D $bootloader->{GetBootKern}(); > logm("dom0 kernel is $kern"); > =20 > - system "tar zvtf $distpath->{kern} boot/$kern"; > - $? and die "$distpath->{kern} boot/$kern $?"; > - > - my $kernver=3D $kern; > - $kernver =3D~ s,^/?(?:boot/)?(?:vmlinu[xz]-)?,, or die "$kernver ?"; > - my $kernpath=3D $kern; > - $kernpath =3D~ s,^(?:boot/)?,/boot/,; > - > - target_cmd_root($ho, > - "update-initramfs -k $kernver -c ||". > - " update-initramfs -k $kernver -u", > - 200); > + if (defined $distpath) { > + system "tar zvtf $distpath->{kern} boot/$kern"; > + $? and die "$distpath->{kern} boot/$kern $?"; > + > + my $kernver=3D $kern; > + $kernver =3D~ s,^/?(?:boot/)?(?:vmlinu[xz]-)?,, or die "$kernver= ?"; > + my $kernpath=3D $kern; > + $kernpath =3D~ s,^(?:boot/)?,/boot/,; > + > + target_cmd_root($ho, > + "update-initramfs -k $kernver -c ||". > + " update-initramfs -k $kernver -u", > + 200); > + > + store_runvar(target_var_prefix($ho).'xen_kernel_path',$kernpath)= ; > + store_runvar(target_var_prefix($ho).'xen_kernel_ver',$kernver); > + } > =20 > $bootloader->{PreFinalUpdate}(); > =20 > $bootloader->{UpdateConfig}($ho); > - > - store_runvar(target_var_prefix($ho).'xen_kernel_path',$kernpath); > - store_runvar(target_var_prefix($ho).'xen_kernel_ver',$kernver); > } > =20 > sub bl_getmenu_open ($$$) { > diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm > index 251668a..c967e4f 100644 > --- a/Osstest/TestSupport.pm > +++ b/Osstest/TestSupport.pm > @@ -99,7 +99,7 @@ BEGIN { > guest_vncsnapshot_begin guest_vncsnapshot_stash > guest_check_remus_ok guest_editconfig > host_involves_pcipassthrough host_get_pcipassthrou= gh_devs > - toolstack guest_create > + toolstack guest_create host_bootxen_setup > =20 > await_webspace_fetch_byleaf create_webfile > file_link_contents get_timeout > @@ -1012,6 +1012,50 @@ sub get_host_memory ($) { > return $mem; > } > =20 > +#---------- bootloader and booting ---------- > +# > +sub host_bootxen_setup ($) { > + my ($ho)=3D @_; > + > + my $xenhopt=3D "conswitch=3Dx watchdog"; > + > + my $cons=3D get_host_property($ho, 'XenSerialConsole', 'com1'); > + > + if ( $cons eq "com1" ) { > + $xenhopt .=3D " com1=3D$c{Baud},8n1 console=3Dcom1,vga gdb=3Dcom= 1"; > + } elsif ( $cons eq "dtuart" ) { > + $xenhopt .=3D " console=3Ddtuart"; > + my $dtuart=3D get_host_property($ho, 'XenDTUARTPath', undef); > + $xenhopt .=3D " dtuart=3D$dtuart" if $dtuart; > + } else { > + logm("No Xen console device defined for host"); > + } > + if (toolstack()->{Dom0MemFixed}) { > + $xenhopt .=3D " dom0_mem=3D512M,max:512M"; > + } > + my $append=3D $r{xen_boot_append}; > + $xenhopt .=3D " $append" if defined $append; > + $append =3D get_host_property($ho, 'xen-commandline-append', undef); > + $xenhopt .=3D " $append" if defined $append; > + > + my @hooks; > + > + if (host_involves_pcipassthrough($ho)) { > + push @hooks, { > + EditBootOptions =3D> sub { > + my ($ho,$hopt,$kopt) =3D @_; > + $$hopt .=3D ' iommu=3Don'; > + my $hide=3D ' xen-pciback.hide=3D'. join '',map { "($_->= {Bdf})" } > + host_get_pcipassthrough_devs($ho); > + logm("pci passthrough: hiding in dom0: $hide"); > + $$kopt .=3D $hide; > + } > + }; > + } > + > + return ($xenhopt,@hooks); > +} > + > #---------- stashed files ---------- > =20 > sub open_unique_stashfile ($) { > diff --git a/ts-bench-hostcmp-post b/ts-bench-hostcmp-post > new file mode 100755 > index 0000000..26a67f4 > --- /dev/null > +++ b/ts-bench-hostcmp-post > @@ -0,0 +1,39 @@ > +#!/usr/bin/perl -w > +# This is part of "osstest", an automated testing framework for Xen. > +# Copyright (C) 2009-2014 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 publish= ed 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 Licen= se > +# along with this program. If not, see . > + > +use strict qw(vars); > +use DBI; > +use Osstest; > +use Osstest::Debian; > +use Osstest::TestSupport; > + > +tsreadconfig(); > + > +our ($whhost) =3D @ARGV; > +$whhost ||=3D 'host'; > +our $ho=3D selecthost($whhost); > + > +sub resetboot () { > + my ($xenhopt,@hooks)=3D host_bootxen_setup($ho); > + my $want_kernver =3D get_runvar('kernel_ver',$r{'kernbuildjob'}); > + > + debian_boot_setup($ho, $want_kernver, $xenhopt, undef, \@hooks); > + > + logm("host reset to booting Xen"); > +} > + > +resetboot(); > diff --git a/ts-xen-install b/ts-xen-install > index 4d34d1f..d8d38fc 100755 > --- a/ts-xen-install > +++ b/ts-xen-install > @@ -134,43 +134,9 @@ sub adjustconfig () { > } > =20 > sub setupboot () { > - my $xenhopt=3D "conswitch=3Dx watchdog"; > - > - my $cons=3D get_host_property($ho, 'XenSerialConsole', 'com1'); > - > - if ( $cons eq "com1" ) { > - $xenhopt .=3D " com1=3D$c{Baud},8n1 console=3Dcom1,vga gdb=3Dcom1"; > - } elsif ( $cons eq "dtuart" ) { > - $xenhopt .=3D " console=3Ddtuart"; > - my $dtuart=3D get_host_property($ho, 'XenDTUARTPath', undef); > - $xenhopt .=3D " dtuart=3D$dtuart" if $dtuart; > - } else { > - logm("No Xen console device defined for host"); > - } > - if (toolstack()->{Dom0MemFixed}) { > - $xenhopt .=3D " dom0_mem=3D512M,max:512M"; > - } > - my $append=3D $r{xen_boot_append}; > - $xenhopt .=3D " $append" if defined $append; > - $append =3D get_host_property($ho, 'xen-commandline-append', undef); > - $xenhopt .=3D " $append" if defined $append; > - > - my @hooks; > - > - if (host_involves_pcipassthrough($ho)) { > - push @hooks, { > - EditBootOptions =3D> sub { > - my ($ho,$hopt,$kopt) =3D @_; > - $$hopt .=3D ' iommu=3Don'; > - my $hide=3D ' xen-pciback.hide=3D'. join '',map { "($_->= {Bdf})" } > - host_get_pcipassthrough_devs($ho); > - logm("pci passthrough: hiding in dom0: $hide"); > - $$kopt .=3D $hide; > - } > - }; > - } > - > + my ($xenhopt,@hooks)=3D host_bootxen_setup($ho); > my $want_kernver =3D get_runvar('kernel_ver',$r{'kernbuildjob'}); > + > debian_boot_setup($ho, $want_kernver, $xenhopt, \%distpath, \@hooks)= ; > =20 > logm("ready to boot Xen"); >=20 --=-mj5Bzatkn3G6DdFouvO5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlSJmgsACgkQk4XaBE3IOsTjFwCfYJnXscQVqSigC8mzi4wbud6k 53UAn0xilM5xjx843HfZHGdLY+tDfr6t =HUkk -----END PGP SIGNATURE----- --=-mj5Bzatkn3G6DdFouvO5-- --===============6979308872276089674== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============6979308872276089674==--