pgbackrest.git / summary / log / commit / refs
commit aca779a6ec3f4d6ba1d7c2d5c8bbb2fa64e215ef
Author: David Steele <david@pgbackrest.org>
Date: Sat Jun 13 05:18:33 2026 +0000
Run integration tests on Alpine 3.21 (musl libc).
Drop the c-only restriction for the a321 CI job so the full unit and integration suites run on musl libc, exercising the integration tests (including SFTP) against Alpine in addition to glibc.
Apply the ssh-rsa HostKeyAlgorithms/PubkeyAcceptedAlgorithms workaround to a321 as well as u22, since Alpine 3.21 ships OpenSSH 9.x which no longer offers the SHA-1 ssh-rsa host-key algorithm by default and the libssh2 client requires it (otherwise the SFTP handshake fails key exchange with LIBSSH2_ERROR_KEX_FAILURE).
Suppress the libssh2_session_init_ex and libssh2_session_handshake "possibly lost" leaks reported by valgrind during SFTP integration. These are persistent allocations tied to the session lifetime and are flagged only on the Linux CI runner where valgrind wraps the integration test binary. The suppressions go in valgrind.suppress.none because integration tests always run with vm none.
Generalize hrnHostPgBinPath() to probe the Debian, RHEL, and Alpine PostgreSQL bin paths in turn rather than hardcoding two, and throw a clear assert if none match.
Add a321 to the default VM list, install PostgreSQL 15/16/17 on Alpine, and point VMDEF_PGSQL_BIN at the Alpine layout. Rebuild the a321 base image accordingly.
.github/workflows/test.yml | 4 ++--
test/container.yaml | 5 ++++-
test/lib/pgBackRestTest/Common/ContainerTest.pm | 2 +-
test/lib/pgBackRestTest/Common/VmTest.pm | 9 ++++----
test/src/common/harnessHost.c | 29 +++++++++++++++++++------
test/src/valgrind.suppress.none | 14 ++++++++++++
6 files changed, 48 insertions(+), 15 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index d0defc287..6ad71a93d 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -50,8 +50,8 @@ jobs:
# All unit tests on the newest gcc available
- param: test --vm=f44 --param=c-only --param=no-valgrind --param=no-coverage --param=no-performance
- # All unit tests on musl libc
- - param: test --vm=a321 --param=c-only --param=no-coverage --param=no-performance
+ # All unit and integration tests on musl libc
+ - param: test --vm=a321 --param=no-coverage --param=no-performance
# RHEL documentation
- param: doc --vm=rh8
diff --git a/test/container.yaml b/test/container.yaml
index fad39b177..0172cb54c 100644
--- a/test/container.yaml
+++ b/test/container.yaml
@@ -12,6 +12,10 @@
# - docker login -u pgbackrest
# - DATE=YYYYMMDDX;VM=X;ARCH=X;BASE=pgbackrest/test:${VM?}-base-${ARCH?};docker tag ${BASE?} ${BASE?}-${DATE?} && docker push ${BASE?}-${DATE?}
# **********************************************************************************************************************************
+20260613A:
+ x86_64:
+ a321: 81e4c3b40948ede95e1053eb26d5df27a4f84022
+
20260612A:
i386:
d12: 8fb978ab92ce2d69650af9d8bf999e1435276664
@@ -30,6 +34,5 @@
u22: 2ab1bb42a3815ee6102f0be6ea1b3c579d09e136
x86_64:
- a321: dab99d91eed1710c68dae28efa5cd0e27e0a7f60
rh8: 0142e914cbf025f405a34d4c432e72c303476fe6
u22: 003a17aace256ed45378c079c895acdff93129b5
diff --git a/test/lib/pgBackRestTest/Common/ContainerTest.pm b/test/lib/pgBackRestTest/Common/ContainerTest.pm
index e5f86457e..9c3306af9 100644
--- a/test/lib/pgBackRestTest/Common/ContainerTest.pm
+++ b/test/lib/pgBackRestTest/Common/ContainerTest.pm
@@ -604,7 +604,7 @@ sub containerBuild
" echo '***********************************************' >> /etc/issue.net && \\\n" .
" echo 'Banner /etc/issue.net' >> /etc/ssh/sshd_config";
- if ($strOS eq VM_U22)
+ if ($strOS eq VM_U22 || $strOS eq VM_A321)
{
$strScript .= sectionHeader() .
" echo '# Add PubkeyAcceptedAlgorithms (required for SFTP)' >> /etc/ssh/sshd_config && \\\n" .
diff --git a/test/lib/pgBackRestTest/Common/VmTest.pm b/test/lib/pgBackRestTest/Common/VmTest.pm
index 0f5735f22..c5f822719 100644
--- a/test/lib/pgBackRestTest/Common/VmTest.pm
+++ b/test/lib/pgBackRestTest/Common/VmTest.pm
@@ -79,7 +79,7 @@ use constant VM_U22 => 'u22';
push @EXPORT, qw(VM_U22);
# List of default test VMs
-use constant VM_LIST => (VM_D12, VM_RH8, VM_U22);
+use constant VM_LIST => (VM_D12, VM_RH8, VM_U22, VM_A321);
push @EXPORT, qw(VM_LIST);
my $oyVm =
@@ -108,16 +108,18 @@ my $oyVm =
&VM_OS_BASE => VM_OS_BASE_ALPINE,
&VM_IMAGE => 'alpine:3.21',
&VMDEF_PG_REPO => false,
- &VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
+ &VMDEF_PGSQL_BIN => '/usr/libexec/postgresql{[version]}',
&VM_DB =>
[
+ PG_VERSION_15,
+ PG_VERSION_16,
PG_VERSION_17,
],
&VM_DB_TEST =>
[
- PG_VERSION_17,
+ PG_VERSION_16,
],
},
@@ -158,7 +160,6 @@ my $oyVm =
&VM_DB_TEST =>
[
PG_VERSION_14,
- PG_VERSION_16,
PG_VERSION_17,
],
},
diff --git a/test/src/common/harnessHost.c b/test/src/common/harnessHost.c
index c79697b32..a12d722ee 100644
--- a/test/src/common/harnessHost.c
+++ b/test/src/common/harnessHost.c
@@ -937,17 +937,32 @@ hrnHostPgBinPath(HrnHost *const this)
{
MEM_CONTEXT_TEMP_BEGIN()
{
- const String *pgPath = strNewFmt("/usr/lib/postgresql/%s/bin", strZ(pgVersionToStr(hrnHostPgVersion())));
+ const String *pgPath = NULL;
+ const char *const version = strZ(pgVersionToStr(hrnHostPgVersion()));
- TRY_BEGIN()
+ const String *const pgPathList[] =
{
- hrnHostExecP(this, strNewFmt("ls %s/initdb", strZ(pgPath)));
- }
- CATCH_ANY()
+ strNewFmt("/usr/lib/postgresql/%s/bin", version), // Debian
+ strNewFmt("/usr/pgsql-%s/bin", version), // RHEL
+ strNewFmt("/usr/libexec/postgresql%s", version), // Alpine
+ };
+
+ for (unsigned int pgPathIdx = 0; pgPath == NULL && pgPathIdx < LENGTH_OF(pgPathList); pgPathIdx++)
{
- pgPath = strNewFmt("/usr/pgsql-%s/bin", strZ(pgVersionToStr(hrnHostPgVersion())));
+ TRY_BEGIN()
+ {
+ hrnHostExecP(this, strNewFmt("ls %s/initdb", strZ(pgPathList[pgPathIdx])));
+ pgPath = pgPathList[pgPathIdx];
+ }
+ CATCH_ANY()
+ {
+ // Try the next path
+ }
+ TRY_END();
}
- TRY_END();
+
+ if (pgPath == NULL)
+ THROW_FMT(AssertError, "unable to find bin path for PostgreSQL %s", version);
MEM_CONTEXT_OBJ_BEGIN(this)
{
diff --git a/test/src/valgrind.suppress.none b/test/src/valgrind.suppress.none
index cb1ad8c56..d3247bebd 100644
--- a/test/src/valgrind.suppress.none
+++ b/test/src/valgrind.suppress.none
@@ -12,3 +12,17 @@
fun:_Unwind_Backtrace
fun:backtrace_full
}
+{
+ libssh2_session_handshake
+ Memcheck:Leak
+ match-leak-kinds: possible
+ ...
+ fun:libssh2_session_handshake
+}
+{
+ libssh2_session_init_ex
+ Memcheck:Leak
+ match-leak-kinds: possible
+ ...
+ fun:libssh2_session_init_ex
+}
[parent: 760dd8db69e7]