All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: Dario Faggioli <dario.faggioli@citrix.com>, xen-devel@lists.xen.org
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>
Subject: Re: [OSSTEST PATCH 1/2] ts-cpupools: new test script
Date: Thu, 18 Dec 2014 15:57:30 +0100	[thread overview]
Message-ID: <5492EB5A.4060108@suse.com> (raw)
In-Reply-To: <20141218133854.29909.50574.stgit@Abyss.station>

On 12/18/2014 02:38 PM, Dario Faggioli wrote:
> for smoke testing cpupools a bit. It tries to partition
> a live host in two cpupools, trying out the following 3
> schedulers for the new cpupool (one after the other):
>   credit, credit2 and RTDS.
>
> It also tries to migrating a domain to the new cpupool
> and then back to Pool-0.
>
> Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>

Acked-by: Juergen Gross <jgross@suse.com>

> ---
>   ts-cpupools |  124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 124 insertions(+)
>   create mode 100755 ts-cpupools
>
> diff --git a/ts-cpupools b/ts-cpupools
> new file mode 100755
> index 0000000..fe612e1
> --- /dev/null
> +++ b/ts-cpupools
> @@ -0,0 +1,124 @@
> +#!/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 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::TestSupport;
> +
> +tsreadconfig();
> +
> +our ($whhost,$gn)= @ARGV;
> +$whhost ||= 'host';
> +$gn ||= 'debian';
> +
> +our ($ho,$gho) = ts_get_host_guest($whhost,$gn);
> +#our $ho= selecthost(@ARGV);
> +
> +our $default_cpupool= "Pool-0";
> +our @schedulers= ("credit","credit2","rtds");
> +our @cpulist;
> +our $nr_cpus;
> +
> +sub check () {
> +  my $out;
> +
> +  # Figure out the number of pCPUs of the host. We need to know
> +  # that in order to decide with what pCPUs we want to create
> +  # cpupools
> +  my $xlinfo= target_cmd_output_root($ho, "xl info");
> +  $xlinfo =~ /nr_cpus\s*:\s([0-9]*)/;
> +  $nr_cpus= $1;
> +  logm("Found $nr_cpus pCPUs");
> +  die "Too few pCPUs to test cpupools: $nr_cpus" if $nr_cpus < 2;
> +
> +  # We want only 1 cpupool to exist
> +  my $cppinfo= target_cmd_output_root($ho, "xl cpupool-list");
> +  my $nr_cpupools= $cppinfo =~ tr/\n//;
> +  logm("Found $nr_cpupools cpupools");
> +  die "There already is more than one cpu pool!" if $nr_cpupools > 1;
> +  die "Non-default cpupool configuration detected" if $cppinfo =~ /^$default_cpupool\b/;
> +
> +  $out= target_cmd_output_root($ho, "xl cpupool-list"); logm("$out");
> +  $out= target_cmd_output_root($ho, "xl cpupool-list -c"); logm("$out");
> +}
> +
> +# List of the odd pCPUs
> +sub prep_cpulist () {
> +  if (! defined @cpulist) {
> +    foreach my $cpu (0..$nr_cpus) {
> +      next unless $cpu % 2;
> +      push @cpulist, $cpu;
> +    }
> +  }
> +}
> +
> +sub prep ($) {
> +  my ($sched)= @_;
> +
> +  # Remove the pCPUs from in $cpulist from the default cpupool
> +  my $cpustr= "[";
> +  foreach my $cpu (@cpulist) {
> +    target_cmd_root($ho,"xl cpupool-cpu-remove $default_cpupool $cpu");
> +    $cpustr.= "\"$cpu\", ";
> +  }
> +  $cpustr.= "]";
> +
> +  logm("Creating config file for cpupool-osstest-$sched with cpus=$cpustr");
> +  target_putfilecontents_stash($ho,100,<<"END","/etc/xen/cpupool-osstest-$sched");
> +name = "cpupool-osstest-$sched"
> +sched=\"$sched\"
> +cpus=$cpustr
> +END
> +}
> +
> +check();
> +prep_cpulist();
> +foreach my $sched (@schedulers) {
> +  my $out;
> +
> +  prep("$sched");
> +
> +  # For each cpupool:
> +  #  * create it
> +  #  * rename it
> +  #  * move a domain in it
> +  #  * move back a domain out of it
> +  #  * add back the pcpus from it to the default pool
> +  #  * destroy it
> +  target_cmd_root($ho, "xl cpupool-create /etc/xen/cpupool-osstest-$sched");
> +  target_cmd_output_root($ho, "xl cpupool-rename cpupool-osstest-$sched cpupool-test");
> +  $out= target_cmd_output_root($ho, "xl cpupool-list -c"); logm("$out");
> +  $out= target_cmd_output_root($ho, "xl cpupool-list"); logm("$out");
> +
> +  target_cmd_root($ho, "xl cpupool-migrate $gho->{Name} cpupool-test");
> +  $out= target_cmd_output_root($ho, "xl cpupool-list"); logm("$out");
> +  $out= target_cmd_output_root($ho, "xl vcpu-list"); logm("$out");
> +
> +  target_cmd_root($ho, "xl cpupool-migrate $gho->{Name} Pool-0");
> +  $out= target_cmd_output_root($ho, "xl cpupool-list"); logm("$out");
> +
> +  foreach my $cpu (@cpulist) {
> +    target_cmd_root($ho,"xl cpupool-cpu-remove cpupool-test $cpu");
> +    target_cmd_root($ho,"xl cpupool-cpu-add $default_cpupool $cpu");
> +  }
> +  $out= target_cmd_output_root($ho, "xl cpupool-list -c"); logm("$out");
> +
> +  target_cmd_root($ho, "xl cpupool-destroy cpupool-test");
> +  $out= target_cmd_output_root($ho, "xl cpupool-list"); logm("$out");
> +}
> +
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
>

  reply	other threads:[~2014-12-18 14:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 13:38 [OSSTEST PATCH 0/2] Test case for cpupools Dario Faggioli
2014-12-18 13:38 ` [OSSTEST PATCH 1/2] ts-cpupools: new test script Dario Faggioli
2014-12-18 14:57   ` Juergen Gross [this message]
2014-12-18 13:39 ` [OSSTEST PATCH 2/2] Testing cpupools: recipe for it and job definition Dario Faggioli
2014-12-18 15:00   ` Juergen Gross
2014-12-18 15:04     ` Wei Liu
2014-12-18 15:10       ` Juergen Gross
2014-12-18 17:29         ` Dario Faggioli
2014-12-19  9:48           ` Ian Campbell
2014-12-19 10:50             ` Dario Faggioli
2014-12-19 11:02               ` Ian Campbell
2014-12-18 13:44 ` [OSSTEST PATCH 0/2] Test case for cpupools Dario Faggioli
2014-12-18 14:56 ` Juergen Gross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5492EB5A.4060108@suse.com \
    --to=jgross@suse.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.