Commit 83033827 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

refactor(test): fixed some output expected

parent d03bc24c
......@@ -3992,7 +3992,7 @@ sub rsync($self, @args) {
my $msg = $self->_msg_log_rsync($file, $node, "rsync", $request);
$request->status("syncing") if $request;
$request->error("Syncing $file");
$request->error("Syncing $file") if $request;
$request->error($msg) if $request && $DEBUG_RSYNC;
warn "$msg\n" if $DEBUG_RSYNC;
......@@ -4009,7 +4009,7 @@ sub rsync($self, @args) {
.Dumper($files)."\n"
.join(' ',@{$rsync->err});
}
$request->error("rsync done ".(time - $time_rsync)." seconds");
$request->error("rsync done ".(time - $time_rsync)." seconds") if $request;
$node->refresh_storage_pools();
}
......
......@@ -725,7 +725,7 @@ sub test_clone_not_in_node {
$domain->prepare_base(user_admin);
is($domain->base_in_vm($vm->id), 1);
$domain->set_base_vm(vm => $node, user => user_admin);
wait_request(debug => 1);
wait_request(debug => 0);
is($domain->base_in_vm($node->id), 1);
......@@ -979,6 +979,7 @@ sub test_migrate_back($node) {
eval { $clone->migrate($vm) };
is(''.$@, '');
wait_request(debug => 0);
for my $file ($clone->list_volumes) {
my $md5 = _md5($file, $vm);
my $md5_remote = _md5($file, $node);
......@@ -1023,7 +1024,7 @@ sub test_shutdown($node) {
my $req = Ravada::Request->refresh_vms();
wait_request(debug => 0);
is($req->status,'done');
is($req->error,'');
like($req->error,qr{^($|checked \d+)});
my $clone2 = Ravada::Domain->open($clone->id); #open will clean internal shutdown
is($clone2->is_active,0) or exit;
......
......@@ -866,7 +866,11 @@ sub wait_request {
like($req->error,qr(^$|libvirt error code));
} else {
my $error = ($req->error or '');
is($error,'') or confess $req->command;
if ($req->command =~ m{rsync_back|set_base_vm|start}) {
like($error,qr{^($|rsync done)});
} else {
is($error,'') or confess $req->command;
}
}
}
}
......
......@@ -494,7 +494,7 @@ sub test_set_vm($vm, $node) {
);
rvd_back->_process_requests_dont_fork();
is($req->status, 'done');
is($req->error, '');
like($req->error, qr{^($|rsync done)});
is($base->_vm->id, $vm->id);
......@@ -541,7 +541,7 @@ sub test_bind_ip($node, $base, $remote_ip=undef, $config=undef) {
,@remote_ip
);
wait_request();
is($req->error, '');
like($req->error, qr{^($|rsync done)});
my $clone_v = Ravada::Domain->open($clone->id);
if ($clone_v->is_local) {
if (!$config) {
......@@ -555,7 +555,7 @@ sub test_bind_ip($node, $base, $remote_ip=undef, $config=undef) {
like($clone_v->display(user_admin), qr($node_ip));
}
is($req->status,'done');
is($req->error, '');
like($req->error, qr{^($|rsync done)});
push @clone,($clone);
$clone_2 = Ravada::Domain->open($clone->id);
last if $clone_2->_vm->id == $node->id;
......@@ -1155,14 +1155,14 @@ sub test_migrate_req($vm, $node) {
, retry => 10
);
for ( 1 .. 30 ) {
wait_request( debug => 1, check_error => 0);
wait_request( debug => 0, check_error => 0);
is($req->status,'done');
last if !$req->error;
last if !$req->error || $req->error =~ /rsync done/;
diag($req->status);
diag($req->error." try : ".$req->retry);
sleep 1;
}
is($req->error,'') or exit;
like($req->error,qr{^($|rsync done)}) or exit;
my $domain3 = Ravada::Domain->open($domain->id);
is($domain3->is_active,1);
......
......@@ -38,7 +38,7 @@ sub test_down_node($vm, $node) {
my $req = Ravada::Request->refresh_vms();
rvd_back->_process_requests_dont_fork();
is($req->status, 'done');
is($req->error, '',"Expecting no error after refresh vms");
like($req->error, qr{^($|checked)},"Expecting no error after refresh vms");
is($clone[0]->is_active, 0, "Expecting clone not active after node shutdown");
......@@ -90,7 +90,7 @@ sub test_disabled_node($vm, $node) {
my $req = Ravada::Request->refresh_vms( timeout_shutdown => $timeout );
rvd_back->_process_requests_dont_fork();
is($req->status, 'done');
is($req->error, '',"Expecting no error after refresh vms");
like($req->error, qr{^($|checked)},"Expecting no error after refresh vms");
my @reqs = $clone->list_requests();
delete $clone->{_data};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment