public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/postgresql-jdbc] rawhide: Introduce a different script to be able to fix RequireAuth tests
@ 2026-06-11 8:13 Marian Koncek
0 siblings, 0 replies; only message in thread
From: Marian Koncek @ 2026-06-11 8:13 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/postgresql-jdbc
Branch : rawhide
Commit : 4e3a45fe2626cb1de836f5f76c110a452c8634af
Author : Marian Koncek <mkoncek@redhat.com>
Date : 2026-06-11T10:08:07+02:00
Stats : +38/-37 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/postgresql-jdbc/c/4e3a45fe2626cb1de836f5f76c110a452c8634af?branch=rawhide
Log:
Introduce a different script to be able to fix RequireAuth tests
---
diff --git a/postgresql-jdbc.spec b/postgresql-jdbc.spec
index 30388d5..53bee71 100644
--- a/postgresql-jdbc.spec
+++ b/postgresql-jdbc.spec
@@ -53,7 +53,7 @@ Release: %autorelease
License: BSD-2-Clause
URL: https://jdbc.postgresql.org/
Source0: https://repo1.maven.org/maven2/org/postgresql/postgresql/%{version}/postgresql-%{version}-jdbc-src.tar.gz
-Source1: postgresql_jdbc_tests_init.sh
+Source1: postgresql_jdbc_tests_start.sh
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
@@ -133,10 +133,6 @@ grep -l -r '^import uk\.org\.webcompere\.systemstubs' src/test | xargs rm -v
# Include PostgreSQL testing methods and variables.
%if %runselftest
. %{SOURCE1}
-setup_build_local_properties > build.local.properties
-
-# Start the local PG cluster.
-%postgresql_tests_start
%else
# NOTE this parameter skips running tests but still compiles them
opts="-DskipTests=true"
diff --git a/postgresql_jdbc_tests_init.sh b/postgresql_jdbc_tests_init.sh
deleted file mode 100755
index 160528c..0000000
--- a/postgresql_jdbc_tests_init.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/bash
-
-# Before running tests, source this file.
-# Call the function `setup_build_local_properties` and redirect its output into
-# the file `build.local.properties` and run the tests in the same directory.
-
-. /usr/share/postgresql-setup/postgresql_pkg_tests.sh
-
-PGTESTS_LOCALE=C.UTF-8
-
-mkdir -p "$PGTESTS_DATADIR"
-cat > "$PGTESTS_DATADIR/pg_hba.conf" << EOF
-# RequireAuthTest - different auth methods for different users
-host authtest nobody all trust
-host authtest pword all password
-host authtest md51 all md5
-EOF
-
-function setup_build_local_properties
-{
-cat << EOF
-test.url.PGHOST=localhost
-test.url.PGPORT=$PGTESTS_PORT
-test.url.PGDBNAME=test
-user=test
-password=test
-privilegedUser=$PGTESTS_ADMIN
-privilegedPassword=$PGTESTS_ADMINPASS
-preparethreshold=5
-loglevel=0
-EOF
-}
diff --git a/postgresql_jdbc_tests_start.sh b/postgresql_jdbc_tests_start.sh
new file mode 100755
index 0000000..3796841
--- /dev/null
+++ b/postgresql_jdbc_tests_start.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/bash
+
+# This script sets up postgresql server for the postgresql-jdbc tests.
+# It needs to be sourced, not executed because of trap actions would shut the
+# server down at the end of the script.
+
+set -ex
+
+. /usr/share/postgresql-setup/postgresql_pkg_tests.sh
+
+PGTESTS_LOCALE=C.UTF-8
+
+echo "\
+test.url.PGHOST=localhost
+test.url.PGPORT=$PGTESTS_PORT
+test.url.PGDBNAME=test
+user=test
+password=test
+privilegedUser=$PGTESTS_ADMIN
+privilegedPassword=$PGTESTS_ADMINPASS
+preparethreshold=5
+loglevel=0
+" > build.local.properties
+
+# RPM macro %postgresql_tests_start
+pgtests_start
+
+# Custom config required by RequireAuthTest.
+# Needs to be at the beginning of the file.
+echo "\
+# RequireAuthTest - different auth methods for different users
+host authtest nobody all trust
+host authtest pword all password
+host authtest md51 all md5
+$(cat "$PGTESTS_DATADIR/pg_hba.conf")" > "$PGTESTS_DATADIR/pg_hba.conf"
+
+pg_ctl reload -D "$PGTESTS_DATADIR"
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-11 8:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-11 8:13 [rpms/postgresql-jdbc] rawhide: Introduce a different script to be able to fix RequireAuth tests Marian Koncek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox