tous les tests utilisent initco

master
Philippe Pittoli 2014-01-25 17:35:42 +01:00
parent e51f9d89dc
commit 86213e94d0
3 changed files with 6 additions and 54 deletions

View File

@ -10,30 +10,14 @@ use Data::Dump qw( dump );
use lib '../';
use app::app;
sub initco {
my $cfg = new Config::Simple('./config.ini');
my $app = app->new( zdir => $cfg->param('zones_path'),
dbname => $cfg->param('dbname'),
dbhost => $cfg->param('host'),
dbport => $cfg->param('port'),
dbuser => $cfg->param('user'),
dbpass => $cfg->param('passwd'),
sgbd => $cfg->param('sgbd'),
dnsapp => $cfg->param('dnsapp') );
$app->init();
return $app;
}
use initco;
if( @ARGV != 0 ) {
say "usage : ./get_all_domains.pl";
exit 1;
}
my $app = initco();
my $app = initco::initco();
my %domains = $app->get_all_domains();

View File

@ -10,30 +10,14 @@ use Data::Dump qw( dump );
use lib '../';
use app::app;
sub initco {
my $cfg = new Config::Simple('./config.ini');
my $app = app->new( zdir => $cfg->param('zones_path'),
dbname => $cfg->param('dbname'),
dbhost => $cfg->param('host'),
dbport => $cfg->param('port'),
dbuser => $cfg->param('user'),
dbpass => $cfg->param('passwd'),
sgbd => $cfg->param('sgbd'),
dnsapp => $cfg->param('dnsapp') );
$app->init();
return $app;
}
use initco;
if( @ARGV != 0 ) {
say "usage : ./get_all_domains.pl";
exit 1;
}
my $app = initco();
my $app = initco::initco();
my %users = $app->get_all_users();

View File

@ -10,30 +10,14 @@ use Data::Dump qw( dump );
use lib '../';
use app::app;
sub initco {
my $cfg = new Config::Simple('./config.ini');
my $app = app->new( zdir => $cfg->param('zones_path'),
dbname => $cfg->param('dbname'),
dbhost => $cfg->param('host'),
dbport => $cfg->param('port'),
dbuser => $cfg->param('user'),
dbpass => $cfg->param('passwd'),
sgbd => $cfg->param('sgbd'),
dnsapp => $cfg->param('dnsapp') );
$app->init();
return $app;
}
use initco;
if( @ARGV < 2) {
say "usage : ./auth.pl login mdp";
exit 1;
}
my $app = initco();
my $app = initco::initco();
my ($auth_ok, $user, $isadmin) = $app->auth($ARGV[0], $ARGV[1]);
if($auth_ok) {