Re: tests for client programs

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: tests for client programs
Дата
Msg-id 20140430160915.GF30324@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: tests for client programs  (Andres Freund <andres@2ndquadrant.com>)
Ответы Re: tests for client programs  (Andres Freund <andres@2ndquadrant.com>)
Re: tests for client programs  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
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...
>
> > +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
DATABASEfoobar2 ENCODING 'LATIN1'/, 'create database with encoding');
 
>
> Hm. Are all platforms guaranteed to provide latin1?
>
> > 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.
>
> > +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?
>
> I think the code to massage pg_hba.conf should also be here, there'll be
> a fair number of tests that need it.

The issues here don't seem to have been addressed in the commit. At
least the latin1 thing should be fixed. 

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Fix initdb for path with whitespace and at char
Следующее
От: Andres Freund
Дата:
Сообщение: Re: tests for client programs