[libvirt] question about libvirt-tck/libivrt-perl

Gerhard Stenzel gstenzel at linux.vnet.ibm.com
Mon Apr 12 13:41:44 UTC 2010


Hi, I have a small libvirt-TCK script, which fails in a for me
unexpected way:
##########################################################
use strict;
use warnings;

use Term::ReadKey;

use Test::More tests => 4;

use Sys::Virt::TCK;

my $tck = Sys::Virt::TCK->new();
my $conn = eval { $tck->setup(); };
BAIL_OUT "failed to setup test harness: $@" if $@;
END { $tck->cleanup if $tck; }

# first domain
my $xml = $tck->generic_domain("tck")->as_xml;
my $dom;
ok_domain(sub { $dom = $conn->create_domain($xml) }, "defined domain
config");
my $uuid = $dom->get_uuid_string();
diag $uuid;
$xml = $dom->get_xml_description;

diag "Starting inactive domain config";
ok($dom->get_id() > 0, "running domain has an ID > 0");
$dom->destroy;

# new domain
my $newxml = $tck->generic_domain("tck")->as_xml;

my $newdom;
ok_domain(sub { $newdom = $conn->create_domain($newxml) }, "defined
domain config");
my $newuuid = $newdom->get_uuid_string();
diag $newuuid;
$newxml = $newdom->get_xml_description();

ok($newdom->get_id() > 0, "running domain has an ID > 0");
$newdom->destroy;
##########################################################

scripts/network/001-prepare-image.t .. 
1..4
ok 1 - defined domain config
# 4317db52-00bb-3cac-5639-91cdce05a717
# Starting inactive domain config
ok 2 - running domain has an ID > 0
ok 3 - defined domain config
# 4317db52-00bb-3cac-5639-91cdce05a717
libvirt error code: 42, message: Domain not found: no domain with
matching uuid '4317db52-00bb-3cac-5639-91cdce05a717'
# Looks like you planned 4 tests but ran 3.
# Looks like your test exited with 255 just after 3.
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 1/4 subtests 

Test Summary Report
-------------------
scripts/network/001-prepare-image.t (Wstat: 65280 Tests: 3 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 4 tests but ran 3.
Files=1, Tests=3,  1 wallclock secs ( 0.02 usr  0.01 sys +  0.19 cusr
0.04 csys =  0.26 CPU)
Result: FAIL

##########################################################
If I change
my $newxml = $tck->generic_domain("tck")->as_xml;
to 
my $newxml = $tck->generic_domain("tck2")->as_xml;
the script works as expected.

I am wondering if this is a problem in the libvirt-perl wrapper or
working as designed and my expectation is simply wrong? 

Thanks in advance...


-- 
Best regards, 

Gerhard Stenzel, 
-----------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294




More information about the libvir-list mailing list