Server IP : 85.214.239.14 / Your IP : 3.15.211.55 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/3/root/proc/2/task/2/root/proc/2/root/usr/share/postgresql-common/t/ |
Upload File : |
# Check that all extensions install successfully. use strict; use lib 't'; use TestLib; use PgCommon; use Test::More 0.87; # needs libtest-simple-perl backport on lenny foreach my $v (@MAJORS) { note "Running tests for $v"; if ($v < '9.1') { pass 'No extensions for version < 9.1'; next; } # create cluster is ((system "pg_createcluster $v main --start >/dev/null"), 0, "pg_createcluster $v main"); # plpgsql is installed by default is_program_out 'postgres', "psql -Atc 'SELECT extname FROM pg_extension'", 0, "plpgsql\n"; my %depends = ( bool_plperl => [qw(plperl)], bool_plperlu => [qw(plperlu)], earthdistance => [qw(cube)], hstore_plperl => [qw(hstore plperl)], hstore_plperlu => [qw(hstore plperlu)], hstore_plpython2u => [qw(hstore plpython2u)], hstore_plpython3u => [qw(hstore plpython3u)], hstore_plpythonu => [qw(hstore plpythonu)], jsonb_plperl => [qw(plperl)], # PG 11 jsonb_plperlu => [qw(plperlu)], # PG 11 jsonb_plpython2u => [qw(plpython2u)], # PG 11 jsonb_plpython3u => [qw(plpython3u)], # PG 11 jsonb_plpythonu => [qw(plpythonu)], # PG 11 ltree_plpython2u => [qw(ltree plpython2u)], ltree_plpython3u => [qw(ltree plpython3u)], ltree_plpythonu => [qw(ltree plpythonu)], ); foreach (</usr/share/postgresql/$v/extension/*.control>) { my ($extname) = $_ =~ /^.*\/(.*)\.control$/; next if ($extname eq 'plpgsql'); if ($depends{$extname}) { for my $dep (@{$depends{$extname}}) { is_program_out 'postgres', "psql -qc 'CREATE EXTENSION $dep'", 0, '', "$extname dependency $dep installs without error"; } } if ($extname eq 'hstore' && $v eq '9.1') { # EXFAIL: hstore in 9.1 throws a warning about obsolete => operator like_program_out 'postgres', "psql -qc 'CREATE EXTENSION \"$extname\"'", 0, qr/=>/, "extension $extname installs (with warning)"; } elsif ($extname eq 'chkpass' && $v >= '9.5') { # chkpass is slightly broken, see # http://www.postgresql.org/message-id/20141117162116.GA3565@msg.df7cb.de like_program_out 'postgres', "psql -qc 'CREATE EXTENSION \"$extname\"'", 0, qr/WARNING: type input function chkpass_in should not be volatile/, "extension $extname installs (with warning)"; } else { is_program_out 'postgres', "psql -qc 'CREATE EXTENSION \"$extname\"'", 0, '', "extension $extname installs without error"; } is_program_out 'postgres', "psql -qc 'DROP EXTENSION \"$extname\"'", 0, '', "extension $extname removes without error"; if ($depends{$extname}) { for my $dep (@{$depends{$extname}}) { is_program_out 'postgres', "psql -qc 'DROP EXTENSION $dep'", 0, '', "$extname dependency extension $dep removes without error"; } } } # clean up is ((system "pg_dropcluster $v main --stop"), 0, "pg_dropcluster $v main"); check_clean; } done_testing(); # vim: filetype=perl