testsuite script does not stop running postgresql clusters correctly

Bug #712200 reported by Steve Beattie
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgresql-common (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: postgresql-common

The testsuite script in /usr/share/postgresql-common/testsuite attempts to stop any existing running postgresql clusters before running any tests by invoking postgresql's initscript with the following code:

  # temporarily move away existing clusters
  for v in $(ls /usr/lib/postgresql/); do
      if [ -x "/etc/init.d/postgresql-$v" ]; then
          /etc/init.d/postgresql-$v stop
      fi
  done

However, in Ubuntu 10.10 (maverick) and newer, the postgresql initscript is no longer versioned; it's just /etc/init.d/postgresql. Because there are running clusters, the second test in /usr/share/postgresql-common/t/010_defaultport_cluster.t stops the testsuite because it prompts for a password.

Two things should be done to address this; first, something like the following patch should be applied the testsuite script:

--- a/testsuite 2011-02-02 16:13:30.273258985 -0800
+++ b/testsuite 2011-02-02 16:14:01.109259639 -0800
@@ -42,6 +42,9 @@
         /etc/init.d/postgresql-$v stop
     fi
 done
+if [ -x "/etc/init.d/postgresql" ]; then
+ /etc/init.d/postgresql stop
+fi

 if [ -d /etc/postgresql ]; then
     mv /etc/postgresql /etc/postgresql.testsuite;

and second, it'd be nice if the psql command in /usr/share/postgresql-common/t/010_defaultport_cluster.t:

  like_program_out 0, 'env LC_MESSAGES=C psql -h 127.0.0.1 -l', 2, qr/could not connect/,

could include the '-w' switch to never prompt for a password.

Fixing this would make the testsuite runnable again under maverick and natty.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: postgresql-common 111
ProcVersionSignature: Ubuntu 2.6.35-25.44-generic-pae 2.6.35.10
Uname: Linux 2.6.35-25-generic-pae i686
Architecture: i386
Date: Wed Feb 2 16:06:25 2011
InstallationMedia: Ubuntu-Server 10.10 "Maverick Meerkat" - Release i386 (20101007)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: postgresql-common

Revision history for this message
Steve Beattie (sbeattie) wrote :
tags: added: patch
Revision history for this message
Martin Pitt (pitti) wrote :

Committed to bzr, thanks Steve!

Changed in postgresql-common (Ubuntu):
importance: Undecided → Low
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package postgresql-common - 114

---------------
postgresql-common (114) unstable; urgency=low

  * debian/supported-versions: Add Ubuntu 11.04. Drop versions which are newer
    than the ones supported in the released versions, as backports are now
    generally accepted by our .config scripts, but having those newer versions
    confuses pg_buildext.
  * debian/postgresql-common.config: Silence warning from --compare-versions
    when being called through a trigger and $2 is not a version number.
    This works around the underlying dpkg problem. (Closes: #608522)
  * Add debian/postgresql-common.sysctl: sysctl.d/ template for changing
    kernel.shmmax and kernel.shmall, which is very common with PostgreSQL.
    Install it in debian/rules. Thanks to Peter Eisentraut for the suggestion!
    (Closes: #607946)
  * testsuite: Take new unified init script into account when stopping
    existing clusters. Thanks Steve Beattie! (LP: #712200)
  * pg_wrapper: If libreadline is installed, LD_PRELOAD this for "psql", to
    avoid using the rather broken libedit. We need to build the postgresql-X.Y
    packages against libedit for license reasons (#603599), but as libreadline
    has a drop-in compatible ABI, this works around the licensing
    restrictions. Thanks to Andreas Barth for working this out! Add a
    recommends to libreadline6. (Closes: #608442, #607907, #607109, #611918)
 -- Martin Pitt <email address hidden> Sun, 13 Feb 2011 22:28:33 +0100

Changed in postgresql-common (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.