1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-17 01:12:23 +02:00

Added --exe param to allow testing of packaged versions.

Updates to u12 vagrant vm.
This commit is contained in:
David Steele
2015-07-11 17:16:35 -04:00
parent e9ce4efedf
commit b777525f62
4 changed files with 33 additions and 19 deletions

View File

@ -11,7 +11,7 @@ use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use Cwd 'abs_path';
use Cwd qw(abs_path cwd);
use Exporter qw(import);
use File::Basename;
use File::Copy qw(move);
@ -48,6 +48,7 @@ our @EXPORT = qw(BackRestTestCommon_Create BackRestTestCommon_Drop BackRestTestC
my $strPgSqlBin;
my $strCommonStanza;
my $strCommonCommandMain;
my $bCommandMainSet = false;
my $strCommonCommandRemote;
my $strCommonCommandRemoteFull;
my $strCommonCommandPsql;
@ -741,6 +742,7 @@ sub BackRestTestCommon_FileRemove
####################################################################################################################################
sub BackRestTestCommon_Setup
{
my $strExe = shift;
my $strTestPathParam = shift;
my $strPgSqlBinParam = shift;
my $iModuleTestRunOnlyParam = shift;
@ -764,7 +766,7 @@ sub BackRestTestCommon_Setup
}
else
{
$strCommonTestPath = "${strCommonBasePath}/test/test";
$strCommonTestPath = cwd() . "/test";
}
$strCommonDataPath = "${strCommonBasePath}/test/data";
@ -774,8 +776,9 @@ sub BackRestTestCommon_Setup
$strCommonDbCommonPath = "${strCommonTestPath}/db/common";
$strCommonDbTablespacePath = "${strCommonTestPath}/db/tablespace";
$strCommonCommandMain = $strCommonBasePath . "/bin/../bin/pg_backrest";
$strCommonCommandRemote = "${strCommonBasePath}/bin/pg_backrest";
$strCommonCommandMain = defined($strExe) ? $strExe : $strCommonBasePath . "/bin/../bin/pg_backrest";
$bCommandMainSet = defined($strExe) ? true : false;
$strCommonCommandRemote = defined($strExe) ? $strExe : "${strCommonBasePath}/bin/pg_backrest";
$strCommonCommandRemoteFull = "${strCommonCommandRemote} --stanza=${strCommonStanza}" .
" --repo-remote-path=${strCommonRepoPath} --no-config remote";
$strCommonCommandPsql = "${strPgSqlBin}/psql -X %option% -h ${strCommonDbPath}";
@ -1192,7 +1195,12 @@ sub BackRestTestCommon_CommandMainGet
sub BackRestTestCommon_CommandMainAbsGet
{
return abs_path($strCommonCommandMain);
if ($bCommandMainSet)
{
return BackRestTestCommon_CommandMainGet()
}
return abs_path(BackRestTestCommon_CommandMainGet());
}
sub BackRestTestCommon_CommandRemoteGet