mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-14 10:13:05 +02:00
Automated tests for 32-bit i386/i686 architecture.
This commit is contained in:
parent
8a3425ec04
commit
500d6b4b66
@ -129,6 +129,10 @@
|
||||
<release-item>
|
||||
<p>Automate generation of WAL and <file>pg_control</file> test files. The existing static files would not work with 32-bit or big-endian systems so create functions to generate these files dynamically rather than creating a bunch of new static files.</p>
|
||||
</release-item>
|
||||
|
||||
<release-item>
|
||||
<p>Automated tests for 32-bit i386/i686 architecture.</p>
|
||||
</release-item>
|
||||
</release-refactor-list>
|
||||
</release-test-list>
|
||||
</release>
|
||||
|
@ -113,7 +113,7 @@ sub process
|
||||
" aws configure list\n" .
|
||||
" - |\n" .
|
||||
" # Install Devel::Cover\n" .
|
||||
" sudo dpkg -i \${TRAVIS_BUILD_DIR?}/test/package/u14-" . LIB_COVER_PACKAGE . "\n" .
|
||||
" sudo dpkg -i \${TRAVIS_BUILD_DIR?}/test/package/u14-" . packageDevelCover(VM_ARCH_AMD64) . "\n" .
|
||||
' ' . LIB_COVER_EXE . " -v\n" .
|
||||
"\n" .
|
||||
"install:\n" .
|
||||
|
@ -50,8 +50,6 @@ use constant BACKREST_USER_ID => getpwnam(
|
||||
####################################################################################################################################
|
||||
use constant LIB_COVER_VERSION => '1.23-2';
|
||||
push @EXPORT, qw(LIB_COVER_VERSION);
|
||||
use constant LIB_COVER_PACKAGE => 'libdevel-cover-perl_' . LIB_COVER_VERSION . '_amd64.deb';
|
||||
push @EXPORT, qw(LIB_COVER_PACKAGE);
|
||||
use constant LIB_COVER_EXE => '/usr/bin/cover';
|
||||
push @EXPORT, qw(LIB_COVER_EXE);
|
||||
|
||||
@ -71,6 +69,18 @@ use constant CERT_FAKE_SERVER_KEY => CERT_FAKE
|
||||
####################################################################################################################################
|
||||
use constant CONTAINER_DEBUG => false;
|
||||
|
||||
####################################################################################################################################
|
||||
# Generate Devel::Cover package name
|
||||
####################################################################################################################################
|
||||
sub packageDevelCover
|
||||
{
|
||||
my $strArch = shift;
|
||||
|
||||
return 'libdevel-cover-perl_' . LIB_COVER_VERSION . "_${strArch}.deb";
|
||||
}
|
||||
|
||||
push @EXPORT, qw(packageDevelCover);
|
||||
|
||||
####################################################################################################################################
|
||||
# Container repo - defines the Docker repository where the containers will be located
|
||||
####################################################################################################################################
|
||||
@ -538,7 +548,7 @@ sub containerBuild
|
||||
$strImage = "${strOS}-build";
|
||||
$strCopy = undef;
|
||||
|
||||
my $strPkgDevelCover = LIB_COVER_PACKAGE;
|
||||
my $strPkgDevelCover = packageDevelCover($oVm->{$strOS}{&VM_ARCH});
|
||||
my $bPkgDevelCoverBuild = vmCoverage($strOS) && !$oStorageDocker->exists("test/package/${strOS}-${strPkgDevelCover}");
|
||||
|
||||
# Install Perl packages
|
||||
|
@ -590,6 +590,7 @@ push(@EXPORT, qw(storageTest));
|
||||
####################################################################################################################################
|
||||
# Getters
|
||||
####################################################################################################################################
|
||||
sub archBits {return vmArchBits(shift->{strVm})}
|
||||
sub backrestExe {return shift->{strBackRestExe}}
|
||||
sub backrestExeOriginal {return shift->{strBackRestExeOriginal}}
|
||||
sub backrestUser {return shift->{strBackRestUser}}
|
||||
|
@ -19,6 +19,8 @@ use pgBackRest::DbVersion;
|
||||
####################################################################################################################################
|
||||
# VM hash keywords
|
||||
####################################################################################################################################
|
||||
use constant VM_ARCH => 'arch';
|
||||
push @EXPORT, qw(VM_ARCH);
|
||||
use constant VM_DB => 'db';
|
||||
push @EXPORT, qw(VM_DB);
|
||||
use constant VM_DB_TEST => 'db-test';
|
||||
@ -58,6 +60,14 @@ use constant VM_OS_DEBIAN => 'debian';
|
||||
use constant VM_OS_UBUNTU => 'ubuntu';
|
||||
push @EXPORT, qw(VM_OS_DEBIAN);
|
||||
|
||||
####################################################################################################################################
|
||||
# Valid architecture list
|
||||
####################################################################################################################################
|
||||
use constant VM_ARCH_I386 => 'i386';
|
||||
push @EXPORT, qw(VM_ARCH_I386);
|
||||
use constant VM_ARCH_AMD64 => 'amd64';
|
||||
push @EXPORT, qw(VM_ARCH_AMD64);
|
||||
|
||||
####################################################################################################################################
|
||||
# Valid VM list
|
||||
####################################################################################################################################
|
||||
@ -102,6 +112,7 @@ my $oyVm =
|
||||
&VM_OS_BASE => VM_OS_BASE_RHEL,
|
||||
&VM_OS => VM_OS_CENTOS,
|
||||
&VM_IMAGE => 'centos:6',
|
||||
&VM_ARCH => VM_ARCH_AMD64,
|
||||
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
|
||||
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib64/perl5',
|
||||
|
||||
@ -127,6 +138,7 @@ my $oyVm =
|
||||
&VM_OS_BASE => VM_OS_BASE_RHEL,
|
||||
&VM_OS => VM_OS_CENTOS,
|
||||
&VM_IMAGE => 'centos:7',
|
||||
&VM_ARCH => VM_ARCH_AMD64,
|
||||
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
|
||||
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib64/perl5',
|
||||
|
||||
@ -143,6 +155,7 @@ my $oyVm =
|
||||
&VM_OS => VM_OS_DEBIAN,
|
||||
&VM_OS_REPO => 'jessie',
|
||||
&VM_IMAGE => 'debian:8',
|
||||
&VM_ARCH => VM_ARCH_AMD64,
|
||||
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
||||
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/x86_64-linux-gnu/perl/5.20.2',
|
||||
|
||||
@ -159,8 +172,9 @@ my $oyVm =
|
||||
&VM_OS => VM_OS_DEBIAN,
|
||||
&VM_OS_REPO => 'stretch',
|
||||
&VM_IMAGE => 'debian:9',
|
||||
&VM_ARCH => VM_ARCH_AMD64,
|
||||
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
||||
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/x86_64-linux-gnu/perl/5.24.1',
|
||||
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/i386-linux-gnu/perl/5.24.1',
|
||||
|
||||
&VM_DB =>
|
||||
[
|
||||
@ -174,7 +188,8 @@ my $oyVm =
|
||||
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
|
||||
&VM_OS => VM_OS_UBUNTU,
|
||||
&VM_OS_REPO => 'precise',
|
||||
&VM_IMAGE => 'ubuntu:12.04',
|
||||
&VM_IMAGE => 'i386/ubuntu:12.04',
|
||||
&VM_ARCH => VM_ARCH_I386,
|
||||
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
||||
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/perl/5.14.2',
|
||||
|
||||
@ -194,6 +209,7 @@ my $oyVm =
|
||||
&VM_OS => VM_OS_UBUNTU,
|
||||
&VM_OS_REPO => 'trusty',
|
||||
&VM_IMAGE => 'ubuntu:14.04',
|
||||
&VM_ARCH => VM_ARCH_AMD64,
|
||||
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
||||
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/perl/5.18.2',
|
||||
|
||||
@ -210,6 +226,7 @@ my $oyVm =
|
||||
&VM_OS => VM_OS_UBUNTU,
|
||||
&VM_OS_REPO => 'xenial',
|
||||
&VM_IMAGE => 'ubuntu:16.04',
|
||||
&VM_ARCH => VM_ARCH_AMD64,
|
||||
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
||||
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/x86_64-linux-gnu/perl/5.22.1',
|
||||
|
||||
@ -316,4 +333,16 @@ sub vmCoverage
|
||||
|
||||
push @EXPORT, qw(vmCoverage);
|
||||
|
||||
####################################################################################################################################
|
||||
# Get vm architecture bits
|
||||
####################################################################################################################################
|
||||
sub vmArchBits
|
||||
{
|
||||
my $strVm = shift;
|
||||
|
||||
return ($oyVm->{$strVm}{&VM_ARCH} eq VM_ARCH_AMD64 ? 64 : 32);
|
||||
}
|
||||
|
||||
push @EXPORT, qw(vmArchBits);
|
||||
|
||||
1;
|
||||
|
@ -405,7 +405,7 @@ sub walGenerateContent
|
||||
$tWalContent .= pack('S', 2);
|
||||
|
||||
# Add junk (H for header) for the bytes that won't be read by the tests
|
||||
my $iOffset = 12 + ($strPgVersion >= PG_VERSION_93 ? 8 : 0);
|
||||
my $iOffset = 12 + ($strPgVersion >= PG_VERSION_93 ? testRunGet()->archBits() / 8 : 0);
|
||||
$tWalContent .= ('H' x $iOffset);
|
||||
|
||||
# Add the system identifier
|
||||
|
Loading…
Reference in New Issue
Block a user