Skip to content
Snippets Groups Projects
Commit fd3c452e authored by Christoph Berg's avatar Christoph Berg :satellite:
Browse files

t/135_pg_virtualenv.t: Import test from master.

parent 52b6336e
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,9 @@ postgresql-common (200+deb10u5) buster; urgency=medium
* pg_virtualenv: Write temporary password file before chowning the file.
(Closes: #933569)
* t/135_pg_virtualenv.t: Import test from master.
-- Christoph Berg <myon@debian.org> Fri, 14 Aug 2020 14:54:15 +0200
-- Christoph Berg <myon@debian.org> Wed, 22 Jun 2022 13:11:44 +0200
postgresql-common (200+deb10u4) buster; urgency=medium
......
# check if pg_virtualenv runs ok, even under fakeroot
use strict;
use warnings;
use lib 't';
use TestLib;
use Test::More tests => 12 * @MAJORS + 8;
foreach my $v (@MAJORS) {
my $args = 'sh -c \'echo "id|$(id -un)"; psql -AtXxc "SELECT current_user"\'';
my $virtualenv = "pg_virtualenv -v $v $args";
$ENV{USER} = 'root';
like_program_out 'root', $virtualenv, 0, qr!id.root\ncurrent_user.postgres!, "running pg_virtualenv as root";
$ENV{USER} = 'postgres';
like_program_out 'postgres', $virtualenv, 0, qr!id.postgres\ncurrent_user.postgres!, "running pg_virtualenv as postgres";
$ENV{USER} = 'nobody';
like_program_out 'nobody', $virtualenv, 0, qr!id.nobody\ncurrent_user.nobody!, "running pg_virtualenv as nobody";
SKIP: {
skip "/usr/bin/fakeroot not available", 6 unless (-x "/usr/bin/fakeroot"); # CentOS doesn't have fakeroot
$ENV{USER} = 'root';
like_program_out 'root', "fakeroot $virtualenv", 0, qr!id.root\ncurrent_user.postgres!, "running fakeroot pg_virtualenv as root";
$ENV{USER} = 'postgres';
like_program_out 'postgres', "fakeroot $virtualenv", 0, qr!id.root\ncurrent_user.postgres!, "running fakeroot pg_virtualenv as postgres";
$ENV{USER} = 'nobody';
like_program_out 'nobody', "fakeroot $virtualenv", 0, qr!id.root\ncurrent_user.nobody!, "running fakeroot pg_virtualenv as nobody";
}
}
check_clean;
# vim: filetype=perl
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment