Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
3b1413e1
Commit
3b1413e1
authored
May 10, 2019
by
Francesc Guasch
Browse files
test(backend): check unnecessary shutdowns removed
parent
6e1a7aba
Changes
1
Hide whitespace changes
Inline
Side-by-side
t/vm/10_domain.t
View file @
3b1413e1
...
...
@@ -208,6 +208,32 @@ sub test_pause_domain {
}
sub
test_shutdown
{
my
$vm
=
shift
;
return
if
$vm
->
type
eq
'
Void
';
my
$domain
=
create_domain
(
$vm
);
$domain
->
start
(
user_admin
);
my
$req
=
Ravada::
Request
->
shutdown_domain
(
uid
=>
user_admin
->
id
,
id_domain
=>
$domain
->
id
);
rvd_back
->
_process_requests_dont_fork
();
my
@reqs
=
$domain
->
list_requests
(
1
);
ok
(
scalar
@reqs
,
$domain
->
name
);
$domain
->
shutdown_now
(
user_admin
);
ok
(
!
$domain
->
is_active
);
rvd_back
->
_remove_unnecessary_downs
(
$domain
);
@reqs
=
$domain
->
list_requests
(
1
);
ok
(
!
scalar
@reqs
,
$domain
->
name
)
or
exit
;
$domain
->
remove
(
user_admin
);
}
sub
test_shutdown_paused_domain
{
my
$vm_name
=
shift
;
my
$domain
=
shift
;
...
...
@@ -492,7 +518,7 @@ sub test_vm_in_db {
remove_old_domains();
remove_old_disks();
for my
$vm_name
(
qw( Void KVM )
) {
for my
$vm_name
(
vm_names()
) {
my
$remote_conf
= remote_config (
$vm_name
);
my
@conf
= (undef, { host => 'localhost' });
...
...
@@ -528,6 +554,8 @@ for my $vm_name (qw( Void KVM )) {
use_ok(
$CLASS
) or next;
test_vm_in_db(
$vm_name
,
$conf
) if
$conf
;
test_shutdown(
$vm
);
test_vm_connect(
$vm_name
,
$host
,
$conf
);
test_search_vm(
$vm_name
,
$host
,
$conf
);
test_change_owner(
$vm_name
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment