public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Marian Koncek <mkoncek@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/postgresql-jdbc] rawhide: Introduce a different script to be able to fix RequireAuth tests
Date: Thu, 11 Jun 2026 08:13:25 GMT	[thread overview]
Message-ID: <178116560517.1.13725494493529987323.rpms-postgresql-jdbc-4e3a45fe2626@fedoraproject.org> (raw)

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"

                 reply	other threads:[~2026-06-11  8:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178116560517.1.13725494493529987323.rpms-postgresql-jdbc-4e3a45fe2626@fedoraproject.org \
    --to=mkoncek@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox