diff --git a/README.md b/README.md index d2abe6f..4dccb44 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ A `Vagrantfile` has been included in the test directory which gives the exact st ``` /pgaudit_analyze/test/test.pl ``` -Regression tests will be run on PostgreSQL 9.6 by default. Specify `--pgsql-bin=/usr/pgsql-9.5/bin` to run tests on PostgreSQL 9.5. +Regression tests will be run on PostgreSQL 10 by default. Specify `--pgsql-bin=/usr/pgsql-9.6/bin` to run tests on PostgreSQL 9.6 and use the same pattern for 9.5 testing. ## Caveats diff --git a/test/Vagrantfile b/test/Vagrantfile index cde2aa0..6ac1eb2 100644 --- a/test/Vagrantfile +++ b/test/Vagrantfile @@ -2,18 +2,23 @@ Vagrant.configure(2) do |config| config.vm.box = "bento/centos-7.3" config.vm.provider :virtualbox do |vb| - vb.name = "pgaudit-centos7-test" + vb.name = "pgaudit-analyze-centos7-test" end # Provision the VM config.vm.provision "shell", inline: <<-SHELL # Install PostgreSQL rpm -ivh http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-3.noarch.rpm + yum install -y postgresql95-server postgresql95-devel + rpm -ivh http://yum.postgresql.org/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm - yum install -y postgresql95-server postgresql96-server + yum install -y postgresql96-server postgresql96-devel + + rpm -ivh https://yum.postgresql.org/testing/10/redhat/rhel-7-x86_64/pgdg-centos10-10-1.noarch.rpm + yum install -y postgresql10-server postgresql10-devel # Compile & install pgaudit - yum install -y postgresql95-devel postgresql96-devel gcc openssl-devel git + yum install -y gcc openssl-devel git git clone https://github.com/pgaudit/pgaudit.git -b REL9_5_STABLE pgaudit-9.5 bash -c 'export PATH="$PATH:/usr/pgsql-9.5/bin" && make -C pgaudit-9.5 install USE_PGXS=1' @@ -21,6 +26,9 @@ Vagrant.configure(2) do |config| git clone https://github.com/pgaudit/pgaudit.git -b REL9_6_STABLE pgaudit-9.6 bash -c 'export PATH="$PATH:/usr/pgsql-9.6/bin" && make -C pgaudit-9.6 install USE_PGXS=1' + git clone https://github.com/pgaudit/pgaudit.git -b dev-pg10 pgaudit-10 + bash -c 'export PATH="$PATH:/usr/pgsql-10/bin" && make -C pgaudit-10 install USE_PGXS=1' + # Install EPEL yum install -y epel-release diff --git a/test/test.pl b/test/test.pl index 958dfb6..9d96f84 100755 --- a/test/test.pl +++ b/test/test.pl @@ -59,8 +59,9 @@ =head1 SYNOPSIS #################################################################################################################################### # Command line parameters #################################################################################################################################### -my $strPgSqlBin = '/usr/pgsql-9.6/bin'; # Path of PG binaries to use for this test +my $strPgSqlBin = '/usr/pgsql-10/bin'; # Path of PG binaries to use for this test my $strTestPath = 'test'; # Path where testing will occur +my $strPgLogPath = 'log'; # Path where pg logs will be stored my $strUser = getpwuid($>); # PG user name my $strHost = '/tmp'; # PG default host my $strDatabase = 'postgres'; # PG database @@ -386,6 +387,7 @@ sub pgStart " -c log_error_verbosity=verbose" . " -c log_connections=on" . " -c log_destination=csvlog" . + " -c log_directory=${strPgLogPath}" . ($bNotice ? " -c pgaudit.log_level=notice" : '') . " -c pgaudit.role=auditor" . " -c logging_collector=on" . @@ -429,7 +431,7 @@ sub pgPsql # Start pgaudit_analyze my $pId = IPC::Open3::open3(undef, undef, undef, "${strBasePath}/bin/pgaudit_analyze --port=${iPort} --socket-path=/tmp" . - " --log-file=${strTestPath}/pgaudit_analyze.log ${strTestPath}/pg_log"); + " --log-file=${strTestPath}/pgaudit_analyze.log ${strTestPath}/${strPgLogPath}"); use constant LOCALHOST => '127.0.0.1'; @@ -727,7 +729,7 @@ sub pgPsql &log("\nTEST: Verify 'unable to open pgAudit Analyze log file'\n"); eval { - capture("${strBasePath}/bin/pgaudit_analyze --log-file=/var/log/pgaudit_analyze.log ${strTestPath}/pg_log"); + capture("${strBasePath}/bin/pgaudit_analyze --log-file=/var/log/pgaudit_analyze.log ${strTestPath}/${strPgLogPath}"); }; if ($@) {