Subject: | tests fail when run as user 'www-data' |
Date: | Sat, 6 Feb 2010 22:19:25 +0000 |
To: | bug-DBD-Pg <bug-DBD-Pg [...] rt.cpan.org> |
From: | Edmund von der Burg <evdb [...] ecclestoad.co.uk> |
tests fail when run as user 'www-data' which is annoying when trying
to build modules for the www-data user under debian.
t/01connect.t ....... 1/13
# Failed test 'Second database connection attempt worked'
# at t/01connect.t line 41.
# got: 'DBI
connect('dbname=postgres;port=5440;host=/var/www/.cpan/build/DBD-Pg-2.16.1-nwA4il/dbdpg_test_database/data/socket','www',...)
failed: FATAL: role "www" does not exist at t/dbdpg_test_setup.pl
line 154
# '
# expected: ''
Can't call method "selectall_arrayref" without a package or object
reference at t/01connect.t line 47.
#
# DBI Version 1.609
# DBD::Pg Version 2.16.1
# Perl Version 5.10.0
# OS linux
# PostgreSQL (compiled) 80309
# PostgreSQL (target) 80309
# PostgreSQL (reported) PostgreSQL 8.3.9 on i486-pc-linux-gnu,
compiled by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2
# Default port 5432
# DBI_DSN
dbi:Pg:dbname=postgres;port=5440;host=<pwd>/dbdpg_test_database/data/socket
# DBI_USER www-data
# Test schema dbd_pg_testschema
# LANG C
# Adjusted: initdb
# Error was: FATAL: role "www" does not exist at t/dbdpg_test_setup.pl line 154
I suppose that it is probably some regex that is stripping out the
'-data' part of the username.
Renaming the 'www-data' user to 'www' in /etc/passwd allows the tests
to run and pass which is a neat work-around.
Cheers,
Edmund.