Backup-Duplicity-YADW
view release on metacpan or search on metacpan
t/20-yadw.t view on Meta::CPAN
#!/usr/bin/perl
use Modern::Perl;
use warnings FATAL => 'all';
use Test::More;
use Backup::Duplicity::YADW;
use File::RandomGenerator;
use File::Path;
use Cwd;
use File::Copy;
use File::Basename;
use File::Which;
###### CONSTANTS ######
use constant TESTDIR => '/tmp/yadwtest';
###### GLOBAL VARS ######
use vars qw();
###### MAIN ######
system( 'rm -rf ' . TESTDIR );
if ( !which('duplicity') ) {
plan skip_all => 'unable to find duplicity on PATH';
}
generate_test_dir();
my $pidfile = get_pidfile();
ok( !-e $pidfile, );
my @cmd = qw( perl -I./lib ./bin/yadw full -c ./t/etc/test.conf);
system @cmd;
my $exit = $? >> 8;
ok !$exit;
ok( !-e $pidfile );
@cmd = qw( perl -I./lib ./bin/yadw inc -c ./t/etc/test.conf);
system @cmd;
$exit = $? >> 8;
ok !$exit;
ok( !-e $pidfile );
@cmd = qw( perl -I./lib ./bin/yadw verify -c ./t/etc/test.conf);
system @cmd;
$exit = $? >> 8;
ok !$exit;
ok( !-e $pidfile );
@cmd = qw( perl -I./lib ./bin/yadw expire -c ./t/etc/test.conf);
system @cmd;
$exit = $? >> 8;
ok !$exit;
ok( !-e $pidfile );
done_testing();
###### END MAIN ######
sub get_pidfile {
( run in 1.037 second using v1.01-cache-2.11-cpan-800906f7e73 )