diff --git a/Makefile b/Makefile index 42e72ac44..f8a6c0509 100644 --- a/Makefile +++ b/Makefile @@ -374,13 +374,13 @@ manager: manager_conf handler test: all common_test handler_test portal_test manager_test common_test: common - @$(MAKE) -C ${SRCCOMMONDIR} test + @HARNESS_OPTIONS=j8:c $(MAKE) -C ${SRCCOMMONDIR} test handler_test: handler @$(MAKE) -C ${SRCHANDLERDIR} test portal_test: portal - @$(MAKE) -C ${SRCPORTALDIR} test + @HARNESS_OPTIONS=j8:c $(MAKE) -C ${SRCPORTALDIR} test manager_test: manager @$(MAKE) -C ${SRCMANAGERDIR} test diff --git a/lemonldap-ng-common/t/03-Common-Conf-CDBI.t b/lemonldap-ng-common/t/03-Common-Conf-CDBI.t index b72c034d9..3520284ac 100644 --- a/lemonldap-ng-common/t/03-Common-Conf-CDBI.t +++ b/lemonldap-ng-common/t/03-Common-Conf-CDBI.t @@ -19,7 +19,7 @@ BEGIN { my $h; @ARGV = ("help=groups"); -unlink 't/lmConf.sql'; +unlink 't/cdbiConf.sql'; SKIP: { eval { require DBI; }; @@ -29,7 +29,7 @@ SKIP: { ok( $h = new Lemonldap::NG::Common::Conf( { type => 'CDBI', - dbiChain => "DBI:SQLite:dbname=t/lmConf.sql", + dbiChain => "DBI:SQLite:dbname=t/cdbiConf.sql", dbiUser => '', dbiPassword => '', } @@ -69,6 +69,6 @@ SKIP: { ok( $cfg->{test} eq $test[$i]->{test}, "Test $i is restored" ); } - unlink 't/lmConf.sql'; + unlink 't/cdbiConf.sql'; } diff --git a/lemonldap-ng-common/t/03-Common-Conf-RDBI.t b/lemonldap-ng-common/t/03-Common-Conf-RDBI.t index f81ec64b6..c7158caf2 100644 --- a/lemonldap-ng-common/t/03-Common-Conf-RDBI.t +++ b/lemonldap-ng-common/t/03-Common-Conf-RDBI.t @@ -19,7 +19,7 @@ BEGIN { my $h; @ARGV = ("help=groups"); -unlink 't/lmConf.sql'; +unlink 't/rdbiConf.sql'; SKIP: { eval { require DBI; }; @@ -29,7 +29,7 @@ SKIP: { ok( $h = new Lemonldap::NG::Common::Conf( { type => 'RDBI', - dbiChain => "DBI:SQLite:dbname=t/lmConf.sql", + dbiChain => "DBI:SQLite:dbname=t/rdbiConf.sql", dbiUser => '', dbiPassword => '', } @@ -70,6 +70,6 @@ SKIP: { ok( $cfg->{test} eq $test[$i]->{test}, "Test $i is restored" ); } - unlink 't/lmConf.sql'; + unlink 't/rdbiConf.sql'; } diff --git a/lemonldap-ng-handler/t/test-psgi-lib.pm b/lemonldap-ng-handler/t/test-psgi-lib.pm index c69e34fbe..39af14f73 100644 --- a/lemonldap-ng-handler/t/test-psgi-lib.pm +++ b/lemonldap-ng-handler/t/test-psgi-lib.pm @@ -3,6 +3,7 @@ use strict; use 5.10.0; use POSIX 'strftime'; +use Data::Dumper; use_ok('Lemonldap::NG::Common::PSGI::Cli::Lib'); our $client; diff --git a/lemonldap-ng-portal/.proverc b/lemonldap-ng-portal/.proverc index c97cb726a..695d42cf0 100644 --- a/lemonldap-ng-portal/.proverc +++ b/lemonldap-ng-portal/.proverc @@ -2,3 +2,4 @@ -I ../lemonldap-ng-common/blib/lib -I ../lemonldap-ng-handler/blib/lib --blib +--jobs 8 diff --git a/lemonldap-ng-portal/t/20-Auth-DBI-utf8.t b/lemonldap-ng-portal/t/20-Auth-DBI-utf8.t index f7e7241be..e15608446 100644 --- a/lemonldap-ng-portal/t/20-Auth-DBI-utf8.t +++ b/lemonldap-ng-portal/t/20-Auth-DBI-utf8.t @@ -7,14 +7,14 @@ require 't/test-lib.pm'; my $res; my $maintests = 8; -eval { unlink 't/userdb.db' }; +my $userdb = tempdb(); SKIP: { eval { require DBI; require DBD::SQLite; }; if ($@) { skip 'DBD::SQLite not found', $maintests; } - my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db"); + my $dbh = DBI->connect("dbi:SQLite:dbname=$userdb"); $dbh->do('CREATE TABLE users (user text,password text,cn text)'); $dbh->do( "INSERT INTO users VALUES ('french','french','Frédéric Accents')"); @@ -25,7 +25,7 @@ SKIP: { useSafeJail => 1, authentication => 'DBI', userDB => 'Same', - dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db', + dbiAuthChain => "dbi:SQLite:dbname=$userdb", dbiAuthUser => '', dbiAuthPassword => '', dbiAuthTable => 'users', @@ -83,6 +83,5 @@ SKIP: { clean_sessions(); } -eval { unlink 't/userdb.db' }; count($maintests); done_testing( count() ); diff --git a/lemonldap-ng-portal/t/20-Auth-and-password-DBI-dynamic-hash.t b/lemonldap-ng-portal/t/20-Auth-and-password-DBI-dynamic-hash.t index 2c8942068..bb0802a86 100644 --- a/lemonldap-ng-portal/t/20-Auth-and-password-DBI-dynamic-hash.t +++ b/lemonldap-ng-portal/t/20-Auth-and-password-DBI-dynamic-hash.t @@ -9,7 +9,7 @@ require 't/test-lib.pm'; my $res; my $maintests = 6; -eval { unlink 't/userdb.db' }; +my $userdb = tempdb(); SKIP: { eval @@ -90,7 +90,7 @@ SKIP: { } `; - my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db"); + my $dbh = DBI->connect("dbi:SQLite:dbname=$userdb"); $dbh->do('CREATE TABLE users (user text,password text,name text)'); @@ -112,7 +112,7 @@ SKIP: { useSafeJail => 1, authentication => 'DBI', userDB => 'Same', - dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db', + dbiAuthChain => "dbi:SQLite:dbname=$userdb", dbiAuthUser => '', dbiAuthPassword => '', dbiAuthTable => 'users', @@ -200,6 +200,5 @@ SKIP: { clean_sessions(); } -eval { unlink 't/userdb.db' }; count($maintests); done_testing( count() ); diff --git a/lemonldap-ng-portal/t/20-Auth-and-password-DBI.t b/lemonldap-ng-portal/t/20-Auth-and-password-DBI.t index 0d5e3528b..66f35f00d 100644 --- a/lemonldap-ng-portal/t/20-Auth-and-password-DBI.t +++ b/lemonldap-ng-portal/t/20-Auth-and-password-DBI.t @@ -7,14 +7,14 @@ require 't/test-lib.pm'; my $res; my $maintests = 3; -eval { unlink 't/userdb.db' }; +my $userdb = tempdb(); SKIP: { eval { require DBI; require DBD::SQLite; }; if ($@) { skip 'DBD::SQLite not found', $maintests; } - my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db"); + my $dbh = DBI->connect("dbi:SQLite:dbname=$userdb"); $dbh->do('CREATE TABLE users (user text,password text,name text)'); $dbh->do("INSERT INTO users VALUES ('dwho','dwho','Doctor who')"); my $client = LLNG::Manager::Test->new( { @@ -23,7 +23,7 @@ SKIP: { useSafeJail => 1, authentication => 'DBI', userDB => 'Same', - dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db', + dbiAuthChain => "dbi:SQLite:dbname=$userdb", dbiAuthUser => '', dbiAuthPassword => '', dbiAuthTable => 'users', @@ -78,6 +78,5 @@ SKIP: { $client->logout($id); clean_sessions(); } -eval { unlink 't/userdb.db' }; count($maintests); done_testing( count() ); diff --git a/lemonldap-ng-portal/t/28-AuthChoice-and-password.t b/lemonldap-ng-portal/t/28-AuthChoice-and-password.t index 45f6c41e1..5da794408 100644 --- a/lemonldap-ng-portal/t/28-AuthChoice-and-password.t +++ b/lemonldap-ng-portal/t/28-AuthChoice-and-password.t @@ -7,7 +7,7 @@ require 't/test-lib.pm'; my $res; my $maintests = 10; -eval { unlink 't/userdb.db' }; +my $userdb = tempdb(); SKIP: { eval { require DBI; require DBD::SQLite; }; @@ -16,7 +16,7 @@ SKIP: { } skip 'LLNGTESTLDAP is not set', $maintests unless ( $ENV{LLNGTESTLDAP} ); require 't/test-ldap.pm'; - my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db"); + my $dbh = DBI->connect("dbi:SQLite:dbname=$userdb"); $dbh->do('CREATE TABLE users (user text,password text,name text)'); $dbh->do("INSERT INTO users VALUES ('dwho','dwho','Doctor who')"); @@ -36,7 +36,7 @@ SKIP: { slave => 'Slave;LDAP;LDAP', }, - dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db', + dbiAuthChain => "dbi:SQLite:dbname=$userdb", dbiAuthUser => '', dbiAuthPassword => '', dbiAuthTable => 'users', @@ -116,7 +116,6 @@ SKIP: { clean_sessions(); } count($maintests); -eval { unlink 't/userdb.db' }; stopLdapServer() if $ENV{LLNGTESTLDAP}; clean_sessions(); done_testing( count() ); diff --git a/lemonldap-ng-portal/t/28-AuthChoice-with-rules.t b/lemonldap-ng-portal/t/28-AuthChoice-with-rules.t index 697b71ff2..b609dfc9a 100644 --- a/lemonldap-ng-portal/t/28-AuthChoice-with-rules.t +++ b/lemonldap-ng-portal/t/28-AuthChoice-with-rules.t @@ -10,14 +10,14 @@ BEGIN { my $res; my $maintests = 21; -eval { unlink 't/userdb.db' }; +my $userdb = tempdb(); SKIP: { eval { require DBI; require DBD::SQLite; require GSSAPI; }; if ($@) { skip 'Missing dependencies', $maintests; } - my $dbh = DBI->connect("dbi:SQLite:dbname=t/userdb.db"); + my $dbh = DBI->connect("dbi:SQLite:dbname=$userdb"); $dbh->do('CREATE TABLE users (user text,password text,name text)'); $dbh->do("INSERT INTO users VALUES ('dwho','dwho','Doctor who')"); @@ -42,7 +42,7 @@ SKIP: { '7_Kerberos' => 'Kerberos;Null;Null', }, - dbiAuthChain => 'dbi:SQLite:dbname=t/userdb.db', + dbiAuthChain => "dbi:SQLite:dbname=$userdb", dbiAuthUser => '', dbiAuthPassword => '', dbiAuthTable => 'users', @@ -144,6 +144,5 @@ m%