Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
348a6288
Commit
348a6288
authored
May 26, 2016
by
Francesc Guasch
Browse files
create bases from requests works now
parent
9e55ee7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
348a6288
...
...
@@ -292,8 +292,14 @@ sub _cmd_create {
my
$self
=
shift
;
my
$request
=
shift
;
$request
->
status
('
working
');
eval
{
$self
->
create_domain
(
%
{
$request
->
args
})
};
$request
->
status
('
creating domain
');
my
$domain
;
eval
{
$domain
=
$self
->
create_domain
(
%
{
$request
->
args
})
};
if
(
$request
->
args
('
is_base
')
)
{
$request
->
status
('
preparing base
');
$domain
->
prepare_base
();
}
$request
->
status
('
done
');
$request
->
error
(
$@
);
...
...
rvd_front.pl
View file @
348a6288
...
...
@@ -265,6 +265,7 @@ sub req_new_base {
my
$req
=
Ravada::
Request
->
create_domain
(
name
=>
$name
,
id_iso
=>
$c
->
param
('
id_iso
')
,
is_base
=>
1
);
wait_request_done
(
$c
,
$req
);
...
...
t/30_request.t
View file @
348a6288
...
...
@@ -69,6 +69,38 @@ sub test_req_create_domain_iso {
return
$domain
;
}
sub
test_req_create_base
{
my
$name
=
$DOMAIN_NAME
.
"
_base
";
my
$req
=
Ravada::
Request
->
create_domain
(
name
=>
$name
,
id_iso
=>
1
,
is_base
=>
1
);
ok
(
$req
);
ok
(
$req
->
status
);
ok
(
defined
$req
->
args
->
{
name
}
&&
$req
->
args
->
{
name
}
eq
$name
,"
Expecting args->{name} eq
$name
"
.
"
,got '
"
.
(
$req
->
args
->
{
name
}
or
'
<UNDEF>
')
.
"
'
");
ok
(
$req
->
status
eq
'
requested
'
,"
Status of request is
"
.
$req
->
status
.
"
it should be requested
");
$ravada
->
process_requests
();
ok
(
$req
->
status
eq
'
done
'
,"
Status of request is
"
.
$req
->
status
.
"
it should be done
");
ok
(
!
$req
->
error
,"
Error
"
.
$req
->
error
.
"
creating domain
"
.
$name
);
my
$domain
=
$ravada
->
search_domain
(
$name
);
ok
(
$domain
,"
I can't find domain
$name
");
ok
(
$domain
&&
$domain
->
is_base
,"
Domain
$name
should be base
");
return
$domain
;
}
sub
test_req_remove_domain_obj
{
my
$domain
=
shift
;
...
...
@@ -109,6 +141,12 @@ test_remove_domain($DOMAIN_NAME."_iso");
test_req_remove_domain_name
(
$domain
->
name
)
if
$domain
;
}
{
my
$domain
=
test_req_create_base
();
test_req_remove_domain_name
(
$domain
->
name
)
if
$domain
;
}
test_remove_domain
(
$DOMAIN_NAME
.
"
_iso
");
done_testing
();
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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