3
0

tous les tests utilisent initco

This commit is contained in:
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 lib '../';
use app::app; use app::app;
use initco;
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;
}
if( @ARGV != 0 ) { if( @ARGV != 0 ) {
say "usage : ./get_all_domains.pl"; say "usage : ./get_all_domains.pl";
exit 1; exit 1;
} }
my $app = initco(); my $app = initco::initco();
my %domains = $app->get_all_domains(); my %domains = $app->get_all_domains();

View File

@ -10,30 +10,14 @@ use Data::Dump qw( dump );
use lib '../'; use lib '../';
use app::app; use app::app;
use initco;
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;
}
if( @ARGV != 0 ) { if( @ARGV != 0 ) {
say "usage : ./get_all_domains.pl"; say "usage : ./get_all_domains.pl";
exit 1; exit 1;
} }
my $app = initco(); my $app = initco::initco();
my %users = $app->get_all_users(); my %users = $app->get_all_users();

View File

@ -10,30 +10,14 @@ use Data::Dump qw( dump );
use lib '../'; use lib '../';
use app::app; use app::app;
use initco;
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;
}
if( @ARGV < 2) { if( @ARGV < 2) {
say "usage : ./auth.pl login mdp"; say "usage : ./auth.pl login mdp";
exit 1; exit 1;
} }
my $app = initco(); my $app = initco::initco();
my ($auth_ok, $user, $isadmin) = $app->auth($ARGV[0], $ARGV[1]); my ($auth_ok, $user, $isadmin) = $app->auth($ARGV[0], $ARGV[1]);
if($auth_ok) { if($auth_ok) {