mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-12 10:04:14 +02:00
Update test container OS versions.
Update Ubuntu 12.04 to 16.04. Version 16.04 is recently EOL but testing on an old version is beneficial. Update Ubuntu 18.04 to 20.04. Update Fedora 32 to 33. Version 34 would have been preferred but there were some build issues, i.e. the default shell did not work with configure, and after ksh was installed configure locked up. Add --no-install-recommends to apt-get commands to save a bit of time and space. Update test Dockerfile to run in multiple steps. This makes the container larger but also makes rebuilding after changes faster. The --squash option may be used to keep the container small. Remove obsolete casts in protocol/parallel module. These casts were included in the original migration because Ubuntu 12.04 32-bit gcc required them, but Ubuntu 16.04 32-bit gcc complains. There is no production issue here since at this point in the code the file descriptors are guaranteed to be >= 0.
This commit is contained in:
parent
81602f1593
commit
6397d73535
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -29,16 +29,16 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
# All unit (without coverage) and integration tests for 32-bit
|
||||
- param: test --vm=u12 --param=no-performance
|
||||
- param: test --vm=u16 --param=no-performance
|
||||
|
||||
# Debian/Ubuntu documentation
|
||||
- param: doc --vm=u18
|
||||
|
||||
# All integration tests
|
||||
- param: test --vm=u18 --param=build-package --param=module=mock --param=module=real
|
||||
- param: test --vm=u20 --param=build-package --param=module=mock --param=module=real
|
||||
|
||||
# All unit tests (with coverage) on the newest gcc available
|
||||
- param: test --vm=f32 --param=c-only --param=tz=America/New_York
|
||||
- param: test --vm=f33 --param=c-only --param=tz=America/New_York
|
||||
|
||||
# RHEL/CentOS 8 documentation
|
||||
- param: doc --vm=co8
|
||||
|
@ -14,7 +14,7 @@ Coding standards are defined in [CODING.md](https://github.com/pgbackrest/pgback
|
||||
|
||||
## Building a Development Environment
|
||||
|
||||
This example is based on Ubuntu 18.04, but it should work on many versions of Debian and Ubuntu.
|
||||
This example is based on Ubuntu 20.04, but it should work on many versions of Debian and Ubuntu.
|
||||
|
||||
pgbackrest-dev => Install development tools
|
||||
```
|
||||
@ -315,24 +315,24 @@ pgbackrest/test/test.pl --vm=none --dev --module=postgres
|
||||
|
||||
#### With Docker
|
||||
|
||||
Build a container to run tests. The vm must be pre-configured but a variety are available. A vagrant file is provided in the test directory as an example of running in a virtual environment. The vm names are all three character abbreviations, e.g. `u18` for Ubuntu 18.04.
|
||||
Build a container to run tests. The vm must be pre-configured but a variety are available. A vagrant file is provided in the test directory as an example of running in a virtual environment. The vm names are all three character abbreviations, e.g. `u20` for Ubuntu 20.04.
|
||||
|
||||
pgbackrest-dev => Build a VM
|
||||
```
|
||||
pgbackrest/test/test.pl --vm-build --vm=u18
|
||||
pgbackrest/test/test.pl --vm-build --vm=u20
|
||||
|
||||
--- output ---
|
||||
|
||||
P00 INFO: test begin on x86_64 - log level info
|
||||
P00 INFO: Using cached pgbackrest/test:u18-base-20210521A image (a92925d1200fd12d5f3d59f3a3db555c6efa00be) ...
|
||||
P00 INFO: Building pgbackrest/test:u18-test image ...
|
||||
P00 INFO: Using cached pgbackrest/test:u20-base-20210717A image (738bc9b702a18d1fcb5ba33dae74c74e01e67527) ...
|
||||
P00 INFO: Building pgbackrest/test:u20-test image ...
|
||||
P00 INFO: Build Complete
|
||||
```
|
||||
> **NOTE:** to build all the vms, just omit the `--vm` option above.
|
||||
|
||||
pgbackrest-dev => Run a Specific Test Run
|
||||
```
|
||||
pgbackrest/test/test.pl --vm=u18 --dev --module=mock --test=archive --run=2
|
||||
pgbackrest/test/test.pl --vm=u20 --dev --module=mock --test=archive --run=2
|
||||
|
||||
--- output ---
|
||||
|
||||
@ -340,13 +340,13 @@ pgbackrest/test/test.pl --vm=u18 --dev --module=mock --test=archive --run=2
|
||||
P00 INFO: check code autogenerate
|
||||
P00 INFO: cleanup old data and containers
|
||||
P00 INFO: builds required: bin, bin host
|
||||
P00 INFO: bin dependencies have changed for u18, rebuilding...
|
||||
P00 INFO: build bin for u18 (/home/vagrant/test/bin/u18)
|
||||
P00 INFO: bin dependencies have changed for u20, rebuilding...
|
||||
P00 INFO: build bin for u20 (/home/docker/test/bin/u20)
|
||||
P00 INFO: bin dependencies have changed for none, rebuilding...
|
||||
P00 INFO: build bin for none (/home/vagrant/test/bin/none)
|
||||
P00 INFO: build bin for none (/home/docker/test/bin/none)
|
||||
P00 INFO: 1 test selected
|
||||
|
||||
P00 INFO: P1-T1/1 - vm=u18, module=mock, test=archive, run=2
|
||||
P00 INFO: P1-T1/1 - vm=u20, module=mock, test=archive, run=2
|
||||
P00 INFO: no code modules had all tests run required for coverage
|
||||
P00 INFO: TESTS COMPLETED SUCCESSFULLY
|
||||
```
|
||||
@ -498,7 +498,7 @@ TEST_ERROR(cmdCheck(), ConfigError, "primary database not found\nHINT: check ind
|
||||
|
||||
Unit tests are run for all files that are listed in `define.yaml` and a coverage report generated for each file listed under the tag `coverage:`. Note that some files are listed in multiple `coverage:` sections for a module; in this case, each test for the file being modified should be specified for the module in which the file exists (e.g. `--module=storage --test=posix --test=gcs`, etc.) or, alternatively, simply run the module without the `--test` option. It is recommended that a `--vm` be specified since running the same test for multiple vms is unnecessary for coverage. The following example would run the test set from the **define.yaml** section detailed above.
|
||||
```
|
||||
pgbackrest/test/test.pl --vm-out --dev --module=command --test=check --vm=u18
|
||||
pgbackrest/test/test.pl --vm-out --dev --module=command --test=check --vm=u20
|
||||
```
|
||||
> **NOTE:** Not all systems perform at the same speed, so if a test is timing out, try rerunning with another vm.
|
||||
|
||||
|
@ -225,7 +225,7 @@ eval
|
||||
|
||||
# Generate coverage summary
|
||||
&log(INFO, "Generate Coverage Summary");
|
||||
executeTest("${strTestExe} --vm=f32 --no-valgrind --clean --vm-max=2 --coverage-summary", {bShowOutputAsync => true});
|
||||
executeTest("${strTestExe} --vm=f33 --no-valgrind --clean --vm-max=2 --coverage-summary", {bShowOutputAsync => true});
|
||||
}
|
||||
|
||||
# Remove permanent cache file
|
||||
|
@ -24,7 +24,7 @@
|
||||
</variable-list>
|
||||
|
||||
<!-- Setup hosts used to build the documentation =========================================================================== -->
|
||||
<host-define if="{[os-type-is-debian]}" image="{[host-contrib-image]}" from="ubuntu:18.04">
|
||||
<host-define if="{[os-type-is-debian]}" image="{[host-contrib-image]}" from="ubuntu:20.04">
|
||||
{[copy-ca-cert]}
|
||||
|
||||
# Fix root tty
|
||||
@ -65,9 +65,9 @@
|
||||
<section id="environment">
|
||||
<title>Building a Development Environment</title>
|
||||
|
||||
<p>This example is based on <proper>Ubuntu 18.04</proper>, but it should work on many versions of <proper>Debian</proper> and <proper>Ubuntu</proper>.</p>
|
||||
<p>This example is based on <proper>Ubuntu 20.04</proper>, but it should work on many versions of <proper>Debian</proper> and <proper>Ubuntu</proper>.</p>
|
||||
|
||||
<host-add id="{[host-contrib-id]}" name="{[host-contrib]}" user="{[host-contrib-user]}" image="{[host-contrib-image]}" os="u18" option="-v /var/run/docker.sock:/var/run/docker.sock -v {[cwd]}/test:{[cwd]}/test" mount="/home/{[host-contrib-user]}/pgbackrest:/home/{[host-contrib-user]}/pgbackrest"/>
|
||||
<host-add id="{[host-contrib-id]}" name="{[host-contrib]}" user="{[host-contrib-user]}" image="{[host-contrib-image]}" os="u20" option="-v /var/run/docker.sock:/var/run/docker.sock -v {[cwd]}/test:{[cwd]}/test" mount="/home/{[host-contrib-user]}/pgbackrest:/home/{[host-contrib-user]}/pgbackrest"/>
|
||||
|
||||
<execute-list host="{[host-contrib]}">
|
||||
<title>Install development tools</title>
|
||||
@ -368,13 +368,13 @@ pgbackrest/doc/doc.pl --help
|
||||
<section id="with-docker" depend="/environment">
|
||||
<title>With Docker</title>
|
||||
|
||||
<p>Build a container to run tests. The vm must be pre-configured but a variety are available. A vagrant file is provided in the test directory as an example of running in a virtual environment. The vm names are all three character abbreviations, e.g. <id>u18</id> for <proper>Ubuntu 18.04</proper>.</p>
|
||||
<p>Build a container to run tests. The vm must be pre-configured but a variety are available. A vagrant file is provided in the test directory as an example of running in a virtual environment. The vm names are all three character abbreviations, e.g. <id>u20</id> for <proper>Ubuntu 20.04</proper>.</p>
|
||||
|
||||
<execute-list host="{[host-contrib]}">
|
||||
<title>Build a VM</title>
|
||||
|
||||
<execute output="y">
|
||||
<exe-cmd>pgbackrest/test/test.pl --vm-build --vm=u18</exe-cmd>
|
||||
<exe-cmd>pgbackrest/test/test.pl --vm-build --vm=u20</exe-cmd>
|
||||
<exe-cmd-extra>{[test-cmd-extra]}</exe-cmd-extra>
|
||||
</execute>
|
||||
</execute-list>
|
||||
@ -385,7 +385,7 @@ pgbackrest/doc/doc.pl --help
|
||||
<title>Run a Specific Test Run</title>
|
||||
|
||||
<execute output="y">
|
||||
<exe-cmd>pgbackrest/test/test.pl {[dash]}-vm=u18 {[dash]}-dev {[dash]}-module=mock {[dash]}-test=archive {[dash]}-run=2</exe-cmd>
|
||||
<exe-cmd>pgbackrest/test/test.pl {[dash]}-vm=u20 {[dash]}-dev {[dash]}-module=mock {[dash]}-test=archive {[dash]}-run=2</exe-cmd>
|
||||
<exe-cmd-extra>{[test-cmd-extra]}</exe-cmd-extra>
|
||||
</execute>
|
||||
</execute-list>
|
||||
@ -563,7 +563,7 @@ TEST_ERROR(cmdCheck(), ConfigError, "primary database not found\nHINT: check ind
|
||||
<p>Unit tests are run for all files that are listed in <file>define.yaml</file> and a coverage report generated for each file listed under the tag <code>coverage:</code>. Note that some files are listed in multiple <code>coverage:</code> sections for a module; in this case, each test for the file being modified should be specified for the module in which the file exists (e.g. <code>--module=storage --test=posix --test=gcs</code>, etc.) or, alternatively, simply run the module without the <code>--test</code> option. It is recommended that a <code>--vm</code> be specified since running the same test for multiple vms is unnecessary for coverage. The following example would run the test set from the <b>define.yaml</b> section detailed above.</p>
|
||||
|
||||
<code-block>
|
||||
pgbackrest/test/test.pl --vm-out --dev --module=command --test=check --vm=u18
|
||||
pgbackrest/test/test.pl --vm-out --dev --module=command --test=check --vm=u20
|
||||
</code-block>
|
||||
|
||||
<admonition type="note">Not all systems perform at the same speed, so if a test is timing out, try rerunning with another vm.</admonition>
|
||||
|
@ -302,7 +302,8 @@
|
||||
RUN export DEBIAN_FRONTEND=noninteractive && \
|
||||
rm /etc/apt/apt.conf.d/70debconf && \
|
||||
apt-get update && \
|
||||
apt-get install -y sudo ssh wget vim gnupg lsb-release iputils-ping ca-certificates tzdata locales 2>&1
|
||||
apt-get install -y --no-install-recommends sudo ssh wget vim gnupg lsb-release iputils-ping ca-certificates \
|
||||
tzdata locales 2>&1
|
||||
|
||||
{[sudo-disable-core-dump]}
|
||||
|
||||
@ -315,10 +316,10 @@
|
||||
tee -a /etc/apt/sources.list.d/pgdg.list && \
|
||||
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - && \
|
||||
apt-get update && \
|
||||
apt-get install -y postgresql-common 2>&1 && \
|
||||
apt-get install -y --no-install-recommends postgresql-common 2>&1 && \
|
||||
sed -i 's/^\#create\_main\_cluster.*$/create\_main\_cluster \= false/' \
|
||||
/etc/postgresql-common/createcluster.conf && \
|
||||
apt-get install -y postgresql-{[pg-version]} postgresql-{[pg-version-upgrade]} 2>&1
|
||||
apt-get install -y --no-install-recommends postgresql-{[pg-version]} postgresql-{[pg-version-upgrade]} 2>&1
|
||||
|
||||
# Create an ssh key for root so all hosts can ssh to each other as root
|
||||
RUN \ {[ssh-key-install]}
|
||||
|
@ -128,7 +128,7 @@ protocolParallelProcess(ProtocolParallel *this)
|
||||
if (this->clientJobList[clientIdx] != NULL)
|
||||
{
|
||||
int fd = protocolClientIoReadFd(*(ProtocolClient **)lstGet(this->clientList, clientIdx));
|
||||
FD_SET((unsigned int)fd, &selectSet);
|
||||
FD_SET(fd, &selectSet);
|
||||
|
||||
// Find the max file descriptor needed for select()
|
||||
MAX_ASSIGN(fdMax, fd);
|
||||
@ -158,7 +158,7 @@ protocolParallelProcess(ProtocolParallel *this)
|
||||
|
||||
if (job != NULL &&
|
||||
FD_ISSET(
|
||||
(unsigned int)protocolClientIoReadFd(*(ProtocolClient **)lstGet(this->clientList, clientIdx)),
|
||||
protocolClientIoReadFd(*(ProtocolClient **)lstGet(this->clientList, clientIdx)),
|
||||
&selectSet))
|
||||
{
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
|
@ -1,38 +1,34 @@
|
||||
# Force remove all containers:
|
||||
# docker rm -f $(docker ps -a -q)
|
||||
# Force remove all images:
|
||||
# docker rmi -f $(docker images -q)
|
||||
#
|
||||
# export PGB=pgbackrest;export PGB_IMAGE=$PGB/test:u20-main;PGB_REPO=~/Documents/Code/$PGB
|
||||
# docker build -f $PGB_REPO/test/Dockerfile -t $PGB_IMAGE .
|
||||
# docker build --squash -f $PGB_REPO/test/Dockerfile -t $PGB_IMAGE .
|
||||
# docker run --privileged -itd --name $PGB-test -h $PGB-test -v $PGB_REPO:/home/docker/$PGB $PGB_IMAGE
|
||||
|
||||
FROM ubuntu:focal
|
||||
|
||||
# Suppress "dpkg-reconfigure: unable to re-open stdin: No file or directory" warning
|
||||
RUN export DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive && \
|
||||
|
||||
# Install packages
|
||||
apt-get update && \
|
||||
apt-get install -y \
|
||||
sudo vim htop jq rsync sysstat \
|
||||
RUN apt-get update
|
||||
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
|
||||
sudo vim htop jq rsync sysstat curl \
|
||||
libdbd-pg-perl libxml-checker-perl libyaml-perl \
|
||||
devscripts build-essential lintian git cloc txt2man debhelper libssl-dev zlib1g-dev libperl-dev libxml2-dev liblz4-dev \
|
||||
liblz4-tool libpq-dev valgrind lcov autoconf-archive zstd libzstd-dev bzip2 libbz2-dev pkg-config && \
|
||||
liblz4-tool libpq-dev valgrind lcov autoconf-archive zstd libzstd-dev bzip2 libbz2-dev pkg-config libyaml-dev
|
||||
|
||||
# Install Docker
|
||||
groupadd -g5000 docker && \
|
||||
curl -fsSL https://get.docker.com | sh && \
|
||||
RUN groupadd -g5000 docker
|
||||
RUN curl -fsSL https://get.docker.com | sh
|
||||
|
||||
# Create docker user
|
||||
adduser --ingroup=docker -uid=5000 --disabled-password --gecos \"\" docker && \
|
||||
RUN adduser --ingroup=docker -uid=5000 --disabled-password --gecos \"\" docker
|
||||
|
||||
# Configure sudo
|
||||
echo '%docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers && \
|
||||
RUN echo '%docker ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
|
||||
|
||||
# Mount tmpfs at /home/docker/test for faster testing
|
||||
sudo -u docker mkdir -m 770 /home/docker/test && \
|
||||
echo 'tmpfs /home/docker/test tmpfs size=4096M 0 1' >> /etc/fstab
|
||||
RUN sudo -u docker mkdir -m 770 /home/docker/test
|
||||
RUN echo 'tmpfs /home/docker/test tmpfs size=4096M 0 1' >> /etc/fstab
|
||||
|
||||
# Cleanup
|
||||
RUN apt-get autoremove -y
|
||||
RUN apt-get clean
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
|
||||
USER docker
|
||||
WORKDIR /home/docker
|
||||
|
2
test/Vagrantfile
vendored
2
test/Vagrantfile
vendored
@ -76,7 +76,7 @@ Vagrant.configure(2) do |config|
|
||||
echo 'Install Build Tools' && date
|
||||
apt-get install -y devscripts build-essential lintian git cloc txt2man debhelper libssl-dev zlib1g-dev libperl-dev \
|
||||
libxml2-dev liblz4-dev liblz4-tool libpq-dev valgrind lcov autoconf-archive zstd libzstd-dev bzip2 libbz2-dev \
|
||||
pkg-config
|
||||
pkg-config libyaml-dev
|
||||
|
||||
#-----------------------------------------------------------------------------------------------------------------------
|
||||
echo 'Install Docker' && date
|
||||
|
@ -12,23 +12,14 @@
|
||||
# - docker login -u pgbackrest
|
||||
# - VM=XXX;DATE=YYYYMMDDX;BASE=pgbackrest/test:${VM?}-base;docker tag ${BASE?} ${BASE?}-${DATE?} && docker push ${BASE?}-${DATE?}
|
||||
# **********************************************************************************************************************************
|
||||
20210521A:
|
||||
x86_64:
|
||||
u18: a92925d1200fd12d5f3d59f3a3db555c6efa00be
|
||||
|
||||
20210503A:
|
||||
20210718A:
|
||||
aarch64:
|
||||
u20: 00a309971d5566ff3eb0db92c66b4f4ef0566d36
|
||||
co7: 41b9ffa64e5914753708eb3cdde3892010683fd7
|
||||
u20: d6c377617ac2c112b80a3c1f090345d54769ae1b
|
||||
co7: 8726f3be088e4ba34eb45e32c1994a32ca0e5c1d
|
||||
|
||||
20210113A:
|
||||
20210717A:
|
||||
x86_64:
|
||||
co7: 2c1e13990f92635cc7d959dcbe497b765861c2b2
|
||||
|
||||
20200507A:
|
||||
x86_64:
|
||||
f32: 61792779061d2a675509c65bfa64b61b8d4cea17
|
||||
|
||||
20200505A:
|
||||
x86_64:
|
||||
u12: 8a88ab44aace049d7da5ca1094375ff8b9aeb7ab
|
||||
co7: 03a73386264355a5d1750ccd13371db97d92ab28
|
||||
f33: 80326dab5c7d0137062b8d181ca07f9b14142de7
|
||||
u16: 599d0d35a6e29ad3258c76ba4f9ea622d47fa8c0
|
||||
u20: d6c377617ac2c112b80a3c1f090345d54769ae1b
|
||||
|
@ -278,7 +278,7 @@ sub entryPointSetup
|
||||
|
||||
my $oVm = vmGet();
|
||||
|
||||
if ($oVm->{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_RHEL || $strOS eq VM_U12)
|
||||
if ($oVm->{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_RHEL)
|
||||
{
|
||||
$strScript .= '/usr/sbin/sshd -D';
|
||||
}
|
||||
@ -358,27 +358,18 @@ sub containerBuild
|
||||
" yum -y install openssh-server openssh-clients wget sudo valgrind git \\\n" .
|
||||
" perl perl-Digest-SHA perl-DBD-Pg perl-YAML-LibYAML openssl \\\n" .
|
||||
" gcc make perl-ExtUtils-MakeMaker perl-Test-Simple openssl-devel perl-ExtUtils-Embed rpm-build \\\n" .
|
||||
" zlib-devel libxml2-devel lz4-devel lz4 bzip2-devel bzip2 perl-JSON-PP";
|
||||
" libyaml-devel zlib-devel libxml2-devel lz4-devel lz4 bzip2-devel bzip2 perl-JSON-PP";
|
||||
}
|
||||
else
|
||||
{
|
||||
$strScript .=
|
||||
" export DEBCONF_NONINTERACTIVE_SEEN=true DEBIAN_FRONTEND=noninteractive && \\\n" .
|
||||
" apt-get update && \\\n" .
|
||||
" apt-get -y install openssh-server wget sudo gcc make valgrind git \\\n" .
|
||||
" apt-get install -y --no-install-recommends openssh-server wget sudo gcc make valgrind git \\\n" .
|
||||
" libdbd-pg-perl libhtml-parser-perl libssl-dev libperl-dev \\\n" .
|
||||
" libyaml-libyaml-perl tzdata devscripts lintian libxml-checker-perl txt2man debhelper \\\n" .
|
||||
" libppi-html-perl libtemplate-perl libtest-differences-perl zlib1g-dev libxml2-dev pkg-config \\\n" .
|
||||
" libbz2-dev bzip2";
|
||||
|
||||
if ($strOS eq VM_U12)
|
||||
{
|
||||
$strScript .= ' libperl5.14';
|
||||
}
|
||||
else
|
||||
{
|
||||
$strScript .= ' libjson-pp-perl liblz4-dev liblz4-tool';
|
||||
}
|
||||
" libbz2-dev bzip2 libyaml-dev libjson-pp-perl liblz4-dev liblz4-tool";
|
||||
}
|
||||
|
||||
# Add zst command-line tool and development libs when available
|
||||
@ -415,13 +406,6 @@ sub containerBuild
|
||||
$strScript .= sectionHeader() .
|
||||
"# Suppress dpkg interactive output\n" .
|
||||
" rm /etc/apt/apt.conf.d/70debconf";
|
||||
|
||||
if ($strOS eq VM_U12)
|
||||
{
|
||||
$strScript .= sectionHeader() .
|
||||
"# Create run directory required by SSH (not created automatically on Ubuntu 12.04)\n" .
|
||||
" mkdir -p /var/run/sshd";
|
||||
}
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
@ -470,11 +454,11 @@ sub containerBuild
|
||||
" https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-" . hostArch() . "/" .
|
||||
"pgdg-redhat-repo-latest.noarch.rpm && \\\n";
|
||||
}
|
||||
elsif ($strOS eq VM_F32)
|
||||
elsif ($strOS eq VM_F33)
|
||||
{
|
||||
$strScript .=
|
||||
" rpm -ivh \\\n" .
|
||||
" https://download.postgresql.org/pub/repos/yum/reporpms/F-32-" . hostArch() . "/" .
|
||||
" https://download.postgresql.org/pub/repos/yum/reporpms/F-33-" . hostArch() . "/" .
|
||||
"pgdg-fedora-repo-latest.noarch.rpm && \\\n";
|
||||
}
|
||||
|
||||
@ -484,11 +468,11 @@ sub containerBuild
|
||||
{
|
||||
$strScript .=
|
||||
" echo 'deb http://apt.postgresql.org/pub/repos/apt/ " .
|
||||
$$oVm{$strOS}{&VM_OS_REPO} . '-pgdg main' . ($strOS eq VM_U18 ? ' 14' : '') .
|
||||
$$oVm{$strOS}{&VM_OS_REPO} . '-pgdg main' . ($strOS eq VM_U20 ? ' 14' : '') .
|
||||
"' >> /etc/apt/sources.list.d/pgdg.list && \\\n" .
|
||||
" wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \\\n" .
|
||||
" apt-get update && \\\n" .
|
||||
" apt-get install -y postgresql-common libpq-dev && \\\n" .
|
||||
" apt-get install -y --no-install-recommends postgresql-common libpq-dev && \\\n" .
|
||||
" sed -i 's/^\\#create\\_main\\_cluster.*\$/create\\_main\\_cluster \\= false/' " .
|
||||
"/etc/postgresql-common/createcluster.conf";
|
||||
}
|
||||
@ -504,7 +488,7 @@ sub containerBuild
|
||||
}
|
||||
else
|
||||
{
|
||||
$strScript .= " apt-get install -y";
|
||||
$strScript .= " apt-get install -y --no-install-recommends";
|
||||
}
|
||||
|
||||
# Construct list of databases to install
|
||||
@ -516,6 +500,12 @@ sub containerBuild
|
||||
$strDbVersionNoDot =~ s/\.//;
|
||||
|
||||
$strScript .= " postgresql${strDbVersionNoDot}-server";
|
||||
|
||||
# Add development package for the latest version of postgres
|
||||
if ($strDbVersion eq @{$oOS->{&VM_DB}}[-1])
|
||||
{
|
||||
$strScript .= " postgresql${strDbVersionNoDot}-devel";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -525,6 +515,12 @@ sub containerBuild
|
||||
}
|
||||
}
|
||||
|
||||
# Add path to lastest version of postgres
|
||||
if ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_RHEL)
|
||||
{
|
||||
$strScript .=
|
||||
"\n\nENV PATH=/usr/pgsql-" . @{$oOS->{&VM_DB}}[-1] . "/bin:\$PATH\n";
|
||||
}
|
||||
|
||||
#---------------------------------------------------------------------------------------------------------------------------
|
||||
if ($$oVm{$strOS}{&VM_OS_BASE} eq VM_OS_BASE_DEBIAN)
|
||||
@ -532,7 +528,10 @@ sub containerBuild
|
||||
$strScript .= sectionHeader() .
|
||||
"# Cleanup\n";
|
||||
|
||||
$strScript .= " apt-get clean";
|
||||
$strScript .=
|
||||
" apt-get autoremove -y && \\\n" .
|
||||
" apt-get clean && \\\n" .
|
||||
" rm -rf /var/lib/apt/lists/*";
|
||||
}
|
||||
|
||||
containerWrite(
|
||||
@ -573,7 +572,8 @@ sub containerBuild
|
||||
$strScript .=
|
||||
# Don't allow sudo to disable core dump (suppresses errors, see https://github.com/sudo-project/sudo/issues/42)
|
||||
" echo \"Set disable_coredump false\" >> /etc/sudo.conf && \\\n" .
|
||||
" echo '%" . TEST_GROUP . " ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/" . TEST_GROUP . " && \\\n" .
|
||||
" echo '%" . TEST_GROUP . " ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/" . TEST_GROUP .
|
||||
" && \\\n" .
|
||||
" sed -i 's/^Defaults requiretty\$/\\# Defaults requiretty/' /etc/sudoers";
|
||||
}
|
||||
else
|
||||
|
@ -94,12 +94,8 @@ use constant VM_CO7 => 'co7';
|
||||
push @EXPORT, qw(VM_CO7);
|
||||
use constant VM_CO8 => 'co8';
|
||||
push @EXPORT, qw(VM_CO8);
|
||||
use constant VM_F32 => 'f32';
|
||||
push @EXPORT, qw(VM_F32);
|
||||
use constant VM_U12 => 'u12';
|
||||
push @EXPORT, qw(VM_U12);
|
||||
use constant VM_U14 => 'u14';
|
||||
push @EXPORT, qw(VM_U14);
|
||||
use constant VM_F33 => 'f33';
|
||||
push @EXPORT, qw(VM_F33);
|
||||
use constant VM_U16 => 'u16';
|
||||
push @EXPORT, qw(VM_U16);
|
||||
use constant VM_U18 => 'u18';
|
||||
@ -116,11 +112,11 @@ use constant VM_EXPECT => VM_CO7;
|
||||
push @EXPORT, qw(VM_EXPECT);
|
||||
|
||||
# VM aliases for run matrices (numbered oldest to newest)
|
||||
use constant VM2 => VM_U12;
|
||||
use constant VM2 => VM_U16;
|
||||
push @EXPORT, qw(VM2);
|
||||
use constant VM3 => VM_CO7;
|
||||
push @EXPORT, qw(VM3);
|
||||
use constant VM4 => VM_U18;
|
||||
use constant VM4 => VM_U20;
|
||||
push @EXPORT, qw(VM4);
|
||||
|
||||
# List of default test VMs
|
||||
@ -179,12 +175,12 @@ my $oyVm =
|
||||
],
|
||||
},
|
||||
|
||||
# Fedora 32
|
||||
&VM_F32 =>
|
||||
# Fedora 33
|
||||
&VM_F33 =>
|
||||
{
|
||||
&VM_OS_BASE => VM_OS_BASE_RHEL,
|
||||
&VM_OS => VM_OS_CENTOS,
|
||||
&VM_IMAGE => 'fedora:32',
|
||||
&VM_IMAGE => 'fedora:33',
|
||||
&VM_ARCH => VM_ARCH_AMD64,
|
||||
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
|
||||
&VMDEF_COVERAGE_C => true,
|
||||
@ -194,11 +190,11 @@ my $oyVm =
|
||||
|
||||
&VM_DB =>
|
||||
[
|
||||
PG_VERSION_95,
|
||||
PG_VERSION_96,
|
||||
PG_VERSION_10,
|
||||
PG_VERSION_11,
|
||||
PG_VERSION_12,
|
||||
PG_VERSION_13,
|
||||
],
|
||||
|
||||
&VM_DB_TEST =>
|
||||
@ -265,83 +261,23 @@ my $oyVm =
|
||||
],
|
||||
},
|
||||
|
||||
# Ubuntu 12.04
|
||||
&VM_U12 =>
|
||||
{
|
||||
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
|
||||
&VM_OS => VM_OS_UBUNTU,
|
||||
&VM_OS_REPO => 'precise',
|
||||
&VM_IMAGE => 'i386/ubuntu:12.04',
|
||||
&VM_ARCH => VM_ARCH_I386,
|
||||
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
||||
&VMDEF_WITH_LZ4 => false,
|
||||
|
||||
&VM_DB =>
|
||||
[
|
||||
PG_VERSION_83,
|
||||
PG_VERSION_84,
|
||||
PG_VERSION_90,
|
||||
PG_VERSION_91,
|
||||
PG_VERSION_92,
|
||||
PG_VERSION_93,
|
||||
],
|
||||
|
||||
&VM_DB_TEST =>
|
||||
[
|
||||
PG_VERSION_83,
|
||||
PG_VERSION_84,
|
||||
PG_VERSION_90,
|
||||
PG_VERSION_91,
|
||||
PG_VERSION_92,
|
||||
],
|
||||
},
|
||||
|
||||
# Ubuntu 14.04
|
||||
&VM_U14 =>
|
||||
{
|
||||
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
|
||||
&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',
|
||||
|
||||
&VM_DB =>
|
||||
[
|
||||
PG_VERSION_84,
|
||||
PG_VERSION_90,
|
||||
PG_VERSION_91,
|
||||
PG_VERSION_92,
|
||||
PG_VERSION_93,
|
||||
PG_VERSION_94,
|
||||
PG_VERSION_95,
|
||||
PG_VERSION_96,
|
||||
PG_VERSION_10,
|
||||
PG_VERSION_11,
|
||||
PG_VERSION_12,
|
||||
PG_VERSION_13,
|
||||
],
|
||||
|
||||
&VM_DB =>
|
||||
[
|
||||
PG_VERSION_94,
|
||||
],
|
||||
},
|
||||
|
||||
# Ubuntu 16.04
|
||||
&VM_U16 =>
|
||||
{
|
||||
&VM_OS_BASE => VM_OS_BASE_DEBIAN,
|
||||
&VM_OS => VM_OS_UBUNTU,
|
||||
&VM_OS_REPO => 'xenial',
|
||||
&VM_IMAGE => 'ubuntu:16.04',
|
||||
&VM_ARCH => VM_ARCH_AMD64,
|
||||
&VM_IMAGE => 'i386/ubuntu:16.04',
|
||||
&VM_ARCH => VM_ARCH_I386,
|
||||
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
|
||||
|
||||
&VMDEF_WITH_BACKTRACE => true,
|
||||
|
||||
&VM_DB =>
|
||||
[
|
||||
PG_VERSION_83,
|
||||
PG_VERSION_84,
|
||||
PG_VERSION_90,
|
||||
PG_VERSION_91,
|
||||
PG_VERSION_92,
|
||||
PG_VERSION_93,
|
||||
@ -356,8 +292,11 @@ my $oyVm =
|
||||
|
||||
&VM_DB_TEST =>
|
||||
[
|
||||
PG_VERSION_94,
|
||||
PG_VERSION_95,
|
||||
PG_VERSION_83,
|
||||
PG_VERSION_84,
|
||||
PG_VERSION_90,
|
||||
PG_VERSION_91,
|
||||
PG_VERSION_92,
|
||||
],
|
||||
},
|
||||
|
||||
@ -390,7 +329,6 @@ my $oyVm =
|
||||
PG_VERSION_11,
|
||||
PG_VERSION_12,
|
||||
PG_VERSION_13,
|
||||
PG_VERSION_14,
|
||||
],
|
||||
|
||||
&VM_DB_TEST =>
|
||||
@ -402,7 +340,6 @@ my $oyVm =
|
||||
PG_VERSION_11,
|
||||
PG_VERSION_12,
|
||||
PG_VERSION_13,
|
||||
PG_VERSION_14,
|
||||
],
|
||||
},
|
||||
|
||||
@ -433,11 +370,11 @@ my $oyVm =
|
||||
PG_VERSION_11,
|
||||
PG_VERSION_12,
|
||||
PG_VERSION_13,
|
||||
PG_VERSION_14,
|
||||
],
|
||||
|
||||
&VM_DB_TEST =>
|
||||
[
|
||||
PG_VERSION_92,
|
||||
PG_VERSION_93,
|
||||
PG_VERSION_94,
|
||||
PG_VERSION_95,
|
||||
@ -445,6 +382,7 @@ my $oyVm =
|
||||
PG_VERSION_11,
|
||||
PG_VERSION_12,
|
||||
PG_VERSION_13,
|
||||
PG_VERSION_14,
|
||||
],
|
||||
},
|
||||
};
|
||||
|
11
test/src/valgrind.suppress.co7
Normal file
11
test/src/valgrind.suppress.co7
Normal file
@ -0,0 +1,11 @@
|
||||
# This is an issue after calling getaddrinfo() even if freeaddrinfo() is called as well
|
||||
{
|
||||
ignore_free_error_after_getaddrinfo
|
||||
Memcheck:Free
|
||||
fun:free
|
||||
fun:__libc_freeres
|
||||
fun:_vgnU_freeres
|
||||
fun:__run_exit_handlers
|
||||
fun:exit
|
||||
...
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
{
|
||||
ignore_libcrypto_leaks
|
||||
Memcheck:Leak
|
||||
...
|
||||
obj:*/libcrypto.so*
|
||||
}
|
||||
|
||||
# This is an issue on CentOS 7 after calling getaddrinfo() even if freeaddrinfo() is called as well
|
||||
{
|
||||
ignore_free_error_after_getaddrinfo
|
||||
Memcheck:Free
|
||||
fun:free
|
||||
fun:__libc_freeres
|
||||
fun:_vgnU_freeres
|
||||
fun:__run_exit_handlers
|
||||
fun:exit
|
||||
...
|
||||
}
|
||||
|
||||
# This only seems to be an issue on Ubuntu 12.04 -- probably due to the old version of Valgrind
|
||||
{
|
||||
ignore_libcrypto_uninit_cond_jump
|
||||
Memcheck:Cond
|
||||
...
|
||||
obj:*/libcrypto.so*
|
||||
}
|
||||
|
||||
# This only seems to be an issue on Ubuntu 12.04 -- probably due to the old version of Valgrind
|
||||
{
|
||||
ignore_libz_uninit_cond_jump
|
||||
Memcheck:Cond
|
||||
fun:inflateReset2
|
||||
...
|
||||
obj:*/libz.so*
|
||||
}
|
||||
|
||||
# This only seems to be an issue on Ubuntu 12.04 -- probably due to the old version of Valgrind
|
||||
{
|
||||
ignore_getgrgid_leak
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:getgrgid
|
||||
...
|
||||
}
|
||||
|
||||
# This only seems to be an issue on Ubuntu 12.04 -- probably due to the old version of Valgrind
|
||||
{
|
||||
ignore_getpwuid_leak
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
...
|
||||
fun:getpwuid
|
||||
...
|
||||
}
|
7
test/src/valgrind.suppress.u16
Normal file
7
test/src/valgrind.suppress.u16
Normal file
@ -0,0 +1,7 @@
|
||||
# Newer versions do not have this leak
|
||||
{
|
||||
ignore_libcrypto_leaks
|
||||
Memcheck:Leak
|
||||
...
|
||||
obj:*/libcrypto.so*
|
||||
}
|
@ -934,7 +934,7 @@ eval
|
||||
|
||||
executeTest(
|
||||
($strVm ne VM_NONE ? "docker exec -i test-build " : '') .
|
||||
"bash -c 'cd ${strBuildPath} && debuild -i -us -uc -b'");
|
||||
"bash -c 'cd ${strBuildPath} && debuild -d -i -us -uc -b'");
|
||||
|
||||
executeTest(
|
||||
($strVm ne VM_NONE ? "docker exec -i test-build " : '') .
|
||||
|
Loading…
Reference in New Issue
Block a user