|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [OSSTest PATCH v2 1/2] ts-cpupools: new test script
On Wed, 2015-02-04 at 15:27 +0000, Dario Faggioli wrote:
> + my $xlinfo= target_cmd_output_root($ho, "xl info");
> + $xlinfo =~ /nr_cpus\s*:\s([0-9]*)/;
I thought Perl needed a modifier to work in multiline mode?
> + $nr_cpus= $1;
> + logm("Found $nr_cpus pCPUs");
> + die "Too few pCPUs to test cpupools: $nr_cpus" if $nr_cpus < 2;
This will cause a sticky test failure if this ever gets run on a single
cpu host (which might just about be plausible on ARM).
The proper fix would be a property in the hostdb which was used to
constrain which hosts the jobs containing this test could run on. (e.g.
we have pcipassthrough-nic).
Maybe this way is OK until we find we are commissioning a machine with a
single CPU, at which point this failure will seem pretty obvious. Ian?
> +
> + # 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/;
Shouldn't the condition on the last one be inverted, i.e. die unless
Pool-0 is present?
Also: long lines?
> +
> + $out= target_cmd_output_root($ho, "xl cpupool-list"); logm("$out");
> + $out= target_cmd_output_root($ho, "xl cpupool-list -c"); logm("$out");
Is this just for logging? target_cmd_root will just do that for you I
think.
You may want to include one or more of these in ts-logs-capture too,
which allow us to have some chance of noticing pooling oddities on other
jobs.
> +}
> +
> +# List of the odd pCPUs
> +sub prep_cpulist () {
> + if (! defined @cpulist) {
> + foreach my $cpu (0..$nr_cpus) {
> + next unless $cpu % 2;
> + push @cpulist, $cpu;
> + }
> + }
Seems like this ought to be doable as a one or two liner with grep or
map.
> +}
> +
> +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.= "]";
I think you should accumulate $cpu in @cpus and then join it at the end
and add the []s (or leave them inline in the here doc.
> +
> + 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\"
One of these two quoting styles must be wrong I think?
> +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");
Doesn't this throw away the output? I think you want to drop _output
here.
> + $out= target_cmd_output_root($ho, "xl cpupool-list -c"); logm("$out");
What about libvirt? This either needs to use the
toolstack()/Osstest::Toolstack abstraction or it needs to error for
toolstacks which aren't xl.
> + $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@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |