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

test(grants): some grants may be disabled

issue #698
parent 01d3ebdf
......@@ -18,6 +18,9 @@ my $test = Test::SQL::Data->new(config => 't/etc/sql.conf');
my $CONFIG_FILE = 't/etc/ravada_ldap_1.conf';
init($test->connector, $CONFIG_FILE);
rvd_back();
my $RVD_FRONT;
my $USER_DATA;
......
......@@ -29,31 +29,31 @@ sub test_defaults {
ok($user->can_clone);
ok($user->can_change_settings);
ok($user->can_screenshot);
# ok($user->can_screenshot);
ok($user->can_remove);
ok(!$user->can_remove_clone);
ok(!$user->can_clone_all);
# ok(!$user->can_clone_all);
ok(!$user->can_change_settings_all);
ok(!$user->can_change_settings_clones);
ok(!$user->can_screenshot_all);
# ok(!$user->can_screenshot_all);
ok(!$user->can_grant);
ok(!$user->can_create_base);
ok(!$user->can_create_machine);
ok(!$user->can_remove_all);
# ok(!$user->can_remove_all);
ok(!$user->can_remove_clone_all);
ok(!$user->can_shutdown_clone);
# ok(!$user->can_shutdown_clone);
ok(!$user->can_shutdown_all);
ok(!$user->can_hibernate_clone);
ok(!$user->can_hibernate_all);
ok(!$user->can_hibernate_clone_all);
# ok(!$user->can_hibernate_clone);
# ok(!$user->can_hibernate_all);
# ok(!$user->can_hibernate_clone_all);
ok(!$user->can_manage_users);
......@@ -134,6 +134,7 @@ sub test_remove_clone {
ok($clone2, "Expecting ".$clone->name." not removed");
$usera->grant($user,'remove_clone');
is($user->can_remove_clone, 1);
eval { $clone->remove($user); };
is($@,'');
......@@ -213,6 +214,7 @@ sub test_shutdown_clone {
is($clone->is_active,1) or return;
$usera->grant($user,'shutdown_clone');
is($user->can_shutdown_clone,1);
eval { $clone->shutdown_now($user); };
is($@,'');
......@@ -644,6 +646,10 @@ sub test_change_settings($vm_name) {
}
sub test_clone_all {
diag("TODO test clone all");
}
##########################################################
test_defaults();
......@@ -671,4 +677,6 @@ test_create_domain('Void');
test_create_domain2('Void');
test_view_clones('Void');
test_clone_all($vm_name);
done_testing();
Markdown is supported
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