On Wed, 2014-04-30 at 18:09 +0200, Andres Freund wrote:
> On 2014-04-04 16:44:46 +0200, Andres Freund wrote:
> > On 2014-02-27 21:44:48 -0500, Peter Eisentraut wrote:
> > > +open HBA, ">>$tempdir/pgdata/pg_hba.conf";
> > > +print HBA "local replication all trust\n";
> > > +print HBA "host replication all 127.0.0.1/32 trust\n";
> > > +print HBA "host replication all ::1/128 trust\n";
> > > +close HBA;
> >
> > Given the recent make check security discussions, this doesn't seem like
> > a good idea...

The socket file for the test server instance is in a private directory,
so that should be safe enough.

> >
> > > +issues_sql_like(['createdb', 'foobar1'], qr/statement: CREATE DATABASE 
> > > foobar1/, 'SQL CREATE DATABASE run');
> > > +issues_sql_like(['createdb', 'foobar2', '-l', 'C', '-E', 'LATIN1', '-T', 
> > > 'template0'], qr/statement: CREATE DATABASE foobar2 ENCODING 'LATIN1'/, 
> > > 'create database with encoding');
> >
> > Hm. Are all platforms guaranteed to provide latin1?

Yes.

> > > diff --git a/src/test/perl/TestLib.pm b/src/test/perl/TestLib.pm
> > > +if (!$ENV{PGPORT}) {
> > > + $ENV{PGPORT} = 65432;
> > > +}
> > > +
> > > +$ENV{PGPORT} = int($ENV{PGPORT}) % 65536;
> >
> > Hm. I think this should use logical similar to what pg_regress is using,
> > namely test a few ports.

That could be improved in the future.


> > > +sub start_test_server {
> > > + my ($tempdir) = @_;
> > > + my $ret;
> > > +
> > > + system "initdb -D $tempdir/pgdata -A trust -N >/dev/null";
> > > + $ret = system 'pg_ctl', '-D', "$tempdir/pgdata", '-s', '-w', '-l', 
> > > "$tempdir/logfile", '-o', "--fsync=off -k $tempdir --listen-addresses='' 
> > > --log-statement=all", 'start';
> > > +
> > > + if ($ret != 0) {
> > > +         system('cat', "$tempdir/logfile");
> > > +         BAIL_OUT("pg_ctl failed");
> > > + }
> > > +
> > > + $ENV{PGHOST} = $tempdir;
> > > + $test_server_datadir = "$tempdir/pgdata";
> > > + $test_server_logfile = "$tempdir/logfile";
> > > +}
> >
> > Should stuff like --fsync-off, -k, really be on by default?

-k is to set the socket directory.  You might be thinking of initdb -k?


> > I think the code to massage pg_hba.conf should also be here, there'll be
> > a fair number of tests that need it.

More refactoring is always possible as needs arise.




-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to