Commit 421f5b31 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Feature #894 master (#897)

* test(ldap): fixed ravada posix group test

issue #645

* test(volatile): check started if asked at clone

issue #894

* feature(backend): start on creation if requested

issue #894

* wip(test): install tables for ldap tests

issue #887

* test(ldap): create ldap user

issue #887

* test(ldap): test ldap posix group

issue #887

* test(ldap): create ldap user

issue #887

* test(ldap): use the same LDAP config file in all tests

* wip(backend): do not pass unnecessary VM

* wip(backend): remote_ip is a valid arg

issue #894

* wip(backend): pass the swap volume size if any

issue #894

* wip(frontend): ignore screenshot requests in listing

issue #894
parent a60d60f6
......@@ -866,11 +866,11 @@ sub list_requests($self, $id_domain_req=undef, $seconds=60) {
|| $command eq 'refresh_storage'
|| $command eq 'ping_backend'
|| $command eq 'cleanup'
|| $command eq 'screenshot'
;
next if ( $command eq 'force_shutdown'
|| $command eq 'start'
|| $command eq 'shutdown'
|| $command eq 'screenshot'
|| $command eq 'hibernate'
)
&& time - $epoch_date_changed > 5
......
......@@ -16,6 +16,7 @@ use_ok('Ravada::Auth::LDAP');
my $ADMIN_GROUP = "test.admin.group";
my $RAVADA_POSIX_GROUP = "rvd_posix_group";
my ($LDAP_USER , $LDAP_PASS) = ("cn=Directory Manager","saysomething");
init();
......@@ -262,6 +263,8 @@ sub _init_config($file_config, $with_admin, $with_posix_group) {
}
$config->{vm}=['KVM','Void'];
delete $config->{ldap}->{ravada_posix_group} if !$with_posix_group;
my $fly_config = "/var/tmp/$$.config";
DumpFile($fly_config, $config);
return $fly_config;
......
......@@ -13,7 +13,7 @@ use_ok('Ravada::Front');
use_ok('Ravada::Auth');
use_ok('Ravada::Auth::LDAP');
my $CONFIG_FILE = 't/etc/ravada_ldap_1.conf';
my $CONFIG_FILE = 't/etc/ravada_ldap.conf';
init( $CONFIG_FILE);
rvd_back();
......@@ -28,6 +28,7 @@ sub test_ldap {
config => $CONFIG_FILE
,connector => connector()
);
delete $Ravada::CONFIG->{ldap}->{ravada_posix_group};
create_ldap_user($USER_DATA->{name}, $USER_DATA->{password});
my $login_ok;
eval { $login_ok = Ravada::Auth::login($USER_DATA->{name}, $USER_DATA->{password}) };
......@@ -67,6 +68,7 @@ sub test_ldap {
#########################################################################
SKIP: {
<<<<<<< HEAD
my $ravada = Ravada->new(config => $CONFIG_FILE
, connector => connector());
$ravada->_install();
......@@ -77,6 +79,28 @@ SKIP: {
if ($@ =~ /Bad credentials/) {
diag("$@\nFix admin credentials in $CONFIG_FILE");
||||||| parent of 6811de74... Feature #894 master (#897)
my $ok = 1;
$USER_DATA = LoadFile($file_test_data) if -e $file_test_data;
if (!-e $file_test_data || !$USER_DATA->{name} || !$USER_DATA->{password}) {
my $config = {
name => 'ldap.cn', password => '****'
};
warn "SKIPPED: To test Front LDAP create the file $file_test_data with\n"
.YAML::Dump($config);
$ok = 0;
=======
my $ravada = Ravada->new(config => $CONFIG_FILE
, connector => connector);
$ravada->_install();
my $ldap;
eval { $ldap = Ravada::Auth::LDAP::_init_ldap_admin() };
if ($@ =~ /Bad credentials/) {
diag("$@\nFix admin credentials in $CONFIG_FILE");
>>>>>>> 6811de74... Feature #894 master (#897)
} else {
diag("Skipped LDAP tests ".($@ or '')) if !$ldap;
}
......
......@@ -49,6 +49,7 @@ create_domain
add_ubuntu_minimal_iso
create_ldap_user
connector
create_ldap_user
);
our $DEFAULT_CONFIG = "t/etc/ravada.conf";
......
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