You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-03 00:26:59 +02:00
Make storage type more generic in the integration tests.
Rather than bS3 use strStorage which can indicate more than two storage types. For the moment there are still only two storage types but this change is required before more can be added.
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
run 001 - rmt 0, s3 0, enc 0, delta 1
|
run 001 - rmt 0, storage posix, enc 0, delta 1
|
||||||
=====================================
|
==============================================
|
||||||
|
|
||||||
> [CONTAINER-EXEC] db-master [BACKREST-BIN] version
|
> [CONTAINER-EXEC] db-master [BACKREST-BIN] version
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 002 - rmt 1, s3 1, enc 1, delta 0
|
run 002 - rmt 1, storage s3, enc 1, delta 0
|
||||||
=====================================
|
===========================================
|
||||||
|
|
||||||
stanza-create db - create required data for stanza (backup host)
|
stanza-create db - create required data for stanza (backup host)
|
||||||
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --no-online stanza-create
|
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --no-online stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 001 - rmt 0, s3 0, enc 1, cmp lz4
|
run 001 - rmt 0, storage posix, enc 1, cmp lz4
|
||||||
=====================================
|
==============================================
|
||||||
|
|
||||||
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-push [TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000001
|
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-push [TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000001
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 002 - rmt 1, s3 1, enc 0, cmp zst
|
run 002 - rmt 1, storage s3, enc 0, cmp zst
|
||||||
=====================================
|
===========================================
|
||||||
|
|
||||||
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-push [TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000001
|
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-push [TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000001
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 001 - rmt 0, cmp none, error version, s3 0, enc 1
|
run 001 - rmt 0, cmp none, error version, storage posix, enc 1
|
||||||
=====================================================
|
==============================================================
|
||||||
|
|
||||||
stanza-create db - create required data for stanza (db-master host)
|
stanza-create db - create required data for stanza (db-master host)
|
||||||
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --no-online stanza-create
|
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --no-online stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 002 - rmt 1, cmp lz4, error connect, s3 1, enc 0
|
run 002 - rmt 1, cmp lz4, error connect, storage s3, enc 0
|
||||||
====================================================
|
==========================================================
|
||||||
|
|
||||||
stanza-create db - create required data for stanza (backup host)
|
stanza-create db - create required data for stanza (backup host)
|
||||||
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --no-online stanza-create
|
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --no-online stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 001 - simple, enc 0, s3 0
|
run 001 - simple, enc 0, storage posix
|
||||||
=============================
|
======================================
|
||||||
|
|
||||||
* full backup: label = [BACKUP-FULL-1], start = 000000010000000000000000, stop = 000000010000000000000002
|
* full backup: label = [BACKUP-FULL-1], start = 000000010000000000000000, stop = 000000010000000000000002
|
||||||
* incr backup: label = [BACKUP-INCR-1], prior = [BACKUP-FULL-1], start = 000000010000000000000006, stop = 0000000100000000000000FB
|
* incr backup: label = [BACKUP-INCR-1], prior = [BACKUP-FULL-1], start = 000000010000000000000006, stop = 0000000100000000000000FB
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 002 - stanzaUpgrade, enc 0, s3 0
|
run 002 - stanzaUpgrade, enc 0, storage posix
|
||||||
====================================
|
=============================================
|
||||||
|
|
||||||
* full backup: label = [BACKUP-FULL-1], start = 000000010000000000000000, stop = 000000010000000000000002
|
* full backup: label = [BACKUP-FULL-1], start = 000000010000000000000000, stop = 000000010000000000000002
|
||||||
* incr backup: label = [BACKUP-INCR-1], prior = [BACKUP-FULL-1], start = 000000010000000000000006, stop = 000000010000000000000008
|
* incr backup: label = [BACKUP-INCR-1], prior = [BACKUP-FULL-1], start = 000000010000000000000006, stop = 000000010000000000000008
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 001 - remote 0, s3 0, enc 0, cmp zst
|
run 001 - remote 0, storage posix, enc 0, cmp zst
|
||||||
========================================
|
=================================================
|
||||||
|
|
||||||
stanza-create db - fail on missing control file (db-master host)
|
stanza-create db - fail on missing control file (db-master host)
|
||||||
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --no-online --log-level-file=[LOG-LEVEL-FILE] stanza-create
|
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db --no-online --log-level-file=[LOG-LEVEL-FILE] stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 002 - remote 1, s3 1, enc 1, cmp lz4
|
run 002 - remote 1, storage s3, enc 1, cmp lz4
|
||||||
========================================
|
==============================================
|
||||||
|
|
||||||
stanza-create db - fail on missing control file (backup host)
|
stanza-create db - fail on missing control file (backup host)
|
||||||
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --no-online --log-level-file=[LOG-LEVEL-FILE] stanza-create
|
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --no-online --log-level-file=[LOG-LEVEL-FILE] stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 001 - bkp 0, sby 0, dst db-master, cmp none, s3 0, enc 0
|
run 001 - bkp 0, sby 0, dst db-master, cmp none, storage posix, enc 0
|
||||||
============================================================
|
=====================================================================
|
||||||
|
|
||||||
stanza-create db - main create stanza info files (db-master host)
|
stanza-create db - main create stanza info files (db-master host)
|
||||||
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db stanza-create
|
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 002 - bkp 0, sby 1, dst db-master, cmp none, s3 0, enc 0
|
run 002 - bkp 0, sby 1, dst db-master, cmp none, storage posix, enc 0
|
||||||
============================================================
|
=====================================================================
|
||||||
|
|
||||||
stanza-create db - main create stanza info files (db-master host)
|
stanza-create db - main create stanza info files (db-master host)
|
||||||
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db stanza-create
|
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 003 - bkp 0, sby 1, dst db-standby, cmp none, s3 0, enc 0
|
run 003 - bkp 0, sby 1, dst db-standby, cmp none, storage posix, enc 0
|
||||||
=============================================================
|
======================================================================
|
||||||
|
|
||||||
stanza-create db - main create stanza info files (db-standby host)
|
stanza-create db - main create stanza info files (db-standby host)
|
||||||
> [CONTAINER-EXEC] db-standby [BACKREST-BIN] --config=[TEST_PATH]/db-standby/pgbackrest.conf --stanza=db stanza-create
|
> [CONTAINER-EXEC] db-standby [BACKREST-BIN] --config=[TEST_PATH]/db-standby/pgbackrest.conf --stanza=db stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 004 - bkp 1, sby 0, dst backup, cmp lz4, s3 0, enc 1
|
run 004 - bkp 1, sby 0, dst backup, cmp lz4, storage posix, enc 1
|
||||||
========================================================
|
=================================================================
|
||||||
|
|
||||||
stanza-create db - main create stanza info files (backup host)
|
stanza-create db - main create stanza info files (backup host)
|
||||||
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db stanza-create
|
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 005 - bkp 1, sby 1, dst backup, cmp none, s3 0, enc 0
|
run 005 - bkp 1, sby 1, dst backup, cmp none, storage posix, enc 0
|
||||||
=========================================================
|
==================================================================
|
||||||
|
|
||||||
stanza-create db - main create stanza info files (backup host)
|
stanza-create db - main create stanza info files (backup host)
|
||||||
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db stanza-create
|
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db stanza-create
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
run 006 - bkp 1, sby 0, dst backup, cmp zst, s3 1, enc 0
|
run 006 - bkp 1, sby 0, dst backup, cmp zst, storage s3, enc 0
|
||||||
========================================================
|
==============================================================
|
||||||
|
|
||||||
stanza-create db - main create stanza info files (backup host)
|
stanza-create db - main create stanza info files (backup host)
|
||||||
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db stanza-create
|
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db stanza-create
|
||||||
|
@ -73,10 +73,12 @@ use constant CFGOPTVAL_BACKUP_TYPE_INCR => 'incr';
|
|||||||
use constant CFGOPTVAL_REPO_CIPHER_TYPE_AES_256_CBC => 'aes-256-cbc';
|
use constant CFGOPTVAL_REPO_CIPHER_TYPE_AES_256_CBC => 'aes-256-cbc';
|
||||||
push @EXPORT, qw(CFGOPTVAL_REPO_CIPHER_TYPE_AES_256_CBC);
|
push @EXPORT, qw(CFGOPTVAL_REPO_CIPHER_TYPE_AES_256_CBC);
|
||||||
|
|
||||||
use constant STORAGE_CIFS => 'cifs';
|
use constant CIFS => 'cifs';
|
||||||
push @EXPORT, qw(STORAGE_CIFS);
|
push @EXPORT, qw(CIFS);
|
||||||
use constant STORAGE_S3 => 's3';
|
use constant POSIX => STORAGE_POSIX;
|
||||||
push @EXPORT, qw(STORAGE_S3);
|
push @EXPORT, qw(POSIX);
|
||||||
|
use constant S3 => 's3';
|
||||||
|
push @EXPORT, qw(S3);
|
||||||
|
|
||||||
use constant CFGOPTVAL_RESTORE_TYPE_DEFAULT => 'default';
|
use constant CFGOPTVAL_RESTORE_TYPE_DEFAULT => 'default';
|
||||||
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_DEFAULT);
|
push @EXPORT, qw(CFGOPTVAL_RESTORE_TYPE_DEFAULT);
|
||||||
@ -456,7 +458,7 @@ sub backupEnd
|
|||||||
my $strLatestLink = $self->repoBackupPath(LINK_LATEST);
|
my $strLatestLink = $self->repoBackupPath(LINK_LATEST);
|
||||||
my $bLatestLinkExists = storageRepo()->exists($strLatestLink);
|
my $bLatestLinkExists = storageRepo()->exists($strLatestLink);
|
||||||
|
|
||||||
if ((!defined($oParam->{strRepoType}) || $oParam->{strRepoType} eq STORAGE_POSIX) && $self->hasLink())
|
if ((!defined($oParam->{strRepoType}) || $oParam->{strRepoType} eq POSIX) && $self->hasLink())
|
||||||
{
|
{
|
||||||
my $strLatestLinkDestination = readlink($strLatestLink);
|
my $strLatestLinkDestination = readlink($strLatestLink);
|
||||||
|
|
||||||
@ -1181,9 +1183,9 @@ sub configCreate
|
|||||||
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-path'} = $self->repoPath();
|
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-path'} = $self->repoPath();
|
||||||
|
|
||||||
# S3 settings
|
# S3 settings
|
||||||
if ($oParam->{bS3})
|
if ($oParam->{strStorage} eq S3)
|
||||||
{
|
{
|
||||||
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-type'} = STORAGE_S3;
|
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-type'} = S3;
|
||||||
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-s3-key'} = HOST_S3_ACCESS_KEY;
|
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-s3-key'} = HOST_S3_ACCESS_KEY;
|
||||||
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-s3-key-secret'} = HOST_S3_ACCESS_SECRET_KEY;
|
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-s3-key-secret'} = HOST_S3_ACCESS_SECRET_KEY;
|
||||||
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-s3-bucket'} = HOST_S3_BUCKET;
|
$oParamHash{&CFGDEF_SECTION_GLOBAL}{'repo1-s3-bucket'} = HOST_S3_BUCKET;
|
||||||
|
@ -53,13 +53,13 @@ sub setup
|
|||||||
my $oLogTest = shift;
|
my $oLogTest = shift;
|
||||||
my $oConfigParam = shift;
|
my $oConfigParam = shift;
|
||||||
|
|
||||||
# Start S3 server first since it takes the longest
|
# Start object server first since it takes the longest
|
||||||
#-------------------------------------------------------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------------------------------------------------------
|
||||||
my $oHostS3;
|
my $oHostObject;
|
||||||
|
|
||||||
if ($oConfigParam->{bS3})
|
if ($oConfigParam->{strStorage} eq S3)
|
||||||
{
|
{
|
||||||
$oHostS3 = new pgBackRestTest::Env::Host::HostS3Test();
|
$oHostObject = new pgBackRestTest::Env::Host::HostS3Test();
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get host group
|
# Get host group
|
||||||
@ -78,7 +78,7 @@ sub setup
|
|||||||
|
|
||||||
$oHostBackup = new pgBackRestTest::Env::Host::HostBackupTest(
|
$oHostBackup = new pgBackRestTest::Env::Host::HostBackupTest(
|
||||||
{strBackupDestination => $strBackupDestination, bSynthetic => $bSynthetic, oLogTest => $oLogTest,
|
{strBackupDestination => $strBackupDestination, bSynthetic => $bSynthetic, oLogTest => $oLogTest,
|
||||||
bRepoLocal => !$oConfigParam->{bS3}, bRepoEncrypt => $bRepoEncrypt});
|
bRepoLocal => $oConfigParam->{strStorage} eq POSIX, bRepoEncrypt => $bRepoEncrypt});
|
||||||
$oHostGroup->hostAdd($oHostBackup);
|
$oHostGroup->hostAdd($oHostBackup);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -93,14 +93,14 @@ sub setup
|
|||||||
if ($bSynthetic)
|
if ($bSynthetic)
|
||||||
{
|
{
|
||||||
$oHostDbMaster = new pgBackRestTest::Env::Host::HostDbSyntheticTest(
|
$oHostDbMaster = new pgBackRestTest::Env::Host::HostDbSyntheticTest(
|
||||||
{strBackupDestination => $strBackupDestination, oLogTest => $oLogTest, bRepoLocal => !$oConfigParam->{bS3},
|
{strBackupDestination => $strBackupDestination, oLogTest => $oLogTest,
|
||||||
bRepoEncrypt => $bRepoEncrypt});
|
bRepoLocal => $oConfigParam->{strStorage} eq POSIX, bRepoEncrypt => $bRepoEncrypt});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$oHostDbMaster = new pgBackRestTest::Env::Host::HostDbTest(
|
$oHostDbMaster = new pgBackRestTest::Env::Host::HostDbTest(
|
||||||
{strBackupDestination => $strBackupDestination, oLogTest => $oLogTest, bRepoLocal => !$oConfigParam->{bS3},
|
{strBackupDestination => $strBackupDestination, oLogTest => $oLogTest, bRepoLocal =>
|
||||||
bRepoEncrypt => $bRepoEncrypt});
|
$oConfigParam->{strStorage} eq POSIX, bRepoEncrypt => $bRepoEncrypt});
|
||||||
}
|
}
|
||||||
|
|
||||||
$oHostGroup->hostAdd($oHostDbMaster);
|
$oHostGroup->hostAdd($oHostDbMaster);
|
||||||
@ -112,16 +112,16 @@ sub setup
|
|||||||
{
|
{
|
||||||
$oHostDbStandby = new pgBackRestTest::Env::Host::HostDbTest(
|
$oHostDbStandby = new pgBackRestTest::Env::Host::HostDbTest(
|
||||||
{strBackupDestination => $strBackupDestination, bStandby => true, oLogTest => $oLogTest,
|
{strBackupDestination => $strBackupDestination, bStandby => true, oLogTest => $oLogTest,
|
||||||
bRepoLocal => !$oConfigParam->{bS3}});
|
bRepoLocal => $oConfigParam->{strStorage} eq POSIX});
|
||||||
|
|
||||||
$oHostGroup->hostAdd($oHostDbStandby);
|
$oHostGroup->hostAdd($oHostDbStandby);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Finalize S3 server
|
# Finalize S3 server
|
||||||
#-------------------------------------------------------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------------------------------------------------------
|
||||||
if (defined($oHostS3))
|
if ($oConfigParam->{strStorage} eq S3)
|
||||||
{
|
{
|
||||||
$oHostGroup->hostAdd($oHostS3, {rstryHostName => ['pgbackrest-dev.s3.amazonaws.com', 's3.amazonaws.com']});
|
$oHostGroup->hostAdd($oHostObject, {rstryHostName => ['pgbackrest-dev.s3.amazonaws.com', 's3.amazonaws.com']});
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create db master config
|
# Create db master config
|
||||||
@ -130,7 +130,7 @@ sub setup
|
|||||||
strCompressType => $$oConfigParam{strCompressType},
|
strCompressType => $$oConfigParam{strCompressType},
|
||||||
bHardlink => $bHostBackup ? undef : $$oConfigParam{bHardLink},
|
bHardlink => $bHostBackup ? undef : $$oConfigParam{bHardLink},
|
||||||
bArchiveAsync => $$oConfigParam{bArchiveAsync},
|
bArchiveAsync => $$oConfigParam{bArchiveAsync},
|
||||||
bS3 => $$oConfigParam{bS3}});
|
strStorage => $oConfigParam->{strStorage}});
|
||||||
|
|
||||||
# Create backup config if backup host exists
|
# Create backup config if backup host exists
|
||||||
if (defined($oHostBackup))
|
if (defined($oHostBackup))
|
||||||
@ -138,7 +138,7 @@ sub setup
|
|||||||
$oHostBackup->configCreate({
|
$oHostBackup->configCreate({
|
||||||
strCompressType => $$oConfigParam{strCompressType},
|
strCompressType => $$oConfigParam{strCompressType},
|
||||||
bHardlink => $$oConfigParam{bHardLink},
|
bHardlink => $$oConfigParam{bHardLink},
|
||||||
bS3 => $$oConfigParam{bS3}});
|
strStorage => $oConfigParam->{strStorage}});
|
||||||
}
|
}
|
||||||
# If backup host is not defined set it to db-master
|
# If backup host is not defined set it to db-master
|
||||||
else
|
else
|
||||||
@ -150,8 +150,9 @@ sub setup
|
|||||||
$self->backrestExeHelper() .
|
$self->backrestExeHelper() .
|
||||||
' --config=' . $oHostBackup->backrestConfig() . ' --stanza=' . $self->stanza() . ' --log-level-console=off' .
|
' --config=' . $oHostBackup->backrestConfig() . ' --stanza=' . $self->stanza() . ' --log-level-console=off' .
|
||||||
' --log-level-stderr=error' .
|
' --log-level-stderr=error' .
|
||||||
($oConfigParam->{bS3} ? ' --no-repo1-s3-verify-tls --repo1-s3-host=' . $oHostS3->ipGet() : ''),
|
($oConfigParam->{strStorage} ne POSIX ? " --no-repo1-$oConfigParam->{strStorage}-verify-tls" .
|
||||||
$oConfigParam->{bS3} ? STORAGE_OBJECT : STORAGE_POSIX);
|
" --repo1-$oConfigParam->{strStorage}-host=" . $oHostObject->ipGet() : ''),
|
||||||
|
$oConfigParam->{strStorage} eq POSIX ? STORAGE_POSIX : STORAGE_OBJECT);
|
||||||
|
|
||||||
# Create db-standby config
|
# Create db-standby config
|
||||||
if (defined($oHostDbStandby))
|
if (defined($oHostDbStandby))
|
||||||
@ -160,16 +161,17 @@ sub setup
|
|||||||
strBackupSource => $$oConfigParam{strBackupSource},
|
strBackupSource => $$oConfigParam{strBackupSource},
|
||||||
strCompressType => $$oConfigParam{strCompressType},
|
strCompressType => $$oConfigParam{strCompressType},
|
||||||
bHardlink => $bHostBackup ? undef : $$oConfigParam{bHardLink},
|
bHardlink => $bHostBackup ? undef : $$oConfigParam{bHardLink},
|
||||||
bArchiveAsync => $$oConfigParam{bArchiveAsync}});
|
bArchiveAsync => $$oConfigParam{bArchiveAsync},
|
||||||
|
strStorage => $oConfigParam->{strStorage}});
|
||||||
}
|
}
|
||||||
|
|
||||||
# Create S3 bucket
|
# Create object storage
|
||||||
if (defined($oHostS3))
|
if (defined($oHostObject))
|
||||||
{
|
{
|
||||||
storageRepo()->create();
|
storageRepo()->create();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3;
|
return $oHostDbMaster, $oHostDbStandby, $oHostBackup;
|
||||||
}
|
}
|
||||||
|
|
||||||
####################################################################################################################################
|
####################################################################################################################################
|
||||||
|
@ -205,14 +205,14 @@ sub run
|
|||||||
|
|
||||||
foreach my $rhRun
|
foreach my $rhRun
|
||||||
(
|
(
|
||||||
{vm => VM1, remote => false, s3 => true, encrypt => false, delta => true, compress => LZ4},
|
{vm => VM1, remote => false, storage => S3, encrypt => false, delta => true, compress => LZ4},
|
||||||
{vm => VM1, remote => true, s3 => false, encrypt => true, delta => false, compress => BZ2},
|
{vm => VM1, remote => true, storage => POSIX, encrypt => true, delta => false, compress => BZ2},
|
||||||
{vm => VM2, remote => false, s3 => false, encrypt => true, delta => true, compress => BZ2},
|
{vm => VM2, remote => false, storage => POSIX, encrypt => true, delta => true, compress => BZ2},
|
||||||
{vm => VM2, remote => true, s3 => true, encrypt => false, delta => false, compress => GZ},
|
{vm => VM2, remote => true, storage => S3, encrypt => false, delta => false, compress => GZ},
|
||||||
{vm => VM3, remote => false, s3 => false, encrypt => false, delta => true, compress => ZST},
|
{vm => VM3, remote => false, storage => POSIX, encrypt => false, delta => true, compress => ZST},
|
||||||
{vm => VM3, remote => true, s3 => true, encrypt => true, delta => false, compress => LZ4},
|
{vm => VM3, remote => true, storage => S3, encrypt => true, delta => false, compress => LZ4},
|
||||||
{vm => VM4, remote => false, s3 => false, encrypt => false, delta => false, compress => GZ},
|
{vm => VM4, remote => false, storage => POSIX, encrypt => false, delta => false, compress => GZ},
|
||||||
{vm => VM4, remote => true, s3 => true, encrypt => true, delta => true, compress => ZST},
|
{vm => VM4, remote => true, storage => S3, encrypt => true, delta => true, compress => ZST},
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# Only run tests for this vm
|
# Only run tests for this vm
|
||||||
@ -220,21 +220,22 @@ sub run
|
|||||||
|
|
||||||
# Increment the run, log, and decide whether this unit test should be run
|
# Increment the run, log, and decide whether this unit test should be run
|
||||||
my $bRemote = $rhRun->{remote};
|
my $bRemote = $rhRun->{remote};
|
||||||
my $bS3 = $rhRun->{s3};
|
my $strStorage = $rhRun->{storage};
|
||||||
my $bEncrypt = $rhRun->{encrypt};
|
my $bEncrypt = $rhRun->{encrypt};
|
||||||
my $bDeltaBackup = $rhRun->{delta};
|
my $bDeltaBackup = $rhRun->{delta};
|
||||||
my $strCompressType = $rhRun->{compress};
|
my $strCompressType = $rhRun->{compress};
|
||||||
|
|
||||||
# Increment the run, log, and decide whether this unit test should be run
|
# Increment the run, log, and decide whether this unit test should be run
|
||||||
if (!$self->begin("rmt ${bRemote}, s3 ${bS3}, enc ${bEncrypt}, delta ${bDeltaBackup}")) {next}
|
if (!$self->begin("rmt ${bRemote}, storage ${strStorage}, enc ${bEncrypt}, delta ${bDeltaBackup}")) {next}
|
||||||
|
|
||||||
# Create hosts, file object, and config
|
# Create hosts, file object, and config
|
||||||
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup(
|
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(
|
||||||
true, $self->expect(), {bHostBackup => $bRemote, bS3 => $bS3, bRepoEncrypt => $bEncrypt, strCompressType => NONE});
|
true, $self->expect(), {bHostBackup => $bRemote, strStorage => $strStorage, bRepoEncrypt => $bEncrypt,
|
||||||
|
strCompressType => NONE});
|
||||||
|
|
||||||
# If S3 set process max to 2. This seems like the best place for parallel testing since it will help speed S3 processing
|
# If S3 set process max to 2. This seems like the best place for parallel testing since it will help speed S3 processing
|
||||||
# without slowing down the other tests too much.
|
# without slowing down the other tests too much.
|
||||||
if ($bS3)
|
if ($strStorage eq S3)
|
||||||
{
|
{
|
||||||
$oHostBackup->configUpdate({&CFGDEF_SECTION_GLOBAL => {'process-max' => 2}});
|
$oHostBackup->configUpdate({&CFGDEF_SECTION_GLOBAL => {'process-max' => 2}});
|
||||||
$oHostDbMaster->configUpdate({&CFGDEF_SECTION_GLOBAL => {'process-max' => 2}});
|
$oHostDbMaster->configUpdate({&CFGDEF_SECTION_GLOBAL => {'process-max' => 2}});
|
||||||
@ -263,7 +264,7 @@ sub run
|
|||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_COMPRESS_LEVEL_NETWORK} = $bRemote ? 1 : 3;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_COMPRESS_LEVEL_NETWORK} = $bRemote ? 1 : 3;
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_HARDLINK} = JSON::PP::false;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_HARDLINK} = JSON::PP::false;
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_ONLINE} = JSON::PP::false;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_ONLINE} = JSON::PP::false;
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $bS3 ? 2 : 1;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $strStorage eq S3 ? 2 : 1;
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_DELTA} = JSON::PP::false;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_DELTA} = JSON::PP::false;
|
||||||
|
|
||||||
if ($bEncrypt)
|
if ($bEncrypt)
|
||||||
@ -492,14 +493,14 @@ sub run
|
|||||||
# Pass bogus socket path to make sure it is passed through the protocol layer (it won't be used)
|
# Pass bogus socket path to make sure it is passed through the protocol layer (it won't be used)
|
||||||
($bRemote ? ' --pg1-socket-path=/test_socket_path' : '') .
|
($bRemote ? ' --pg1-socket-path=/test_socket_path' : '') .
|
||||||
' --buffer-size=16384 --checksum-page --process-max=1',
|
' --buffer-size=16384 --checksum-page --process-max=1',
|
||||||
strRepoType => $bS3 ? undef : STORAGE_CIFS, strTest => $strTestPoint, fTestDelay => 0});
|
strRepoType => $strStorage eq S3 ? undef : CIFS, strTest => $strTestPoint, fTestDelay => 0});
|
||||||
|
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $bS3 ? 2 : 1;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $strStorage eq S3 ? 2 : 1;
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_BUFFER_SIZE} = 65536;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_BUFFER_SIZE} = 65536;
|
||||||
|
|
||||||
# Stop operations and make sure the correct error occurs
|
# Stop operations and make sure the correct error occurs
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
if (!$bS3)
|
if ($strStorage eq POSIX)
|
||||||
{
|
{
|
||||||
# Test global stop
|
# Test global stop
|
||||||
$oHostDbMaster->stop({bForce => true});
|
$oHostDbMaster->stop({bForce => true});
|
||||||
@ -582,7 +583,7 @@ sub run
|
|||||||
# Create a temp file in backup temp root to be sure it's deleted correctly
|
# Create a temp file in backup temp root to be sure it's deleted correctly
|
||||||
my $strTempFile = "${strResumePath}/file.tmp";
|
my $strTempFile = "${strResumePath}/file.tmp";
|
||||||
|
|
||||||
if ($bS3)
|
if ($strStorage eq S3)
|
||||||
{
|
{
|
||||||
storageRepo()->put($strTempFile, "TEMP");
|
storageRepo()->put($strTempFile, "TEMP");
|
||||||
}
|
}
|
||||||
@ -842,7 +843,7 @@ sub run
|
|||||||
{oExpectedManifest => \%oManifest,
|
{oExpectedManifest => \%oManifest,
|
||||||
strOptionalParam => '--process-max=1' . ($bDeltaBackup ? ' --delta' : '')});
|
strOptionalParam => '--process-max=1' . ($bDeltaBackup ? ' --delta' : '')});
|
||||||
|
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $bS3 ? 2 : 1;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $strStorage eq S3 ? 2 : 1;
|
||||||
|
|
||||||
if (!$bRemote)
|
if (!$bRemote)
|
||||||
{
|
{
|
||||||
@ -863,7 +864,7 @@ sub run
|
|||||||
$strType, 'drop tablespace 11',
|
$strType, 'drop tablespace 11',
|
||||||
{oExpectedManifest => \%oManifest, strOptionalParam => '--process-max=1' . ($bDeltaBackup ? ' --delta' : '')});
|
{oExpectedManifest => \%oManifest, strOptionalParam => '--process-max=1' . ($bDeltaBackup ? ' --delta' : '')});
|
||||||
|
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $bS3 ? 2 : 1;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $strStorage eq S3 ? 2 : 1;
|
||||||
|
|
||||||
# Restore
|
# Restore
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -918,7 +919,7 @@ sub run
|
|||||||
$strType, 'add files and remove tablespace 2',
|
$strType, 'add files and remove tablespace 2',
|
||||||
{oExpectedManifest => \%oManifest, strOptionalParam => '--process-max=1'});
|
{oExpectedManifest => \%oManifest, strOptionalParam => '--process-max=1'});
|
||||||
|
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $bS3 ? 2 : 1;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $strStorage eq S3 ? 2 : 1;
|
||||||
|
|
||||||
# Incr Backup
|
# Incr Backup
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -943,7 +944,7 @@ sub run
|
|||||||
$strType, 'updates since last full', {oExpectedManifest => \%oManifest,
|
$strType, 'updates since last full', {oExpectedManifest => \%oManifest,
|
||||||
strOptionalParam => '--process-max=1' . ($bDeltaBackup ? ' --delta' : '')});
|
strOptionalParam => '--process-max=1' . ($bDeltaBackup ? ' --delta' : '')});
|
||||||
|
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $bS3 ? 2 : 1;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $strStorage eq S3 ? 2 : 1;
|
||||||
|
|
||||||
# Diff Backup with files removed
|
# Diff Backup with files removed
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -962,7 +963,7 @@ sub run
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Enable hardlinks (except for s3) to ensure a warning is raised
|
# Enable hardlinks (except for s3) to ensure a warning is raised
|
||||||
if (!$bS3)
|
if ($strStorage eq POSIX)
|
||||||
{
|
{
|
||||||
$oHostBackup->configUpdate({&CFGDEF_SECTION_GLOBAL => {'repo1-hardlink' => 'y'}});
|
$oHostBackup->configUpdate({&CFGDEF_SECTION_GLOBAL => {'repo1-hardlink' => 'y'}});
|
||||||
}
|
}
|
||||||
@ -982,7 +983,7 @@ sub run
|
|||||||
{oExpectedManifest => \%oManifest,
|
{oExpectedManifest => \%oManifest,
|
||||||
strOptionalParam => '--process-max=1' . ($bDeltaBackup ? ' --delta' : '')});
|
strOptionalParam => '--process-max=1' . ($bDeltaBackup ? ' --delta' : '')});
|
||||||
|
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $bS3 ? 2 : 1;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_PROCESS_MAX} = $strStorage eq S3 ? 2 : 1;
|
||||||
|
|
||||||
# Full Backup
|
# Full Backup
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
@ -992,7 +993,7 @@ sub run
|
|||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_COMPRESS} = JSON::PP::true;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_COMPRESS} = JSON::PP::true;
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_COMPRESS_TYPE} = $strCompressType;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_COMPRESS_TYPE} = $strCompressType;
|
||||||
|
|
||||||
if (!$bS3)
|
if ($strStorage eq POSIX)
|
||||||
{
|
{
|
||||||
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_HARDLINK} = JSON::PP::true;
|
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_HARDLINK} = JSON::PP::true;
|
||||||
$oHostBackup->{bHardLink} = true;
|
$oHostBackup->{bHardLink} = true;
|
||||||
@ -1102,7 +1103,7 @@ sub run
|
|||||||
# because for some reason sort order is different when this command is executed via ssh (even though the content of the
|
# because for some reason sort order is different when this command is executed via ssh (even though the content of the
|
||||||
# directory is identical).
|
# directory is identical).
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
if (!$bRemote && !$bS3)
|
if (!$bRemote && $strStorage eq POSIX)
|
||||||
{
|
{
|
||||||
executeTest(
|
executeTest(
|
||||||
'ls -1Rtr ' . $oHostBackup->repoBackupPath(PATH_BACKUP_HISTORY),
|
'ls -1Rtr ' . $oHostBackup->repoBackupPath(PATH_BACKUP_HISTORY),
|
||||||
|
@ -43,14 +43,14 @@ sub run
|
|||||||
|
|
||||||
foreach my $rhRun
|
foreach my $rhRun
|
||||||
(
|
(
|
||||||
{vm => VM1, remote => false, s3 => false, encrypt => false, compress => LZ4, error => 0},
|
{vm => VM1, remote => false, storage => POSIX, encrypt => false, compress => LZ4, error => 0},
|
||||||
{vm => VM1, remote => true, s3 => true, encrypt => true, compress => GZ, error => 1},
|
{vm => VM1, remote => true, storage => S3, encrypt => true, compress => GZ, error => 1},
|
||||||
{vm => VM2, remote => false, s3 => true, encrypt => false, compress => NONE, error => 0},
|
{vm => VM2, remote => false, storage => S3, encrypt => false, compress => NONE, error => 0},
|
||||||
{vm => VM2, remote => true, s3 => false, encrypt => true, compress => BZ2, error => 0},
|
{vm => VM2, remote => true, storage => POSIX, encrypt => true, compress => BZ2, error => 0},
|
||||||
{vm => VM3, remote => false, s3 => false, encrypt => true, compress => NONE, error => 0},
|
{vm => VM3, remote => false, storage => POSIX, encrypt => true, compress => NONE, error => 0},
|
||||||
{vm => VM3, remote => true, s3 => true, encrypt => false, compress => LZ4, error => 1},
|
{vm => VM3, remote => true, storage => S3, encrypt => false, compress => LZ4, error => 1},
|
||||||
{vm => VM4, remote => false, s3 => true, encrypt => true, compress => ZST, error => 0},
|
{vm => VM4, remote => false, storage => S3, encrypt => true, compress => ZST, error => 0},
|
||||||
{vm => VM4, remote => true, s3 => false, encrypt => false, compress => NONE, error => 0},
|
{vm => VM4, remote => true, storage => POSIX, encrypt => false, compress => NONE, error => 0},
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# Only run tests for this vm
|
# Only run tests for this vm
|
||||||
@ -58,7 +58,7 @@ sub run
|
|||||||
|
|
||||||
# Increment the run, log, and decide whether this unit test should be run
|
# Increment the run, log, and decide whether this unit test should be run
|
||||||
my $bRemote = $rhRun->{remote};
|
my $bRemote = $rhRun->{remote};
|
||||||
my $bS3 = $rhRun->{s3};
|
my $strStorage = $rhRun->{storage};
|
||||||
my $bEncrypt = $rhRun->{encrypt};
|
my $bEncrypt = $rhRun->{encrypt};
|
||||||
my $strCompressType = $rhRun->{compress};
|
my $strCompressType = $rhRun->{compress};
|
||||||
my $iError = $rhRun->{error};
|
my $iError = $rhRun->{error};
|
||||||
@ -66,12 +66,12 @@ sub run
|
|||||||
# Increment the run, log, and decide whether this unit test should be run
|
# Increment the run, log, and decide whether this unit test should be run
|
||||||
if (!$self->begin(
|
if (!$self->begin(
|
||||||
"rmt ${bRemote}, cmp ${strCompressType}, error " . ($iError ? 'connect' : 'version') .
|
"rmt ${bRemote}, cmp ${strCompressType}, error " . ($iError ? 'connect' : 'version') .
|
||||||
", s3 ${bS3}, enc ${bEncrypt}")) {next}
|
", storage ${strStorage}, enc ${bEncrypt}")) {next}
|
||||||
|
|
||||||
# Create hosts, file object, and config
|
# Create hosts, file object, and config
|
||||||
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup(
|
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(
|
||||||
true, $self->expect(), {bHostBackup => $bRemote, strCompressType => $strCompressType, bArchiveAsync => true,
|
true, $self->expect(), {bHostBackup => $bRemote, strCompressType => $strCompressType, bArchiveAsync => true,
|
||||||
bS3 => $bS3, bRepoEncrypt => $bEncrypt});
|
strStorage => $strStorage, bRepoEncrypt => $bEncrypt});
|
||||||
|
|
||||||
# Create compression extension
|
# Create compression extension
|
||||||
my $strCompressExt = $strCompressType ne NONE ? ".${strCompressType}" : '';
|
my $strCompressExt = $strCompressType ne NONE ? ".${strCompressType}" : '';
|
||||||
|
@ -83,14 +83,14 @@ sub run
|
|||||||
|
|
||||||
foreach my $rhRun
|
foreach my $rhRun
|
||||||
(
|
(
|
||||||
{vm => VM1, remote => false, s3 => false, encrypt => false, compress => GZ},
|
{vm => VM1, remote => false, storage => POSIX, encrypt => false, compress => GZ},
|
||||||
{vm => VM1, remote => true, s3 => true, encrypt => true, compress => LZ4},
|
{vm => VM1, remote => true, storage => S3, encrypt => true, compress => LZ4},
|
||||||
{vm => VM2, remote => false, s3 => true, encrypt => false, compress => BZ2},
|
{vm => VM2, remote => false, storage => S3, encrypt => false, compress => BZ2},
|
||||||
{vm => VM2, remote => true, s3 => false, encrypt => true, compress => BZ2},
|
{vm => VM2, remote => true, storage => POSIX, encrypt => true, compress => BZ2},
|
||||||
{vm => VM3, remote => false, s3 => false, encrypt => true, compress => LZ4},
|
{vm => VM3, remote => false, storage => POSIX, encrypt => true, compress => LZ4},
|
||||||
{vm => VM3, remote => true, s3 => true, encrypt => false, compress => ZST},
|
{vm => VM3, remote => true, storage => S3, encrypt => false, compress => ZST},
|
||||||
{vm => VM4, remote => false, s3 => true, encrypt => true, compress => ZST},
|
{vm => VM4, remote => false, storage => S3, encrypt => true, compress => ZST},
|
||||||
{vm => VM4, remote => true, s3 => false, encrypt => false, compress => GZ},
|
{vm => VM4, remote => true, storage => POSIX, encrypt => false, compress => GZ},
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# Only run tests for this vm
|
# Only run tests for this vm
|
||||||
@ -98,15 +98,16 @@ sub run
|
|||||||
|
|
||||||
# Increment the run, log, and decide whether this unit test should be run
|
# Increment the run, log, and decide whether this unit test should be run
|
||||||
my $bRemote = $rhRun->{remote};
|
my $bRemote = $rhRun->{remote};
|
||||||
my $bS3 = $rhRun->{s3};
|
my $strStorage = $rhRun->{storage};
|
||||||
my $bEncrypt = $rhRun->{encrypt};
|
my $bEncrypt = $rhRun->{encrypt};
|
||||||
my $strCompressType = $rhRun->{compress};
|
my $strCompressType = $rhRun->{compress};
|
||||||
|
|
||||||
if (!$self->begin("rmt ${bRemote}, s3 ${bS3}, enc ${bEncrypt}, cmp ${strCompressType}")) {next}
|
if (!$self->begin("rmt ${bRemote}, storage ${strStorage}, enc ${bEncrypt}, cmp ${strCompressType}")) {next}
|
||||||
|
|
||||||
# Create hosts, file object, and config
|
# Create hosts, file object, and config
|
||||||
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(
|
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(
|
||||||
true, $self->expect(), {bHostBackup => $bRemote, bS3 => $bS3, bRepoEncrypt => $bEncrypt, strCompressType => NONE});
|
true, $self->expect(), {bHostBackup => $bRemote, strStorage => $strStorage, bRepoEncrypt => $bEncrypt,
|
||||||
|
strCompressType => NONE});
|
||||||
|
|
||||||
# Reduce console logging to detail
|
# Reduce console logging to detail
|
||||||
$oHostDbMaster->configUpdate({&CFGDEF_SECTION_GLOBAL => {'log-level-console' => lc(DETAIL)}});
|
$oHostDbMaster->configUpdate({&CFGDEF_SECTION_GLOBAL => {'log-level-console' => lc(DETAIL)}});
|
||||||
@ -205,7 +206,7 @@ sub run
|
|||||||
# Create a temp file to make sure it is deleted later (skip when S3 since it doesn't use temp files)
|
# Create a temp file to make sure it is deleted later (skip when S3 since it doesn't use temp files)
|
||||||
my $strArchiveTmp;
|
my $strArchiveTmp;
|
||||||
|
|
||||||
if (!$bS3)
|
if ($strStorage eq POSIX)
|
||||||
{
|
{
|
||||||
# Should succeed when temp file already exists
|
# Should succeed when temp file already exists
|
||||||
&log(INFO, ' succeed when tmp WAL file exists');
|
&log(INFO, ' succeed when tmp WAL file exists');
|
||||||
@ -341,8 +342,8 @@ sub run
|
|||||||
&log(INFO, " get second WAL (${strSourceFile})");
|
&log(INFO, " get second WAL (${strSourceFile})");
|
||||||
|
|
||||||
$oHostDbMaster->executeSimple(
|
$oHostDbMaster->executeSimple(
|
||||||
$strCommandGet . ($bRemote ? ' --cmd-ssh=/usr/bin/ssh' : '') . " --archive-async" . (!$bS3 ? " --repo-type=cifs" : '') .
|
$strCommandGet . ($bRemote ? ' --cmd-ssh=/usr/bin/ssh' : '') . " --archive-async" .
|
||||||
" --archive-timeout=5 ${strSourceFile} ${strWalPath}/RECOVERYXLOG",
|
($strStorage eq POSIX ? " --repo-type=cifs" : '') . " --archive-timeout=5 ${strSourceFile} ${strWalPath}/RECOVERYXLOG",
|
||||||
{oLogTest => $self->expect()});
|
{oLogTest => $self->expect()});
|
||||||
|
|
||||||
# Check that the destination file exists
|
# Check that the destination file exists
|
||||||
|
@ -45,30 +45,30 @@ sub run
|
|||||||
|
|
||||||
foreach my $rhRun
|
foreach my $rhRun
|
||||||
(
|
(
|
||||||
{vm => VM1, s3 => true, encrypt => false},
|
{vm => VM1, storage => POSIX, encrypt => false},
|
||||||
{vm => VM2, s3 => false, encrypt => true},
|
{vm => VM2, storage => S3, encrypt => true},
|
||||||
{vm => VM3, s3 => false, encrypt => false},
|
{vm => VM3, storage => POSIX, encrypt => false},
|
||||||
{vm => VM4, s3 => true, encrypt => true},
|
{vm => VM4, storage => S3, encrypt => true},
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# Only run tests for this vm
|
# Only run tests for this vm
|
||||||
next if ($rhRun->{vm} ne vmTest($self->vm()));
|
next if ($rhRun->{vm} ne vmTest($self->vm()));
|
||||||
|
|
||||||
# Increment the run, log, and decide whether this unit test should be run
|
# Increment the run, log, and decide whether this unit test should be run
|
||||||
my $bS3 = $rhRun->{s3};
|
my $strStorage = $rhRun->{storage};
|
||||||
my $bEncrypt = $rhRun->{encrypt};
|
my $bEncrypt = $rhRun->{encrypt};
|
||||||
|
|
||||||
if ($bS3 && ($self->vm() eq VM3))
|
if ($strStorage ne POSIX && ($self->vm() eq VM3))
|
||||||
{
|
{
|
||||||
confess &log("cannot configure s3 for expect log tests");
|
confess &log("cannot configure non-posix storage for expect log tests");
|
||||||
}
|
}
|
||||||
|
|
||||||
############################################################################################################################
|
############################################################################################################################
|
||||||
if ($self->begin("simple, enc ${bEncrypt}, s3 ${bS3}"))
|
if ($self->begin("simple, enc ${bEncrypt}, storage ${strStorage}"))
|
||||||
{
|
{
|
||||||
# Create hosts, file object, and config
|
# Create hosts, file object, and config
|
||||||
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup(
|
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(
|
||||||
true, $self->expect(), {bS3 => $bS3, bRepoEncrypt => $bEncrypt});
|
true, $self->expect(), {strStorage => $strStorage, bRepoEncrypt => $bEncrypt});
|
||||||
|
|
||||||
# Create the test object
|
# Create the test object
|
||||||
my $oExpireTest = new pgBackRestTest::Env::ExpireEnvTest(
|
my $oExpireTest = new pgBackRestTest::Env::ExpireEnvTest(
|
||||||
@ -156,11 +156,11 @@ sub run
|
|||||||
}
|
}
|
||||||
|
|
||||||
############################################################################################################################
|
############################################################################################################################
|
||||||
if ($self->begin("stanzaUpgrade, enc ${bEncrypt}, s3 ${bS3}"))
|
if ($self->begin("stanzaUpgrade, enc ${bEncrypt}, storage ${strStorage}"))
|
||||||
{
|
{
|
||||||
# Create hosts, file object, and config
|
# Create hosts, file object, and config
|
||||||
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup(
|
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(
|
||||||
true, $self->expect(), {bS3 => $bS3, bRepoEncrypt => $bEncrypt});
|
true, $self->expect(), {strStorage => $strStorage, bRepoEncrypt => $bEncrypt});
|
||||||
|
|
||||||
# Create the test object
|
# Create the test object
|
||||||
my $oExpireTest = new pgBackRestTest::Env::ExpireEnvTest(
|
my $oExpireTest = new pgBackRestTest::Env::ExpireEnvTest(
|
||||||
|
@ -41,14 +41,14 @@ sub run
|
|||||||
|
|
||||||
foreach my $rhRun
|
foreach my $rhRun
|
||||||
(
|
(
|
||||||
{vm => VM1, remote => false, s3 => false, encrypt => true, compress => LZ4},
|
{vm => VM1, remote => false, storage => POSIX, encrypt => true, compress => LZ4},
|
||||||
{vm => VM1, remote => true, s3 => true, encrypt => false, compress => BZ2},
|
{vm => VM1, remote => true, storage => S3, encrypt => false, compress => BZ2},
|
||||||
{vm => VM2, remote => false, s3 => true, encrypt => true, compress => BZ2},
|
{vm => VM2, remote => false, storage => S3, encrypt => true, compress => BZ2},
|
||||||
{vm => VM2, remote => true, s3 => false, encrypt => false, compress => GZ},
|
{vm => VM2, remote => true, storage => POSIX, encrypt => false, compress => GZ},
|
||||||
{vm => VM3, remote => false, s3 => false, encrypt => false, compress => ZST},
|
{vm => VM3, remote => false, storage => POSIX, encrypt => false, compress => ZST},
|
||||||
{vm => VM3, remote => true, s3 => true, encrypt => true, compress => LZ4},
|
{vm => VM3, remote => true, storage => S3, encrypt => true, compress => LZ4},
|
||||||
{vm => VM4, remote => false, s3 => true, encrypt => false, compress => GZ},
|
{vm => VM4, remote => false, storage => S3, encrypt => false, compress => GZ},
|
||||||
{vm => VM4, remote => true, s3 => false, encrypt => true, compress => ZST},
|
{vm => VM4, remote => true, storage => POSIX, encrypt => true, compress => ZST},
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
# Only run tests for this vm
|
# Only run tests for this vm
|
||||||
@ -56,16 +56,16 @@ sub run
|
|||||||
|
|
||||||
# Increment the run, log, and decide whether this unit test should be run
|
# Increment the run, log, and decide whether this unit test should be run
|
||||||
my $bRemote = $rhRun->{remote};
|
my $bRemote = $rhRun->{remote};
|
||||||
my $bS3 = $rhRun->{s3};
|
my $strStorage = $rhRun->{storage};
|
||||||
my $bEncrypt = $rhRun->{encrypt};
|
my $bEncrypt = $rhRun->{encrypt};
|
||||||
my $strCompressType = $rhRun->{compress};
|
my $strCompressType = $rhRun->{compress};
|
||||||
|
|
||||||
# Increment the run, log, and decide whether this unit test should be run
|
# Increment the run, log, and decide whether this unit test should be run
|
||||||
if (!$self->begin("remote ${bRemote}, s3 ${bS3}, enc ${bEncrypt}, cmp ${strCompressType}")) {next}
|
if (!$self->begin("remote ${bRemote}, storage ${strStorage}, enc ${bEncrypt}, cmp ${strCompressType}")) {next}
|
||||||
|
|
||||||
# Create hosts, file object, and config
|
# Create hosts, file object, and config
|
||||||
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup(
|
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(
|
||||||
true, $self->expect(), {bHostBackup => $bRemote, bS3 => $bS3, bRepoEncrypt => $bEncrypt,
|
true, $self->expect(), {bHostBackup => $bRemote, strStorage => $strStorage, bRepoEncrypt => $bEncrypt,
|
||||||
strCompressType => $strCompressType});
|
strCompressType => $strCompressType});
|
||||||
|
|
||||||
# Archive and backup info file names
|
# Archive and backup info file names
|
||||||
|
@ -53,21 +53,22 @@ sub run
|
|||||||
# Should the test use lz4 compression?
|
# Should the test use lz4 compression?
|
||||||
my $bLz4Compress = true;
|
my $bLz4Compress = true;
|
||||||
|
|
||||||
foreach my $bS3 (false, true)
|
foreach my $strStorage (POSIX, S3)
|
||||||
{
|
{
|
||||||
foreach my $bHostBackup ($bS3 ? (true) : (false, true))
|
foreach my $bHostBackup ($strStorage eq S3 ? (true) : (false, true))
|
||||||
{
|
{
|
||||||
# Standby should only be tested for pg versions that support it
|
# Standby should only be tested for pg versions that support it
|
||||||
foreach my $bHostStandby ($bS3 ? (false) : (false, true))
|
foreach my $bHostStandby ($strStorage eq S3 ? (false) : (false, true))
|
||||||
{
|
{
|
||||||
# Master and standby backup destinations on need to be tested on one db version since it is not version specific
|
# Master and standby backup destinations on need to be tested on one db version since it is not version specific
|
||||||
foreach my $strBackupDestination (
|
foreach my $strBackupDestination (
|
||||||
$bS3 || $bHostBackup ? (HOST_BACKUP) : $bHostStandby ? (HOST_DB_MASTER, HOST_DB_STANDBY) : (HOST_DB_MASTER))
|
$strStorage eq S3 || $bHostBackup ? (HOST_BACKUP) : $bHostStandby ? (HOST_DB_MASTER, HOST_DB_STANDBY) : (HOST_DB_MASTER))
|
||||||
{
|
{
|
||||||
my $strCompressType =
|
my $strCompressType =
|
||||||
$bHostBackup && !$bHostStandby ?
|
$bHostBackup && !$bHostStandby ?
|
||||||
(vmWithLz4($self->vm()) && $bLz4Compress ? LZ4 : vmWithZst($self->vm()) ? ZST : ($bS3 ? BZ2 : GZ)) : NONE;
|
(vmWithLz4($self->vm()) && $bLz4Compress ? LZ4 : vmWithZst($self->vm()) ?
|
||||||
my $bRepoEncrypt = ($strCompressType ne NONE && !$bS3) ? true : false;
|
ZST : ($strStorage eq S3 ? BZ2 : GZ)) : NONE;
|
||||||
|
my $bRepoEncrypt = ($strCompressType ne NONE && $strStorage eq POSIX) ? true : false;
|
||||||
|
|
||||||
# If compression was used then switch it for the next test that uses compression
|
# If compression was used then switch it for the next test that uses compression
|
||||||
if ($strCompressType ne NONE)
|
if ($strCompressType ne NONE)
|
||||||
@ -80,13 +81,14 @@ sub run
|
|||||||
my $strDbVersionMostRecent = ${$hyVm->{$self->vm()}{&VM_DB_TEST}}[-1];
|
my $strDbVersionMostRecent = ${$hyVm->{$self->vm()}{&VM_DB_TEST}}[-1];
|
||||||
|
|
||||||
next if (!$self->begin(
|
next if (!$self->begin(
|
||||||
"bkp ${bHostBackup}, sby ${bHostStandby}, dst ${strBackupDestination}, cmp ${strCompressType}, s3 ${bS3}, " .
|
"bkp ${bHostBackup}, sby ${bHostStandby}, dst ${strBackupDestination}, cmp ${strCompressType}" .
|
||||||
"enc ${bRepoEncrypt}",
|
", storage ${strStorage}, enc ${bRepoEncrypt}",
|
||||||
# Use the most recent db version on the expect vm for expect testing
|
# Use the most recent db version on the expect vm for expect testing
|
||||||
$self->vm() eq VM_EXPECT && $self->pgVersion() eq $strDbVersionMostRecent));
|
$self->vm() eq VM_EXPECT && $self->pgVersion() eq $strDbVersionMostRecent));
|
||||||
|
|
||||||
# Skip when s3 and host backup tests when there is more than one version of pg being tested and this is not the last one
|
# Skip when s3 and host backup tests when there is more than one version of pg being tested and this is not the last one
|
||||||
if (($bS3 || $bHostBackup) && (@{$hyVm->{$self->vm()}{&VM_DB_TEST}} > 1 && $strDbVersionMostRecent ne $self->pgVersion()))
|
if (($strStorage eq S3 || $bHostBackup) &&
|
||||||
|
(@{$hyVm->{$self->vm()}{&VM_DB_TEST}} > 1 && $strDbVersionMostRecent ne $self->pgVersion()))
|
||||||
{
|
{
|
||||||
&log(INFO, "skipped - this test is run this OS using PG ${strDbVersionMostRecent}");
|
&log(INFO, "skipped - this test is run this OS using PG ${strDbVersionMostRecent}");
|
||||||
next;
|
next;
|
||||||
@ -107,10 +109,11 @@ sub run
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Create hosts, file object, and config
|
# Create hosts, file object, and config
|
||||||
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup, $oHostS3) = $self->setup(
|
my ($oHostDbMaster, $oHostDbStandby, $oHostBackup) = $self->setup(
|
||||||
false, $self->expect(),
|
false, $self->expect(),
|
||||||
{bHostBackup => $bHostBackup, bStandby => $bHostStandby, strBackupDestination => $strBackupDestination,
|
{bHostBackup => $bHostBackup, bStandby => $bHostStandby, strBackupDestination => $strBackupDestination,
|
||||||
strCompressType => $strCompressType, bArchiveAsync => false, bS3 => $bS3, bRepoEncrypt => $bRepoEncrypt});
|
strCompressType => $strCompressType, bArchiveAsync => false, strStorage => $strStorage,
|
||||||
|
bRepoEncrypt => $bRepoEncrypt});
|
||||||
|
|
||||||
# Only perform extra tests on certain runs to save time
|
# Only perform extra tests on certain runs to save time
|
||||||
my $bTestLocal = $self->runCurrent() == 1;
|
my $bTestLocal = $self->runCurrent() == 1;
|
||||||
@ -119,7 +122,7 @@ sub run
|
|||||||
|
|
||||||
# If S3 set process max to 2. This seems like the best place for parallel testing since it will help speed S3 processing
|
# If S3 set process max to 2. This seems like the best place for parallel testing since it will help speed S3 processing
|
||||||
# without slowing down the other tests too much.
|
# without slowing down the other tests too much.
|
||||||
if ($bS3)
|
if ($strStorage eq S3)
|
||||||
{
|
{
|
||||||
$oHostBackup->configUpdate({&CFGDEF_SECTION_GLOBAL => {'process-max' => 2}});
|
$oHostBackup->configUpdate({&CFGDEF_SECTION_GLOBAL => {'process-max' => 2}});
|
||||||
$oHostDbMaster->configUpdate({&CFGDEF_SECTION_GLOBAL => {'process-max' => 2}});
|
$oHostDbMaster->configUpdate({&CFGDEF_SECTION_GLOBAL => {'process-max' => 2}});
|
||||||
@ -538,7 +541,7 @@ sub run
|
|||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
# Restart the cluster to check for any errors before continuing since the stop tests will definitely create errors and
|
# Restart the cluster to check for any errors before continuing since the stop tests will definitely create errors and
|
||||||
# the logs will to be deleted to avoid causing issues further down the line.
|
# the logs will to be deleted to avoid causing issues further down the line.
|
||||||
if ($bTestExtra && !$bS3)
|
if ($bTestExtra && $strStorage eq POSIX)
|
||||||
{
|
{
|
||||||
$oHostDbMaster->clusterRestart();
|
$oHostDbMaster->clusterRestart();
|
||||||
|
|
||||||
@ -1001,7 +1004,7 @@ sub run
|
|||||||
|
|
||||||
# Test no-online backups
|
# Test no-online backups
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
if ($bTestExtra & !$bS3)
|
if ($bTestExtra & $strStorage eq POSIX)
|
||||||
{
|
{
|
||||||
# Create a postmaster.pid file so it appears that the server is running
|
# Create a postmaster.pid file so it appears that the server is running
|
||||||
storageTest()->put($oHostDbMaster->dbBasePath() . '/postmaster.pid', '99999');
|
storageTest()->put($oHostDbMaster->dbBasePath() . '/postmaster.pid', '99999');
|
||||||
@ -1020,7 +1023,7 @@ sub run
|
|||||||
|
|
||||||
# Stanza-delete --force without access to pgbackrest on database host
|
# Stanza-delete --force without access to pgbackrest on database host
|
||||||
#---------------------------------------------------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------------------------------------------------
|
||||||
if ($bTestExtra && !$bS3 && $bHostBackup)
|
if ($bTestExtra && $strStorage eq POSIX && $bHostBackup)
|
||||||
{
|
{
|
||||||
# With stanza-delete --force, allow stanza to be deleted regardless of accessibility of database host
|
# With stanza-delete --force, allow stanza to be deleted regardless of accessibility of database host
|
||||||
if ($bHostBackup)
|
if ($bHostBackup)
|
||||||
|
Reference in New Issue
Block a user