1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

Remove pgbackrest test user.

This user was created before we tested in containers to ensure isolation between the pg and repo hosts which were then just directories.  The downside is that this resulted in a lot of sudos to set the pgbackrest user and to remove files which did not belong to the main test user.

Containers provide isolation without needing separate users so we can now safely remove the pgbackrest user.  This allows us to remove most sudos, except where they are explicitly needed in tests.

While we're at it, remove the code that installed the Perl C library (which also required sudo) and simply add the build path to @INC instead.
This commit is contained in:
David Steele
2019-10-12 09:45:18 -04:00
parent 6f0e7f00af
commit 11c7c8fabb
26 changed files with 190 additions and 303 deletions
-4
View File
@@ -85,10 +85,6 @@ Vagrant.configure(2) do |config|
# apt-get install -y --no-install-recommends texlive-latex-base texlive-latex-extra texlive-fonts-recommended # apt-get install -y --no-install-recommends texlive-latex-base texlive-latex-extra texlive-fonts-recommended
# apt-get install -y texlive-font-utils # apt-get install -y texlive-font-utils
#---------------------------------------------------------------------------------------------------------------------------
echo 'Create Postgres Group & pgBackRest User' && date
adduser --uid=5001 --ingroup=vagrant --disabled-password --gecos "" pgbackrest
#--------------------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------------------
echo 'Build VM Images' && date echo 'Build VM Images' && date
rm -rf /backrest/test/.vagrant/docker/* rm -rf /backrest/test/.vagrant/docker/*
+64 -64
View File
@@ -100,7 +100,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
[global] [global]
@@ -195,7 +195,7 @@ pg_data/special-!_.*'()&!@;:+,?={"master":true,"repo-size":[SIZE],"size":[SIZE],
group="[GROUP-1]" group="[GROUP-1]"
master=false master=false
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_hba.conf={"destination":"../pg_config/pg_hba.conf"} pg_data/pg_hba.conf={"destination":"../pg_config/pg_hba.conf"}
@@ -204,7 +204,7 @@ pg_data/postgresql.conf={"destination":"../pg_config/postgresql.conf"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -220,7 +220,7 @@ pg_data/pg_tblspc={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -291,7 +291,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
[global] [global]
@@ -393,7 +393,7 @@ pg_data/zero_from_start={"repo-size":[SIZE],"size":[SIZE],"timestamp":[TIMESTAMP
group="[GROUP-1]" group="[GROUP-1]"
master=true master=true
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_hba.conf={"destination":"../pg_config/pg_hba.conf"} pg_data/pg_hba.conf={"destination":"../pg_config/pg_hba.conf"}
@@ -402,7 +402,7 @@ pg_data/postgresql.conf={"destination":"../pg_config/postgresql.conf"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -418,7 +418,7 @@ pg_data/pg_tblspc={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -594,7 +594,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
[global] [global]
@@ -698,14 +698,14 @@ pg_tblspc/1/[TS_PATH-1]/16384/tablespace1.txt={"checksum":"14c44cef6287269b08d41
group="[GROUP-1]" group="[GROUP-1]"
master=true master=true
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/1={"destination":"[TEST_PATH]/db-master/db/tablespace/ts1"} pg_data/pg_tblspc/1={"destination":"[TEST_PATH]/db-master/db/tablespace/ts1"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -725,7 +725,7 @@ pg_tblspc/1/[TS_PATH-1]/16384={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -800,7 +800,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
[global] [global]
@@ -907,7 +907,7 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2.txt={"checksum":"dc7f76e43c46101b47acc
group="[GROUP-1]" group="[GROUP-1]"
master=true master=true
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/1={"destination":"[TEST_PATH]/db-master/db/tablespace/ts1"} pg_data/pg_tblspc/1={"destination":"[TEST_PATH]/db-master/db/tablespace/ts1"}
@@ -916,7 +916,7 @@ pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -941,7 +941,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -1016,7 +1016,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
[global] [global]
@@ -1122,7 +1122,7 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2.txt={"checksum":"dc7f76e43c46101b47acc
group="[GROUP-1]" group="[GROUP-1]"
master=true master=true
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/1={"destination":"[TEST_PATH]/db-master/db/tablespace/ts1"} pg_data/pg_tblspc/1={"destination":"[TEST_PATH]/db-master/db/tablespace/ts1"}
@@ -1130,7 +1130,7 @@ pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -1153,7 +1153,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -1228,7 +1228,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
[global] [global]
@@ -1334,7 +1334,7 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2.txt={"checksum":"dc7f76e43c46101b47acc
group="[GROUP-1]" group="[GROUP-1]"
master=true master=true
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/1={"destination":"[TEST_PATH]/db-master/db/tablespace/ts1"} pg_data/pg_tblspc/1={"destination":"[TEST_PATH]/db-master/db/tablespace/ts1"}
@@ -1342,7 +1342,7 @@ pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -1365,7 +1365,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -1464,7 +1464,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2 pg1-path=[TEST_PATH]/db-master/db/base-2
[global] [global]
@@ -1570,14 +1570,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2b.txt={"checksum":"e324463005236d83e6e5
group="[GROUP-1]" group="[GROUP-1]"
master=false master=false
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"} pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -1597,7 +1597,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -1673,7 +1673,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2 pg1-path=[TEST_PATH]/db-master/db/base-2
[global] [global]
@@ -1779,14 +1779,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2b.txt={"checksum":"e324463005236d83e6e5
group="[GROUP-1]" group="[GROUP-1]"
master=false master=false
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"} pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -1806,7 +1806,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -1886,7 +1886,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2 pg1-path=[TEST_PATH]/db-master/db/base-2
[global] [global]
@@ -1992,14 +1992,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2b.txt={"checksum":"e324463005236d83e6e5
group="[GROUP-1]" group="[GROUP-1]"
master=false master=false
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"} pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -2019,7 +2019,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -2097,7 +2097,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2 pg1-path=[TEST_PATH]/db-master/db/base-2
[global] [global]
@@ -2203,14 +2203,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2b.txt={"checksum":"e324463005236d83e6e5
group="[GROUP-1]" group="[GROUP-1]"
master=false master=false
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"} pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -2230,7 +2230,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -2312,7 +2312,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2 pg1-path=[TEST_PATH]/db-master/db/base-2
[global] [global]
@@ -2416,14 +2416,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2c.txt={"checksum":"dfcb8679956b734706cf
group="[GROUP-1]" group="[GROUP-1]"
master=true master=true
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"} pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -2443,7 +2443,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -2520,7 +2520,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2 pg1-path=[TEST_PATH]/db-master/db/base-2
[global] [global]
@@ -2624,14 +2624,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2c.txt={"checksum":"dfcb8679956b734706cf
group="[GROUP-1]" group="[GROUP-1]"
master=true master=true
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"} pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -2651,7 +2651,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -2733,7 +2733,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2 pg1-path=[TEST_PATH]/db-master/db/base-2
[global] [global]
@@ -2839,14 +2839,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2c.txt={"checksum":"dfcb8679956b734706cf
group="[GROUP-1]" group="[GROUP-1]"
master=false master=false
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"} pg_data/pg_tblspc/2={"destination":"[TEST_PATH]/db-master/db/tablespace/ts2-2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -2866,7 +2866,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -2937,7 +2937,7 @@ restore_command = '[BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf
diff backup - config file not validated on remote (backup host) diff backup - config file not validated on remote (backup host)
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --no-online --log-level-console=info --type=diff --stanza=db backup > [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --no-online --log-level-console=info --type=diff --stanza=db backup
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: backup command begin [BACKREST-VERSION]: --compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --exclude=postgresql.auto.conf --exclude=pg_log/ --exclude=pg_log2 --exclude=apipe --lock-path=[TEST_PATH]/backup/lock --log-level-console=info --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-2] --pg1-path=[TEST_PATH]/db-master/db/base-2/base --process-max=2 --protocol-timeout=60 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db --start-fast --type=diff P00 INFO: backup command begin [BACKREST-VERSION]: --compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --exclude=postgresql.auto.conf --exclude=pg_log/ --exclude=pg_log2 --exclude=apipe --lock-path=[TEST_PATH]/backup/lock --log-level-console=info --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-1] --pg1-path=[TEST_PATH]/db-master/db/base-2/base --process-max=2 --protocol-timeout=60 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db --start-fast --type=diff
P00 WARN: option repo1-retention-full is not set, the repository may run out of space P00 WARN: option repo1-retention-full is not set, the repository may run out of space
HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum. HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum.
P00 INFO: last backup label = [BACKUP-FULL-3], version = [VERSION-1] P00 INFO: last backup label = [BACKUP-FULL-3], version = [VERSION-1]
@@ -2946,7 +2946,7 @@ P00 INFO: diff backup size = 9B
P00 INFO: new backup label = [BACKUP-DIFF-6] P00 INFO: new backup label = [BACKUP-DIFF-6]
P00 INFO: http statistics:[HTTP-STATISTICS] P00 INFO: http statistics:[HTTP-STATISTICS]
P00 INFO: backup command end: completed successfully P00 INFO: backup command end: completed successfully
P00 INFO: expire command begin [BACKREST-VERSION]: --compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --exclude=postgresql.auto.conf --exclude=pg_log/ --exclude=pg_log2 --exclude=apipe --lock-path=[TEST_PATH]/backup/lock --log-level-console=info --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-2] --pg1-path=[TEST_PATH]/db-master/db/base-2/base --process-max=2 --protocol-timeout=60 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db --start-fast --type=diff P00 INFO: expire command begin [BACKREST-VERSION]: --compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --exclude=postgresql.auto.conf --exclude=pg_log/ --exclude=pg_log2 --exclude=apipe --lock-path=[TEST_PATH]/backup/lock --log-level-console=info --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-1] --pg1-path=[TEST_PATH]/db-master/db/base-2/base --process-max=2 --protocol-timeout=60 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db --start-fast --type=diff
P00 INFO: option 'repo1-retention-archive' is not set - archive logs will not be expired P00 INFO: option 'repo1-retention-archive' is not set - archive logs will not be expired
P00 INFO: http statistics:[HTTP-STATISTICS] P00 INFO: http statistics:[HTTP-STATISTICS]
P00 INFO: expire command end: completed successfully P00 INFO: expire command end: completed successfully
@@ -2985,7 +2985,7 @@ bogus=bogus
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2/base pg1-path=[TEST_PATH]/db-master/db/base-2/base
[global] [global]
@@ -3091,14 +3091,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2c.txt={"checksum":"dfcb8679956b734706cf
group="[GROUP-1]" group="[GROUP-1]"
master=false master=false
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"../../tablespace/ts2"} pg_data/pg_tblspc/2={"destination":"../../tablespace/ts2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -3118,7 +3118,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
@@ -3153,7 +3153,7 @@ backrest-checksum="[CHECKSUM]"
diff backup - option backup-standby reset - backup performed from master (backup host) diff backup - option backup-standby reset - backup performed from master (backup host)
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --no-online --log-level-console=info --backup-standby --type=diff --stanza=db backup > [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --no-online --log-level-console=info --backup-standby --type=diff --stanza=db backup
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: backup command begin [BACKREST-VERSION]: --backup-standby --compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --exclude=postgresql.auto.conf --exclude=pg_log/ --exclude=pg_log2 --exclude=apipe --lock-path=[TEST_PATH]/backup/lock --log-level-console=info --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-2] --pg1-path=[TEST_PATH]/db-master/db/base-2/base --process-max=2 --protocol-timeout=60 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db --start-fast --type=diff P00 INFO: backup command begin [BACKREST-VERSION]: --backup-standby --compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --exclude=postgresql.auto.conf --exclude=pg_log/ --exclude=pg_log2 --exclude=apipe --lock-path=[TEST_PATH]/backup/lock --log-level-console=info --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-1] --pg1-path=[TEST_PATH]/db-master/db/base-2/base --process-max=2 --protocol-timeout=60 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db --start-fast --type=diff
P00 WARN: option repo1-retention-full is not set, the repository may run out of space P00 WARN: option repo1-retention-full is not set, the repository may run out of space
HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum. HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum.
P00 WARN: option backup-standby is enabled but standby is not properly configured - backups will be performed from the master P00 WARN: option backup-standby is enabled but standby is not properly configured - backups will be performed from the master
@@ -3163,7 +3163,7 @@ P00 INFO: diff backup size = 9B
P00 INFO: new backup label = [BACKUP-DIFF-7] P00 INFO: new backup label = [BACKUP-DIFF-7]
P00 INFO: http statistics:[HTTP-STATISTICS] P00 INFO: http statistics:[HTTP-STATISTICS]
P00 INFO: backup command end: completed successfully P00 INFO: backup command end: completed successfully
P00 INFO: expire command begin [BACKREST-VERSION]: --backup-standby --compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --exclude=postgresql.auto.conf --exclude=pg_log/ --exclude=pg_log2 --exclude=apipe --lock-path=[TEST_PATH]/backup/lock --log-level-console=info --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-2] --pg1-path=[TEST_PATH]/db-master/db/base-2/base --process-max=2 --protocol-timeout=60 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db --start-fast --type=diff P00 INFO: expire command begin [BACKREST-VERSION]: --backup-standby --compress --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --exclude=postgresql.auto.conf --exclude=pg_log/ --exclude=pg_log2 --exclude=apipe --lock-path=[TEST_PATH]/backup/lock --log-level-console=info --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-1] --pg1-path=[TEST_PATH]/db-master/db/base-2/base --process-max=2 --protocol-timeout=60 --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db --start-fast --type=diff
P00 INFO: option 'repo1-retention-archive' is not set - archive logs will not be expired P00 INFO: option 'repo1-retention-archive' is not set - archive logs will not be expired
P00 INFO: http statistics:[HTTP-STATISTICS] P00 INFO: http statistics:[HTTP-STATISTICS]
P00 INFO: expire command end: completed successfully P00 INFO: expire command end: completed successfully
@@ -3201,7 +3201,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base-2/base pg1-path=[TEST_PATH]/db-master/db/base-2/base
[global] [global]
@@ -3307,14 +3307,14 @@ pg_tblspc/2/[TS_PATH-1]/32768/tablespace2c.txt={"checksum":"dfcb8679956b734706cf
group="[GROUP-1]" group="[GROUP-1]"
master=false master=false
mode="0600" mode="0600"
user="[USER-2]" user="[USER-1]"
[target:link] [target:link]
pg_data/pg_tblspc/2={"destination":"../../tablespace/ts2"} pg_data/pg_tblspc/2={"destination":"../../tablespace/ts2"}
[target:link:default] [target:link:default]
group="[GROUP-1]" group="[GROUP-1]"
user="[USER-2]" user="[USER-1]"
[target:path] [target:path]
pg_data={} pg_data={}
@@ -3334,7 +3334,7 @@ pg_tblspc/2/[TS_PATH-1]/32768={}
[target:path:default] [target:path:default]
group="[GROUP-1]" group="[GROUP-1]"
mode="0700" mode="0700"
user="[USER-2]" user="[USER-1]"
[backrest] [backrest]
backrest-checksum="[CHECKSUM]" backrest-checksum="[CHECKSUM]"
+1 -1
View File
@@ -28,7 +28,7 @@ P00 INFO: archive-get command end: aborted with exception [055]
stanza-create db - stanza create (backup host) stanza-create db - stanza create (backup host)
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --no-online stanza-create > [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --stanza=db --no-online stanza-create
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: stanza-create command begin [BACKREST-VERSION]: --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/backup/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-2] --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db P00 INFO: stanza-create command begin [BACKREST-VERSION]: --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/backup/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/backup/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/backup/log --log-subprocess --no-log-timestamp --no-online --pg1-host=db-master --pg1-host-cmd=[BACKREST-BIN] --pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf --pg1-host-user=[USER-1] --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-path=/ --repo1-s3-bucket=pgbackrest-dev --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-tls --repo1-type=s3 --stanza=db
P00 DETAIL: tls statistics:[TLS-STATISTICS] P00 DETAIL: tls statistics:[TLS-STATISTICS]
P00 INFO: http statistics:[HTTP-STATISTICS] P00 INFO: http statistics:[HTTP-STATISTICS]
P00 INFO: stanza-create command end: completed successfully P00 INFO: stanza-create command end: completed successfully
+5 -5
View File
@@ -231,13 +231,13 @@ backrest-checksum="[CHECKSUM]"
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-push [TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000001 > [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-push [TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: archive-push command begin [BACKREST-VERSION]: [[TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000001] --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/db-master/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/db-master/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/log --log-subprocess --no-log-timestamp --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-host=backup --repo1-host-cmd=[BACKREST-BIN] --repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf --repo1-host-user=[USER-2] --stanza=db P00 INFO: archive-push command begin [BACKREST-VERSION]: [[TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000001] --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/db-master/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/db-master/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/log --log-subprocess --no-log-timestamp --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-host=backup --repo1-host-cmd=[BACKREST-BIN] --repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf --repo1-host-user=[USER-1] --stanza=db
P00 INFO: pushed WAL file '000000010000000100000001' to the archive P00 INFO: pushed WAL file '000000010000000100000001' to the archive
P00 INFO: archive-push command end: completed successfully P00 INFO: archive-push command end: completed successfully
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-push [TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000002 > [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-push [TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000002
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: archive-push command begin [BACKREST-VERSION]: [[TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000002] --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/db-master/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/db-master/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/log --log-subprocess --no-log-timestamp --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-host=backup --repo1-host-cmd=[BACKREST-BIN] --repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf --repo1-host-user=[USER-2] --stanza=db P00 INFO: archive-push command begin [BACKREST-VERSION]: [[TEST_PATH]/db-master/db/base/pg_xlog/000000010000000100000002] --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/db-master/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/db-master/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/log --log-subprocess --no-log-timestamp --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-host=backup --repo1-host-cmd=[BACKREST-BIN] --repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf --repo1-host-user=[USER-1] --stanza=db
P00 INFO: pushed WAL file '000000010000000100000002' to the archive P00 INFO: pushed WAL file '000000010000000100000002' to the archive
P00 INFO: archive-push command end: completed successfully P00 INFO: archive-push command end: completed successfully
@@ -300,7 +300,7 @@ backrest-checksum="[CHECKSUM]"
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-get 000000010000000100000002 [TEST_PATH]/db-master/db/base/pg_xlog/RECOVERYXLOG > [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --stanza=db archive-get 000000010000000100000002 [TEST_PATH]/db-master/db/base/pg_xlog/RECOVERYXLOG
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: archive-get command begin [BACKREST-VERSION]: [000000010000000100000002, [TEST_PATH]/db-master/db/base/pg_xlog/RECOVERYXLOG] --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/db-master/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/db-master/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/log --log-subprocess --no-log-timestamp --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-host=backup --repo1-host-cmd=[BACKREST-BIN] --repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf --repo1-host-user=[USER-2] --stanza=db P00 INFO: archive-get command begin [BACKREST-VERSION]: [000000010000000100000002, [TEST_PATH]/db-master/db/base/pg_xlog/RECOVERYXLOG] --compress-level=3 --compress-level-network=1 --config=[TEST_PATH]/db-master/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/db-master/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/log --log-subprocess --no-log-timestamp --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-host=backup --repo1-host-cmd=[BACKREST-BIN] --repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf --repo1-host-user=[USER-1] --stanza=db
P00 INFO: found 000000010000000100000002 in the archive P00 INFO: found 000000010000000100000002 in the archive
P00 INFO: archive-get command end: completed successfully P00 INFO: archive-get command end: completed successfully
@@ -349,7 +349,7 @@ protocol-timeout=60
repo1-host=backup repo1-host=backup
repo1-host-cmd=[BACKREST-BIN] repo1-host-cmd=[BACKREST-BIN]
repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf
repo1-host-user=[USER-2] repo1-host-user=[USER-1]
spool-path=[TEST_PATH]/db-master/spool spool-path=[TEST_PATH]/db-master/spool
+ supplemental file: [TEST_PATH]/backup/pgbackrest.conf + supplemental file: [TEST_PATH]/backup/pgbackrest.conf
@@ -548,7 +548,7 @@ protocol-timeout=60
repo1-host=backup repo1-host=backup
repo1-host-cmd=[BACKREST-BIN] repo1-host-cmd=[BACKREST-BIN]
repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf repo1-host-config=[TEST_PATH]/backup/pgbackrest.conf
repo1-host-user=[USER-2] repo1-host-user=[USER-1]
spool-path=[TEST_PATH]/db-master/spool spool-path=[TEST_PATH]/db-master/spool
+ supplemental file: [TEST_PATH]/backup/pgbackrest.conf + supplemental file: [TEST_PATH]/backup/pgbackrest.conf
+3 -3
View File
@@ -128,7 +128,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
pg1-port=6543 pg1-port=6543
@@ -199,7 +199,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
pg1-port=6543 pg1-port=6543
@@ -287,7 +287,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
pg1-port=6543 pg1-port=6543
+9 -9
View File
@@ -67,18 +67,18 @@ spool-path=[TEST_PATH]/db-standby/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
pg1-port=6543 pg1-port=6543
pg2-host=bogus pg2-host=bogus
pg2-host-cmd=[BACKREST-BIN] pg2-host-cmd=[BACKREST-BIN]
pg2-host-config=[TEST_PATH]/db-standby/pgbackrest.conf pg2-host-config=[TEST_PATH]/db-standby/pgbackrest.conf
pg2-host-user=[USER-2] pg2-host-user=[USER-1]
pg2-path=[TEST_PATH]/db-standby/db/base pg2-path=[TEST_PATH]/db-standby/db/base
pg8-host=db-standby pg8-host=db-standby
pg8-host-cmd=[BACKREST-BIN] pg8-host-cmd=[BACKREST-BIN]
pg8-host-config=[TEST_PATH]/db-standby/pgbackrest.conf pg8-host-config=[TEST_PATH]/db-standby/pgbackrest.conf
pg8-host-user=[USER-2] pg8-host-user=[USER-1]
pg8-path=[TEST_PATH]/db-standby/db/base pg8-path=[TEST_PATH]/db-standby/db/base
pg8-port=6544 pg8-port=6544
@@ -180,18 +180,18 @@ spool-path=[TEST_PATH]/db-standby/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
pg1-port=6543 pg1-port=6543
pg2-host=bogus pg2-host=bogus
pg2-host-cmd=[BACKREST-BIN] pg2-host-cmd=[BACKREST-BIN]
pg2-host-config=[TEST_PATH]/db-standby/pgbackrest.conf pg2-host-config=[TEST_PATH]/db-standby/pgbackrest.conf
pg2-host-user=[USER-2] pg2-host-user=[USER-1]
pg2-path=[TEST_PATH]/db-standby/db/base pg2-path=[TEST_PATH]/db-standby/db/base
pg8-host=db-standby pg8-host=db-standby
pg8-host-cmd=[BACKREST-BIN] pg8-host-cmd=[BACKREST-BIN]
pg8-host-config=[TEST_PATH]/db-standby/pgbackrest.conf pg8-host-config=[TEST_PATH]/db-standby/pgbackrest.conf
pg8-host-user=[USER-2] pg8-host-user=[USER-1]
pg8-path=[TEST_PATH]/db-standby/db/base pg8-path=[TEST_PATH]/db-standby/db/base
pg8-port=6544 pg8-port=6544
@@ -283,18 +283,18 @@ spool-path=[TEST_PATH]/db-standby/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
pg1-port=6543 pg1-port=6543
pg2-host=bogus pg2-host=bogus
pg2-host-cmd=[BACKREST-BIN] pg2-host-cmd=[BACKREST-BIN]
pg2-host-config=[TEST_PATH]/db-standby/pgbackrest.conf pg2-host-config=[TEST_PATH]/db-standby/pgbackrest.conf
pg2-host-user=[USER-2] pg2-host-user=[USER-1]
pg2-path=[TEST_PATH]/db-standby/db/base pg2-path=[TEST_PATH]/db-standby/db/base
pg8-host=db-standby pg8-host=db-standby
pg8-host-cmd=[BACKREST-BIN] pg8-host-cmd=[BACKREST-BIN]
pg8-host-config=[TEST_PATH]/db-standby/pgbackrest.conf pg8-host-config=[TEST_PATH]/db-standby/pgbackrest.conf
pg8-host-user=[USER-2] pg8-host-user=[USER-1]
pg8-path=[TEST_PATH]/db-standby/db/base pg8-path=[TEST_PATH]/db-standby/db/base
pg8-port=6544 pg8-port=6544
+2 -2
View File
@@ -129,7 +129,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
pg1-port=6543 pg1-port=6543
@@ -195,7 +195,7 @@ spool-path=[TEST_PATH]/db-master/spool
pg1-host=db-master pg1-host=db-master
pg1-host-cmd=[BACKREST-BIN] pg1-host-cmd=[BACKREST-BIN]
pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf pg1-host-config=[TEST_PATH]/db-master/pgbackrest.conf
pg1-host-user=[USER-2] pg1-host-user=[USER-1]
pg1-path=[TEST_PATH]/db-master/db/base pg1-path=[TEST_PATH]/db-master/db/base
pg1-port=6543 pg1-port=6543
@@ -273,7 +273,6 @@ sub buildMakefile
('#' x 132) . "\n" . ('#' x 132) . "\n" .
buildMakefileObjectCompile($oStorage, {rhOption => $rhOption}); buildMakefileObjectCompile($oStorage, {rhOption => $rhOption});
# Return from function and log return values if any # Return from function and log return values if any
return logDebugReturn return logDebugReturn
( (
@@ -28,12 +28,6 @@ use pgBackRestTest::Common::VmTest;
#################################################################################################################################### ####################################################################################################################################
# User/group definitions # User/group definitions
#################################################################################################################################### ####################################################################################################################################
use constant POSTGRES_GROUP => 'postgres';
push @EXPORT, qw(POSTGRES_GROUP);
use constant POSTGRES_GROUP_ID => 5000;
use constant POSTGRES_USER => POSTGRES_GROUP;
use constant POSTGRES_USER_ID => 5000;
use constant TEST_USER => getpwuid($UID) . ''; use constant TEST_USER => getpwuid($UID) . '';
push @EXPORT, qw(TEST_USER); push @EXPORT, qw(TEST_USER);
use constant TEST_USER_ID => $UID; use constant TEST_USER_ID => $UID;
@@ -41,18 +35,6 @@ use constant TEST_GROUP => getgrgid(
push @EXPORT, qw(TEST_GROUP); push @EXPORT, qw(TEST_GROUP);
use constant TEST_GROUP_ID => getgrnam(TEST_GROUP) . ''; use constant TEST_GROUP_ID => getgrnam(TEST_GROUP) . '';
use constant BACKREST_USER => 'pgbackrest';
push @EXPORT, qw(BACKREST_USER);
use constant BACKREST_USER_ID => getpwnam(BACKREST_USER) ? getpwnam(BACKREST_USER) . '' : undef;
####################################################################################################################################
# Package constants
####################################################################################################################################
use constant LIB_COVER_VERSION => '1.29-2';
push @EXPORT, qw(LIB_COVER_VERSION);
use constant LIB_COVER_EXE => '/usr/bin/cover';
push @EXPORT, qw(LIB_COVER_EXE);
#################################################################################################################################### ####################################################################################################################################
# Cert file constants # Cert file constants
#################################################################################################################################### ####################################################################################################################################
@@ -74,18 +56,6 @@ use constant CONTAINER_DEBUG => false;
#################################################################################################################################### ####################################################################################################################################
my $hContainerCache; my $hContainerCache;
####################################################################################################################################
# Generate Devel::Cover package name
####################################################################################################################################
sub packageDevelCover
{
my $strArch = shift;
return 'libdevel-cover-perl_' . LIB_COVER_VERSION . "_${strArch}.deb";
}
push @EXPORT, qw(packageDevelCover);
#################################################################################################################################### ####################################################################################################################################
# Container repo - defines the Docker repository where the containers will be located # Container repo - defines the Docker repository where the containers will be located
#################################################################################################################################### ####################################################################################################################################
@@ -463,11 +433,6 @@ sub containerBuild
#--------------------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------------------
if (!$bDeprecated) if (!$bDeprecated)
{ {
$strScript .= sectionHeader() .
"# Create PostgreSQL user/group with known ids for testing\n" .
' ' . groupCreate($strOS, POSTGRES_GROUP, POSTGRES_GROUP_ID) . " && \\\n" .
' ' . userCreate($strOS, POSTGRES_USER, POSTGRES_USER_ID, POSTGRES_GROUP);
$strScript .= sectionHeader() . $strScript .= sectionHeader() .
"# Install PostgreSQL packages\n"; "# Install PostgreSQL packages\n";
@@ -567,8 +532,6 @@ sub containerBuild
$strImage = "${strOS}-build"; $strImage = "${strOS}-build";
$strCopy = undef; $strCopy = undef;
my $strPkgDevelCover = packageDevelCover($oVm->{$strOS}{&VM_ARCH});
$strScript = sectionHeader() . $strScript = sectionHeader() .
"# Create test user\n" . "# Create test user\n" .
' ' . groupCreate($strOS, TEST_GROUP, TEST_GROUP_ID) . " && \\\n" . ' ' . groupCreate($strOS, TEST_GROUP, TEST_GROUP_ID) . " && \\\n" .
@@ -643,13 +606,6 @@ sub containerBuild
$strScript .= $strScript .=
sshSetup($strOS, TEST_USER, TEST_GROUP, $$oVm{$strOS}{&VM_CONTROL_MASTER}); sshSetup($strOS, TEST_USER, TEST_GROUP, $$oVm{$strOS}{&VM_CONTROL_MASTER});
$strScript .= sectionHeader() .
"# Create pgbackrest user\n" .
' ' . userCreate($strOS, BACKREST_USER, BACKREST_USER_ID, TEST_GROUP);
$strScript .=
sshSetup($strOS, BACKREST_USER, TEST_GROUP, $$oVm{$strOS}{&VM_CONTROL_MASTER});
$strScript .= sectionHeader() . $strScript .= sectionHeader() .
"# Make " . TEST_USER . " home dir readable\n" . "# Make " . TEST_USER . " home dir readable\n" .
' chmod g+r,g+x /home/' . TEST_USER; ' chmod g+r,g+x /home/' . TEST_USER;
+5 -5
View File
@@ -84,7 +84,7 @@ sub testPathRemove
my $strPath = shift; my $strPath = shift;
my $bSuppressError = shift; my $bSuppressError = shift;
executeTest('sudo rm -rf ' . $strPath, {bSuppressError => $bSuppressError}); executeTest('rm -rf ' . $strPath, {bSuppressError => $bSuppressError});
} }
push(@EXPORT, qw(testPathRemove)); push(@EXPORT, qw(testPathRemove));
@@ -170,7 +170,7 @@ sub forceStorageMode
# Mode commands are ignored on S3 # Mode commands are ignored on S3
if ($oStorage->type() ne STORAGE_S3) if ($oStorage->type() ne STORAGE_S3)
{ {
executeTest('sudo chmod ' . ($bRecurse ? '-R ' : '') . "${strMode} " . $oStorage->pathGet($strPathExp)); executeTest('chmod ' . ($bRecurse ? '-R ' : '') . "${strMode} " . $oStorage->pathGet($strPathExp));
} }
# Return from function and log return values if any # Return from function and log return values if any
@@ -237,7 +237,7 @@ sub forceStorageMove
# Else remove using filesystem commands # Else remove using filesystem commands
else else
{ {
executeTest('sudo mv ' . $oStorage->pathGet($strSourcePathExp) . ' ' . $oStorage->pathGet($strDestinationPathExp)); executeTest('mv ' . $oStorage->pathGet($strSourcePathExp) . ' ' . $oStorage->pathGet($strDestinationPathExp));
} }
# Return from function and log return values if any # Return from function and log return values if any
@@ -272,7 +272,7 @@ sub forceStorageOwner
# Owner commands are ignored on S3 # Owner commands are ignored on S3
if ($oStorage->type() ne STORAGE_S3) if ($oStorage->type() ne STORAGE_S3)
{ {
executeTest('sudo chown ' . ($bRecurse ? '-R ' : '') . "${strOwner} " . $oStorage->pathGet($strPathExp)); executeTest('chown ' . ($bRecurse ? '-R ' : '') . "${strOwner} " . $oStorage->pathGet($strPathExp));
} }
# Return from function and log return values if any # Return from function and log return values if any
@@ -318,7 +318,7 @@ sub forceStorageRemove
} }
else else
{ {
executeTest('sudo rm -f' . ($bRecurse ? 'r ' : ' ') . $oStorage->pathGet($strPathExp)); executeTest('rm -f' . ($bRecurse ? 'r ' : ' ') . $oStorage->pathGet($strPathExp));
} }
# Return from function and log return values if any # Return from function and log return values if any
+5 -9
View File
@@ -57,6 +57,7 @@ sub new
$self->{strTestPath}, $self->{strTestPath},
$self->{oTest}, $self->{oTest},
$self->{bDryRun}, $self->{bDryRun},
$self->{strVmHost},
$self->{bVmOut}, $self->{bVmOut},
$self->{iVmIdx}, $self->{iVmIdx},
$self->{iVmMax}, $self->{iVmMax},
@@ -87,6 +88,7 @@ sub new
{name => 'strTestPath'}, {name => 'strTestPath'},
{name => 'oTest'}, {name => 'oTest'},
{name => 'bDryRun'}, {name => 'bDryRun'},
{name => 'strVmHost'},
{name => 'bVmOut'}, {name => 'bVmOut'},
{name => 'iVmIdx'}, {name => 'iVmIdx'},
{name => 'iVmMax'}, {name => 'iVmMax'},
@@ -232,9 +234,7 @@ sub run
# If testing Perl code (or C code that calls Perl code) install bin and Perl C Library # If testing Perl code (or C code that calls Perl code) install bin and Perl C Library
if ($self->{oTest}->{&TEST_VM} ne VM_NONE && (!$self->{oTest}->{&TEST_C} || $self->{oTest}->{&TEST_PERL_REQ})) if ($self->{oTest}->{&TEST_VM} ne VM_NONE && (!$self->{oTest}->{&TEST_C} || $self->{oTest}->{&TEST_PERL_REQ}))
{ {
jobInstallC( jobInstallC($self->{strBackRestBase}, $self->{oTest}->{&TEST_VM}, $strImage);
$self->{strBackRestBase}, $self->{oTest}->{&TEST_VM}, $strImage,
!$self->{oTest}->{&TEST_C} && !$self->{oTest}->{&TEST_INTEGRATION});
} }
} }
} }
@@ -269,6 +269,7 @@ sub run
($self->{oTest}->{&TEST_CONTAINER} ? 'docker exec -i -u ' . TEST_USER . " ${strImage} " : '') . ($self->{oTest}->{&TEST_CONTAINER} ? 'docker exec -i -u ' . TEST_USER . " ${strImage} " : '') .
abs_path($0) . abs_path($0) .
" --test-path=${strVmTestPath}" . " --test-path=${strVmTestPath}" .
" --vm-host=$self->{strVmHost}" .
" --vm=$self->{oTest}->{&TEST_VM}" . " --vm=$self->{oTest}->{&TEST_VM}" .
" --vm-id=$self->{iVmIdx}" . " --vm-id=$self->{iVmIdx}" .
" --module=" . $self->{oTest}->{&TEST_MODULE} . " --module=" . $self->{oTest}->{&TEST_MODULE} .
@@ -753,7 +754,7 @@ sub end
containerRemove("test-$self->{iVmIdx}"); containerRemove("test-$self->{iVmIdx}");
} }
executeTest(($self->{oTest}->{&TEST_VM} ne VM_NONE ? "sudo " : '') . "rm -rf ${strHostTestPath}"); executeTest("rm -rf ${strHostTestPath}");
} }
$bDone = true; $bDone = true;
@@ -776,20 +777,15 @@ sub jobInstallC
my $strBasePath = shift; my $strBasePath = shift;
my $strVm = shift; my $strVm = shift;
my $strImage = shift; my $strImage = shift;
my $bCopyLibC = shift;
# Install Perl C Library # Install Perl C Library
my $oVm = vmGet(); my $oVm = vmGet();
my $strBuildPath = "${strBasePath}/test/.vagrant/bin/${strVm}"; my $strBuildPath = "${strBasePath}/test/.vagrant/bin/${strVm}";
my $strBuildLibCPath = "${strBuildPath}/libc"; my $strBuildLibCPath = "${strBuildPath}/libc";
my $strBuildBinPath = "${strBuildPath}/src"; my $strBuildBinPath = "${strBuildPath}/src";
my $strPerlAutoPath = $oVm->{$strVm}{&VMDEF_PERL_ARCH_PATH} . '/auto/pgBackRest/LibC';
executeTest( executeTest(
"docker exec -i -u root ${strImage} bash -c '" . "docker exec -i -u root ${strImage} bash -c '" .
(defined($bCopyLibC) && $bCopyLibC ?
"mkdir -p -m 755 ${strPerlAutoPath} && " .
"cp ${strBuildLibCPath}/blib/arch/auto/pgBackRest/LibC/LibC.so ${strPerlAutoPath} && " : '') .
"cp ${strBuildBinPath}/" . PROJECT_EXE . ' /usr/bin/' . PROJECT_EXE . ' && ' . "cp ${strBuildBinPath}/" . PROJECT_EXE . ' /usr/bin/' . PROJECT_EXE . ' && ' .
'chmod 755 /usr/bin/' . PROJECT_EXE . "'"); 'chmod 755 /usr/bin/' . PROJECT_EXE . "'");
} }
@@ -38,8 +38,6 @@ use constant TEST_MODULE => 'module';
push @EXPORT, qw(TEST_MODULE); push @EXPORT, qw(TEST_MODULE);
use constant TEST_NAME => 'test'; use constant TEST_NAME => 'test';
push @EXPORT, qw(TEST_NAME); push @EXPORT, qw(TEST_NAME);
use constant TEST_PERL_ARCH_PATH => VMDEF_PERL_ARCH_PATH;
push @EXPORT, qw(TEST_PERL_ARCH_PATH);
use constant TEST_PERL_REQ => 'perl-req'; use constant TEST_PERL_REQ => 'perl-req';
push @EXPORT, qw(TEST_PERL_REQ); push @EXPORT, qw(TEST_PERL_REQ);
use constant TEST_PGSQL_BIN => 'pgsql-bin'; use constant TEST_PGSQL_BIN => 'pgsql-bin';
@@ -174,7 +172,6 @@ sub testListGet
&TEST_CONTAINER => defined($hTest->{&TESTDEF_CONTAINER}) ? &TEST_CONTAINER => defined($hTest->{&TESTDEF_CONTAINER}) ?
$hTest->{&TESTDEF_CONTAINER} : $hModule->{&TESTDEF_CONTAINER}, $hTest->{&TESTDEF_CONTAINER} : $hModule->{&TESTDEF_CONTAINER},
&TEST_PGSQL_BIN => $strPgSqlBin, &TEST_PGSQL_BIN => $strPgSqlBin,
&TEST_PERL_ARCH_PATH => $$oyVm{$strTestOS}{&VMDEF_PERL_ARCH_PATH},
&TEST_PERL_REQ => $hTest->{&TESTDEF_PERL_REQ}, &TEST_PERL_REQ => $hTest->{&TESTDEF_PERL_REQ},
&TEST_INTEGRATION => $hTest->{&TESTDEF_INTEGRATION}, &TEST_INTEGRATION => $hTest->{&TESTDEF_INTEGRATION},
&TEST_MODULE => $strModule, &TEST_MODULE => $strModule,
+1 -4
View File
@@ -90,7 +90,7 @@ sub cleanTest
{ {
my $self = shift; my $self = shift;
executeTest('sudo rm -rf ' . $self->testPath() . '/*'); executeTest('rm -rf ' . $self->testPath() . '/*');
} }
#################################################################################################################################### ####################################################################################################################################
@@ -126,7 +126,6 @@ sub process
$self->{bCleanup}, $self->{bCleanup},
$self->{bLogForce}, $self->{bLogForce},
$self->{strPgUser}, $self->{strPgUser},
$self->{strBackRestUser},
$self->{strGroup}, $self->{strGroup},
) = ) =
logDebugParam logDebugParam
@@ -148,7 +147,6 @@ sub process
{name => 'bCleanup'}, {name => 'bCleanup'},
{name => 'bLogForce'}, {name => 'bLogForce'},
{name => 'strPgUser'}, {name => 'strPgUser'},
{name => 'strBackRestUser'},
{name => 'strGroup'}, {name => 'strGroup'},
); );
@@ -544,7 +542,6 @@ push(@EXPORT, qw(storageTest));
#################################################################################################################################### ####################################################################################################################################
sub archBits {return vmArchBits(shift->{strVm})} sub archBits {return vmArchBits(shift->{strVm})}
sub backrestExe {return shift->{strBackRestExe}} sub backrestExe {return shift->{strBackRestExe}}
sub backrestUser {return shift->{strBackRestUser}}
sub basePath {return shift->{strBasePath}} sub basePath {return shift->{strBasePath}}
sub dataPath {return shift->basePath() . '/test/data'} sub dataPath {return shift->basePath() . '/test/data'}
sub doCleanup {return shift->{bCleanup}} sub doCleanup {return shift->{bCleanup}}
+3 -15
View File
@@ -43,8 +43,6 @@ use constant VM_OS_REPO => 'os-repo'
push @EXPORT, qw(VM_OS_REPO); push @EXPORT, qw(VM_OS_REPO);
use constant VMDEF_PGSQL_BIN => 'pgsql-bin'; use constant VMDEF_PGSQL_BIN => 'pgsql-bin';
push @EXPORT, qw(VMDEF_PGSQL_BIN); push @EXPORT, qw(VMDEF_PGSQL_BIN);
use constant VMDEF_PERL_ARCH_PATH => 'perl-arch-path';
push @EXPORT, qw(VMDEF_PERL_ARCH_PATH);
use constant VMDEF_WITH_BACKTRACE => 'with-backtrace'; use constant VMDEF_WITH_BACKTRACE => 'with-backtrace';
push @EXPORT, qw(VMDEF_WITH_BACKTRACE); push @EXPORT, qw(VMDEF_WITH_BACKTRACE);
@@ -129,12 +127,11 @@ my $oyVm =
# None # None
&VM_NONE => &VM_NONE =>
{ {
&VM_OS_BASE => VM_OS_BASE_RHEL, &VM_OS_BASE => VM_OS_BASE_DEBIAN,
&VM_OS => VM_OS_CENTOS, &VM_OS => VM_OS_UBUNTU,
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_COVERAGE_C => true, &VMDEF_COVERAGE_C => true,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib64/perl5',
&VM_DB => &VM_DB =>
[ [
@@ -155,7 +152,6 @@ my $oyVm =
&VM_IMAGE => 'centos:6', &VM_IMAGE => 'centos:6',
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib64/perl5',
&VM_DB => &VM_DB =>
[ [
@@ -185,7 +181,6 @@ my $oyVm =
&VM_IMAGE => 'centos:7', &VM_IMAGE => 'centos:7',
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib64/perl5',
&VMDEF_DEBUG_INTEGRATION => false, &VMDEF_DEBUG_INTEGRATION => false,
@@ -212,7 +207,6 @@ my $oyVm =
&VM_IMAGE => 'fedora:30', &VM_IMAGE => 'fedora:30',
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/pgsql-{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib64/perl5',
&VMDEF_DEBUG_INTEGRATION => false, &VMDEF_DEBUG_INTEGRATION => false,
@@ -241,7 +235,6 @@ my $oyVm =
&VM_IMAGE => 'debian:8', &VM_IMAGE => 'debian:8',
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/x86_64-linux-gnu/perl/5.20.2',
&VM_DB => &VM_DB =>
[ [
@@ -272,7 +265,6 @@ my $oyVm =
&VM_IMAGE => 'debian:9', &VM_IMAGE => 'debian:9',
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/i386-linux-gnu/perl/5.24.1',
&VM_DB_TEST => &VM_DB_TEST =>
[ [
@@ -300,7 +292,6 @@ my $oyVm =
&VM_IMAGE => 'i386/ubuntu:12.04', &VM_IMAGE => 'i386/ubuntu:12.04',
&VM_ARCH => VM_ARCH_I386, &VM_ARCH => VM_ARCH_I386,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/perl/5.14.2',
&VM_DB => &VM_DB =>
[ [
@@ -330,7 +321,6 @@ my $oyVm =
&VM_IMAGE => 'ubuntu:14.04', &VM_IMAGE => 'ubuntu:14.04',
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/perl/5.18.2',
&VM_DB => &VM_DB =>
[ [
@@ -361,7 +351,6 @@ my $oyVm =
&VM_IMAGE => 'ubuntu:16.04', &VM_IMAGE => 'ubuntu:16.04',
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/x86_64-linux-gnu/perl/5.22.1',
&VMDEF_WITH_BACKTRACE => true, &VMDEF_WITH_BACKTRACE => true,
@@ -394,7 +383,6 @@ my $oyVm =
&VM_ARCH => VM_ARCH_AMD64, &VM_ARCH => VM_ARCH_AMD64,
&VMDEF_COVERAGE_C => true, &VMDEF_COVERAGE_C => true,
&VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin', &VMDEF_PGSQL_BIN => '/usr/lib/postgresql/{[version]}/bin',
&VMDEF_PERL_ARCH_PATH => '/usr/local/lib/x86_64-linux-gnu/perl/5.26.1',
&VMDEF_WITH_BACKTRACE => true, &VMDEF_WITH_BACKTRACE => true,
+2 -2
View File
@@ -190,7 +190,7 @@ sub stanzaCreate
# Generate pg_control for stanza-create # Generate pg_control for stanza-create
$self->controlGenerate($strDbPath, $strDbVersion); $self->controlGenerate($strDbPath, $strDbVersion);
executeTest('sudo chmod 600 ' . $strDbPath . '/' . DB_FILE_PGCONTROL); executeTest('chmod 600 ' . $strDbPath . '/' . DB_FILE_PGCONTROL);
# Create the stanza repo paths if they don't exist # Create the stanza repo paths if they don't exist
if (!cfgOptionTest(CFGOPT_REPO_TYPE, CFGOPTVAL_REPO_TYPE_S3)) if (!cfgOptionTest(CFGOPT_REPO_TYPE, CFGOPTVAL_REPO_TYPE_S3))
@@ -237,7 +237,7 @@ sub stanzaUpgrade
# Copy pg_control for stanza-upgrade # Copy pg_control for stanza-upgrade
$self->controlGenerate(cfgOption(CFGOPT_PG_PATH), $strDbVersion); $self->controlGenerate(cfgOption(CFGOPT_PG_PATH), $strDbVersion);
executeTest('sudo chmod 600 ' . cfgOption(CFGOPT_PG_PATH) . '/' . DB_FILE_PGCONTROL); executeTest('chmod 600 ' . cfgOption(CFGOPT_PG_PATH) . '/' . DB_FILE_PGCONTROL);
$self->stanzaSet($strStanza, $strDbVersion, true); $self->stanzaSet($strStanza, $strDbVersion, true);
@@ -78,15 +78,15 @@ sub new
{ {
$strName = HOST_BACKUP; $strName = HOST_BACKUP;
$strImage = containerRepo() . ':' . testRunGet()->vm() . '-test'; $strImage = containerRepo() . ':' . testRunGet()->vm() . '-test';
$strUser = testRunGet()->backrestUser();
} }
else else
{ {
$strName = $$oParam{strName}; $strName = $$oParam{strName};
$strImage = $$oParam{strImage}; $strImage = $$oParam{strImage};
$strUser = testRunGet()->pgUser();
} }
$strUser = testRunGet()->pgUser();
# Create the host # Create the host
my $self = $class->SUPER::new($strName, {strImage => $strImage, strUser => $strUser}); my $self = $class->SUPER::new($strName, {strImage => $strImage, strUser => $strUser});
bless $self, $class; bless $self, $class;
@@ -1181,9 +1181,6 @@ sub configCreate
# Write out the configuration file # Write out the configuration file
storageTest()->put($self->backrestConfig(), iniRender(\%oParamHash, true)); storageTest()->put($self->backrestConfig(), iniRender(\%oParamHash, true));
# Modify the file permissions so it can be read/saved by all test users
executeTest('sudo chmod 660 ' . $self->backrestConfig());
} }
#################################################################################################################################### ####################################################################################################################################
@@ -1217,17 +1214,8 @@ sub configUpdate
} }
} }
# Modify the file permissions so it can be saved by all test users
executeTest(
'sudo chmod 660 ' . $self->backrestConfig() . ' && sudo chmod 770 ' . dirname($self->backrestConfig()));
storageTest()->put($self->backrestConfig(), iniRender($oConfig, true)); storageTest()->put($self->backrestConfig(), iniRender($oConfig, true));
# Fix permissions back to original
executeTest(
'sudo chmod 660 ' . $self->backrestConfig() . ' && sudo chmod 770 ' . dirname($self->backrestConfig()) .
' && sudo chown ' . $self->userGet() . ' ' . $self->backrestConfig());
# Return from function and log return values if any # Return from function and log return values if any
return logDebugReturn($strOperation); return logDebugReturn($strOperation);
} }
@@ -1368,23 +1356,9 @@ sub infoMunge
} }
} }
# Modify the file/directory permissions so it can be saved
if ($self->isFS())
{
executeTest("sudo rm -f ${strFileName}* && sudo chmod 770 " . dirname($strFileName));
}
# Save the munged data to the file # Save the munged data to the file
$oMungeIni->save(); $oMungeIni->save();
# Fix permissions
if ($self->isFS())
{
executeTest(
"sudo chmod 640 ${strFileName}* && sudo chmod 750 " . dirname($strFileName) .
' && sudo chown ' . $self->userGet() . " ${strFileName}*");
}
# Clear the cache is requested # Clear the cache is requested
if (!$bCache) if (!$bCache)
{ {
@@ -1424,23 +1398,9 @@ sub infoRestore
{ {
if ($bSave) if ($bSave)
{ {
# Modify the file/directory permissions so it can be saved
if ($self->isFS())
{
executeTest("sudo rm -f ${strFileName}* && sudo chmod 770 " . dirname($strFileName));
}
# Save the munged data to the file # Save the munged data to the file
$self->{hInfoFile}{$strFileName}->{bModified} = true; $self->{hInfoFile}{$strFileName}->{bModified} = true;
$self->{hInfoFile}{$strFileName}->save(); $self->{hInfoFile}{$strFileName}->save();
# Fix permissions
if ($self->isFS())
{
executeTest(
"sudo chmod 640 ${strFileName} && sudo chmod 750 " . dirname($strFileName) .
' && sudo chown ' . $self->userGet() . " ${strFileName}*");
}
} }
} }
else else
@@ -1553,16 +1513,7 @@ sub configRemap
# Save backup config file (but not if this is the standby which is not the source of backups) # Save backup config file (but not if this is the standby which is not the source of backups)
if (defined($oHostBackup)) if (defined($oHostBackup))
{ {
# Modify the file permissions so it can be read/saved by all test users
executeTest(
'sudo chmod 660 ' . $oHostBackup->backrestConfig() . ' && sudo chmod 770 ' . dirname($oHostBackup->backrestConfig()));
storageTest()->put($oHostBackup->backrestConfig(), iniRender($oRemoteConfig, true)); storageTest()->put($oHostBackup->backrestConfig(), iniRender($oRemoteConfig, true));
# Fix permissions
executeTest(
'sudo chmod 660 ' . $oHostBackup->backrestConfig() . ' && sudo chmod 770 ' . dirname($oHostBackup->backrestConfig()) .
' && sudo chown ' . $oHostBackup->userGet() . ' ' . $oHostBackup->backrestConfig());
} }
} }
@@ -112,7 +112,7 @@ sub run
"encryption incompatible for '$strArchiveFile'" . "encryption incompatible for '$strArchiveFile'" .
"\nHINT: is or was the repo encrypted?"); "\nHINT: is or was the repo encrypted?");
executeTest('sudo rm ' . $strArchiveFile); executeTest('rm ' . $strArchiveFile);
# Attempt to reconstruct from an encypted archived WAL with an encrypted repo # Attempt to reconstruct from an encypted archived WAL with an encrypted repo
#--------------------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------------------
@@ -209,7 +209,7 @@ sub run
"\nHINT: is or was the repo encrypted?"); "\nHINT: is or was the repo encrypted?");
# Remove the archive info files # Remove the archive info files
executeTest('sudo rm ' . $oArchiveInfo->{strFileName} . '*'); executeTest('rm ' . $oArchiveInfo->{strFileName} . '*');
# Create an encrypted storage and archive.info file # Create an encrypted storage and archive.info file
#--------------------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------------------
@@ -220,7 +220,7 @@ sub run
# Create encrypted files, change the passphrase and attempt to load - ensure flush error returned as parse error # Create encrypted files, change the passphrase and attempt to load - ensure flush error returned as parse error
#--------------------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------------------
# Remove the backup info files # Remove the backup info files
executeTest('sudo rm ' . $oBackupInfo->{strFileName} . '*'); executeTest('rm ' . $oBackupInfo->{strFileName} . '*');
# Clear the storage repo settings and change the passphrase # Clear the storage repo settings and change the passphrase
storageRepoCacheClear(); storageRepoCacheClear();
@@ -539,8 +539,7 @@ sub run
} }
else else
{ {
executeTest("sudo touch ${strTempFile}", {bRemote => $bRemote}); executeTest("touch ${strTempFile}", {bRemote => $bRemote});
executeTest("sudo chown " . BACKREST_USER . " ${strResumePath}/file.tmp");
} }
# Add zero-sized file # Add zero-sized file
@@ -214,13 +214,7 @@ sub run
substr($strSourceFile, 0, 16) . "/${strSourceFile}-${strArchiveChecksum}." . COMPRESS_EXT . qw{.} . substr($strSourceFile, 0, 16) . "/${strSourceFile}-${strArchiveChecksum}." . COMPRESS_EXT . qw{.} .
STORAGE_TEMP_EXT; STORAGE_TEMP_EXT;
executeTest('sudo chmod 770 ' . dirname($strArchiveTmp));
storageTest()->put($strArchiveTmp, 'JUNK'); storageTest()->put($strArchiveTmp, 'JUNK');
if ($bRemote)
{
executeTest('sudo chown ' . $oHostBackup->userGet() . " ${strArchiveTmp}");
}
} }
# Push the WAL # Push the WAL
+35 -19
View File
@@ -298,6 +298,41 @@ testAdd(int run, bool selected)
FUNCTION_HARNESS_RESULT_VOID(); FUNCTION_HARNESS_RESULT_VOID();
} }
/***********************************************************************************************************************************
Initialize harness
***********************************************************************************************************************************/
void
testInit(void)
{
FUNCTION_HARNESS_VOID();
// Set test user
const char *testUserTemp = getpwuid(getuid())->pw_name;
if (strlen(testUserTemp) > sizeof(testUserData) - 1)
{
fprintf(stderr, "ERROR: test user name must be less than %zu characters", sizeof(testUserData) - 1);
fflush(stderr);
exit(255);
}
strcpy(testUserData, testUserTemp);
// Set test group
const char *testGroupTemp = getgrgid(getgid())->gr_name;
if (strlen(testGroupTemp) > sizeof(testGroupData) - 1)
{
fprintf(stderr, "ERROR: test group name must be less than %zu characters", sizeof(testGroupData) - 1);
fflush(stderr);
exit(255);
}
strcpy(testGroupData, testGroupTemp);
FUNCTION_HARNESS_RESULT_VOID();
}
/*********************************************************************************************************************************** /***********************************************************************************************************************************
testBegin - should this test run? testBegin - should this test run?
***********************************************************************************************************************************/ ***********************************************************************************************************************************/
@@ -315,25 +350,6 @@ testBegin(const char *name)
if (testList[testRun - 1].selected) if (testList[testRun - 1].selected)
{ {
if (testFirst)
{
// Set test user
const char *testUserTemp = getpwuid(getuid())->pw_name;
if (strlen(testUserTemp) > sizeof(testUserData) - 1)
THROW_FMT(AssertError, "test user name must be less than %zu characters", sizeof(testUserData) - 1);
strcpy(testUserData, testUserTemp);
// Set test group
const char *testGroupTemp = getgrgid(getgid())->gr_name;
if (strlen(testGroupTemp) > sizeof(testGroupData) - 1)
THROW_FMT(AssertError, "test group name must be less than %zu characters", sizeof(testGroupData) - 1);
strcpy(testGroupData, testGroupTemp);
}
#ifndef NO_LOG #ifndef NO_LOG
if (!testFirst) if (!testFirst)
{ {
+3
View File
@@ -793,6 +793,7 @@ testRun(void)
strLstAddZ(argList, "--stanza=db"); strLstAddZ(argList, "--stanza=db");
strLstAddZ(argList, "--protocol-timeout=10"); strLstAddZ(argList, "--protocol-timeout=10");
strLstAddZ(argList, "--repo1-host=localhost"); strLstAddZ(argList, "--repo1-host=localhost");
strLstAdd(argList, strNewFmt("--repo1-host-user=%s", testUser()));
strLstAdd(argList, strNewFmt("--repo1-path=%s", testPath())); strLstAdd(argList, strNewFmt("--repo1-path=%s", testPath()));
harnessCfgLoad(cfgCmdInfo, argList); harnessCfgLoad(cfgCmdInfo, argList);
@@ -821,6 +822,7 @@ testRun(void)
strLstAddZ(argList, "--protocol-timeout=10"); strLstAddZ(argList, "--protocol-timeout=10");
strLstAdd(argList, strNewFmt("--config=%s/pgbackrest.conf", testPath())); strLstAdd(argList, strNewFmt("--config=%s/pgbackrest.conf", testPath()));
strLstAddZ(argList, "--repo1-host=localhost"); strLstAddZ(argList, "--repo1-host=localhost");
strLstAdd(argList, strNewFmt("--repo1-host-user=%s", testUser()));
strLstAdd(argList, strNewFmt("--repo1-path=%s", testPath())); strLstAdd(argList, strNewFmt("--repo1-path=%s", testPath()));
strLstAddZ(argList, "--process=999"); strLstAddZ(argList, "--process=999");
strLstAddZ(argList, "--command=archive-get"); strLstAddZ(argList, "--command=archive-get");
@@ -849,6 +851,7 @@ testRun(void)
strLstAddZ(argList, "--protocol-timeout=10"); strLstAddZ(argList, "--protocol-timeout=10");
strLstAdd(argList, strNewFmt("--repo1-host-config=%s/pgbackrest.conf", testPath())); strLstAdd(argList, strNewFmt("--repo1-host-config=%s/pgbackrest.conf", testPath()));
strLstAddZ(argList, "--repo1-host=localhost"); strLstAddZ(argList, "--repo1-host=localhost");
strLstAdd(argList, strNewFmt("--repo1-host-user=%s", testUser()));
strLstAdd(argList, strNewFmt("--repo1-path=%s", testPath())); strLstAdd(argList, strNewFmt("--repo1-path=%s", testPath()));
harnessCfgLoad(cfgCmdInfo, argList); harnessCfgLoad(cfgCmdInfo, argList);
+2 -5
View File
@@ -8,6 +8,7 @@ Test Remote Storage
#include "postgres/interface.h" #include "postgres/interface.h"
#include "common/harnessConfig.h" #include "common/harnessConfig.h"
#include "common/harnessTest.h"
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Test Run Test Run
@@ -27,6 +28,7 @@ testRun(void)
strLstAddZ(argList, "--protocol-timeout=10"); strLstAddZ(argList, "--protocol-timeout=10");
strLstAddZ(argList, "--buffer-size=16384"); strLstAddZ(argList, "--buffer-size=16384");
strLstAddZ(argList, "--repo1-host=localhost"); strLstAddZ(argList, "--repo1-host=localhost");
strLstAdd(argList, strNewFmt("--repo1-host-user=%s", testUser()));
strLstAdd(argList, strNewFmt("--repo1-path=%s/repo", testPath())); strLstAdd(argList, strNewFmt("--repo1-path=%s/repo", testPath()));
harnessCfgLoad(cfgCmdInfo, argList); harnessCfgLoad(cfgCmdInfo, argList);
@@ -281,7 +283,6 @@ testRun(void)
if (testBegin("storageNewWrite()")) if (testBegin("storageNewWrite()"))
{ {
storagePathCreateNP(storageTest, strNew("repo")); storagePathCreateNP(storageTest, strNew("repo"));
TEST_RESULT_INT(system(strPtr(strNewFmt("sudo chown pgbackrest %s/repo", testPath()))), 0, "update repo owner");
Storage *storageRemote = NULL; Storage *storageRemote = NULL;
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage"); TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
@@ -445,7 +446,6 @@ testRun(void)
{ {
String *path = strNew("testpath"); String *path = strNew("testpath");
storagePathCreateNP(storageTest, strNew("repo")); storagePathCreateNP(storageTest, strNew("repo"));
TEST_RESULT_INT(system(strPtr(strNewFmt("sudo chown pgbackrest %s/repo", testPath()))), 0, "update repo owner");
Storage *storageRemote = NULL; Storage *storageRemote = NULL;
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage"); TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
@@ -504,7 +504,6 @@ testRun(void)
{ {
String *path = strNew("testpath"); String *path = strNew("testpath");
storagePathCreateNP(storageTest, strNew("repo")); storagePathCreateNP(storageTest, strNew("repo"));
TEST_RESULT_INT(system(strPtr(strNewFmt("sudo chown pgbackrest %s/repo", testPath()))), 0, "update repo owner");
Storage *storageRemote = NULL; Storage *storageRemote = NULL;
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage"); TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
@@ -545,7 +544,6 @@ testRun(void)
if (testBegin("storageRemove()")) if (testBegin("storageRemove()"))
{ {
storagePathCreateNP(storageTest, strNew("repo")); storagePathCreateNP(storageTest, strNew("repo"));
TEST_RESULT_INT(system(strPtr(strNewFmt("sudo chown pgbackrest %s/repo", testPath()))), 0, "update repo owner");
Storage *storageRemote = NULL; Storage *storageRemote = NULL;
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage"); TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
@@ -594,7 +592,6 @@ testRun(void)
if (testBegin("storagePathSync()")) if (testBegin("storagePathSync()"))
{ {
storagePathCreateNP(storageTest, strNew("repo")); storagePathCreateNP(storageTest, strNew("repo"));
TEST_RESULT_INT(system(strPtr(strNewFmt("sudo chown pgbackrest %s/repo", testPath()))), 0, "update repo owner");
Storage *storageRemote = NULL; Storage *storageRemote = NULL;
TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage"); TEST_ASSIGN(storageRemote, storageRepoGet(strNew(STORAGE_TYPE_POSIX), true), "get remote repo storage");
+2
View File
@@ -30,6 +30,7 @@ The test code is included directly so it can freely interact with the included C
#include "common/harnessDebug.h" #include "common/harnessDebug.h"
#include "common/harnessTest.h" #include "common/harnessTest.h"
void testInit(void);
void testContainerSet(bool testContainer); void testContainerSet(bool testContainer);
void testDataPathSet(const char *testDataPath); void testDataPathSet(const char *testDataPath);
void testIdxSet(unsigned int testIdx); void testIdxSet(unsigned int testIdx);
@@ -83,6 +84,7 @@ main(int argListSize, const char *argList[])
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
// Set globals // Set globals
testInit();
testExeSet(argList[0]); testExeSet(argList[0]);
testProjectExeSet("{[C_TEST_PROJECT_EXE]}"); testProjectExeSet("{[C_TEST_PROJECT_EXE]}");
testContainerSet({[C_TEST_CONTAINER]}); testContainerSet({[C_TEST_CONTAINER]});
+32 -32
View File
@@ -722,9 +722,7 @@ eval
push(@{$oyProcess}, undef); push(@{$oyProcess}, undef);
} }
executeTest( executeTest("rm -rf ${strTestPath}/test-* ${strTestPath}/data-*" . ($bDev ? '' : " ${strTestPath}/gcov-*"));
($strVm ne VM_NONE ? 'sudo ' : '') . "rm -rf ${strTestPath}/test-* ${strTestPath}/data-*" .
($bDev ? '' : " ${strTestPath}/gcov-*"));
$oStorageTest->pathCreate($strTestPath, {strMode => '0770', bIgnoreExists => true, bCreateParent => true}); $oStorageTest->pathCreate($strTestPath, {strMode => '0770', bIgnoreExists => true, bCreateParent => true});
# Remove old coverage dirs -- do it this way so the dirs stay open in finder/explorer, etc. # Remove old coverage dirs -- do it this way so the dirs stay open in finder/explorer, etc.
@@ -913,11 +911,6 @@ eval
#----------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------
if ($bLibCHostRequired || $bLibCVmRequired) if ($bLibCHostRequired || $bLibCVmRequired)
{ {
if ($strVm eq VM_NONE)
{
confess &log(ASSERT, "c library build not yet supported for vm=none");
}
my $strLibCPath = "${strVagrantPath}/bin"; my $strLibCPath = "${strVagrantPath}/bin";
# Loop through VMs to do the C Library builds # Loop through VMs to do the C Library builds
@@ -936,7 +929,7 @@ eval
foreach my $strBuildVM (@stryBuildVm) foreach my $strBuildVM (@stryBuildVm)
{ {
my $strBuildPath = "${strLibCPath}/${strBuildVM}/libc"; my $strBuildPath = "${strLibCPath}/${strBuildVM}/libc";
my $bContainerExists = $strBuildVM ne $strVmHost; my $bContainerExists = $strBuildVM ne $strVmHost && $strBuildVM ne VM_NONE;
my $strConfigOptions = (vmDebugIntegration($strBuildVM) ? ' --enable-test' : ''); my $strConfigOptions = (vmDebugIntegration($strBuildVM) ? ' --enable-test' : '');
my $strLibCSmart = "${strBuildPath}/blib/arch/auto/pgBackRest/LibC/LibC.so"; my $strLibCSmart = "${strBuildPath}/blib/arch/auto/pgBackRest/LibC/LibC.so";
@@ -954,12 +947,6 @@ eval
} }
} }
# Delete old libc files from the host
if ($bRebuild)
{
executeTest('sudo rm -rf ' . $oVm->{$strBuildVM}{&VMDEF_PERL_ARCH_PATH} . '/auto/pgBackRest/LibC');
}
if ($bRebuild) if ($bRebuild)
{ {
&log(INFO, " build test library for ${strBuildVM} (${strBuildPath})"); &log(INFO, " build test library for ${strBuildVM} (${strBuildPath})");
@@ -1024,12 +1011,6 @@ eval
{ {
executeTest("docker rm -f test-build"); executeTest("docker rm -f test-build");
} }
if ($strBuildVM eq $strVmHost)
{
executeTest("sudo make -C ${strBuildPath} install", {bSuppressStdErr => true});
buildLoadLibC();
}
} }
} }
} }
@@ -1065,7 +1046,7 @@ eval
&log(INFO, 'package dependencies have changed, rebuilding...'); &log(INFO, 'package dependencies have changed, rebuilding...');
} }
executeTest("sudo rm -rf ${strPackagePath}"); executeTest("rm -rf ${strPackagePath}");
} }
# Loop through VMs to do the package builds # Loop through VMs to do the package builds
@@ -1080,16 +1061,19 @@ eval
{ {
&log(INFO, "build package for ${strBuildVM} (${strBuildPath})"); &log(INFO, "build package for ${strBuildVM} (${strBuildPath})");
if ($strVm ne VM_NONE)
{
executeTest( executeTest(
"docker run -itd -h test-build --name=test-build" . "docker run -itd -h test-build --name=test-build" .
" -v ${strBackRestBase}:${strBackRestBase} " . containerRepo() . ":${strBuildVM}-build", " -v ${strBackRestBase}:${strBackRestBase} " . containerRepo() . ":${strBuildVM}-build",
{bSuppressStdErr => true}); {bSuppressStdErr => true});
}
$oStorageBackRest->pathCreate($strBuildPath, {bIgnoreExists => true, bCreateParent => true}); $oStorageBackRest->pathCreate($strBuildPath, {bIgnoreExists => true, bCreateParent => true});
executeTest("rsync -r --exclude .vagrant --exclude .git ${strBackRestBase}/ ${strBuildPath}/"); executeTest("rsync -r --exclude .vagrant --exclude .git ${strBackRestBase}/ ${strBuildPath}/");
executeTest( executeTest(
"docker exec -i test-build " . ($strVm ne VM_NONE ? "docker exec -i test-build " : '') .
"bash -c 'cp -r /root/package-src/debian ${strBuildPath}' && sudo chown -R " . TEST_USER . "bash -c 'cp -r /root/package-src/debian ${strBuildPath}' && sudo chown -R " . TEST_USER .
" ${strBuildPath}"); " ${strBuildPath}");
@@ -1133,26 +1117,32 @@ eval
${$oStorageBackRest->get("${strBuildPath}/debian/changelog")}); ${$oStorageBackRest->get("${strBuildPath}/debian/changelog")});
executeTest( executeTest(
"docker exec -i test-build " . ($strVm ne VM_NONE ? "docker exec -i test-build " : '') .
"bash -c 'cd ${strBuildPath} && debuild -i -us -uc -b'"); "bash -c 'cd ${strBuildPath} && debuild -i -us -uc -b'");
executeTest( executeTest(
"docker exec -i test-build " . ($strVm ne VM_NONE ? "docker exec -i test-build " : '') .
"bash -c 'rm -f ${strPackagePath}/${strBuildVM}/*.build ${strPackagePath}/${strBuildVM}/*.changes" . "bash -c 'rm -f ${strPackagePath}/${strBuildVM}/*.build ${strPackagePath}/${strBuildVM}/*.changes" .
" ${strPackagePath}/${strBuildVM}/pgbackrest-doc*'"); " ${strPackagePath}/${strBuildVM}/pgbackrest-doc*'");
if ($strVm ne VM_NONE)
{
executeTest("docker rm -f test-build"); executeTest("docker rm -f test-build");
} }
}
if (!$oStorageBackRest->pathExists($strBuildPath) && $oVm->{$strBuildVM}{&VM_OS_BASE} eq VM_OS_BASE_RHEL) if (!$oStorageBackRest->pathExists($strBuildPath) && $oVm->{$strBuildVM}{&VM_OS_BASE} eq VM_OS_BASE_RHEL)
{ {
&log(INFO, "build package for ${strBuildVM} (${strBuildPath})"); &log(INFO, "build package for ${strBuildVM} (${strBuildPath})");
# Create build container # Create build container
if ($strVm ne VM_NONE)
{
executeTest( executeTest(
"docker run -itd -h test-build --name=test-build" . "docker run -itd -h test-build --name=test-build" .
" -v ${strBackRestBase}:${strBackRestBase} " . containerRepo() . ":${strBuildVM}-build", " -v ${strBackRestBase}:${strBackRestBase} " . containerRepo() . ":${strBuildVM}-build",
{bSuppressStdErr => true}); {bSuppressStdErr => true});
}
# Create build directories # Create build directories
$oStorageBackRest->pathCreate($strBuildPath, {bIgnoreExists => true, bCreateParent => true}); $oStorageBackRest->pathCreate($strBuildPath, {bIgnoreExists => true, bCreateParent => true});
@@ -1162,7 +1152,9 @@ eval
$oStorageBackRest->pathCreate("${strBuildPath}/BUILD", {bIgnoreExists => true, bCreateParent => true}); $oStorageBackRest->pathCreate("${strBuildPath}/BUILD", {bIgnoreExists => true, bCreateParent => true});
# Install PostreSQL 11 development for package builds # Install PostreSQL 11 development for package builds
executeTest("docker exec -i test-build bash -c 'yum install -y postgresql11-devel 2>&1'"); executeTest(
($strVm ne VM_NONE ? "docker exec -i test-build " : '') .
"bash -c 'yum install -y postgresql11-devel 2>&1'");
# Copy source files # Copy source files
executeTest( executeTest(
@@ -1172,7 +1164,7 @@ eval
# Copy package files # Copy package files
executeTest( executeTest(
"docker exec -i test-build bash -c '" . ($strVm ne VM_NONE ? "docker exec -i test-build " : '') . "bash -c '" .
"ln -s ${strBuildPath} /root/rpmbuild && " . "ln -s ${strBuildPath} /root/rpmbuild && " .
"cp /root/package-src/pgbackrest.spec ${strBuildPath}/SPECS && " . "cp /root/package-src/pgbackrest.spec ${strBuildPath}/SPECS && " .
"cp /root/package-src/*.patch ${strBuildPath}/SOURCES && " . "cp /root/package-src/*.patch ${strBuildPath}/SOURCES && " .
@@ -1200,14 +1192,17 @@ eval
# Build package # Build package
executeTest( executeTest(
"docker exec -i test-build rpmbuild --define 'pgmajorversion %{nil}' -v -bb --clean" . ($strVm ne VM_NONE ? "docker exec -i test-build " : '') .
" root/rpmbuild/SPECS/pgbackrest.spec", "rpmbuild --define 'pgmajorversion %{nil}' -v -bb --clean root/rpmbuild/SPECS/pgbackrest.spec",
{bSuppressStdErr => true}); {bSuppressStdErr => true});
# Remove build container # Remove build container
if ($strVm ne VM_NONE)
{
executeTest("docker rm -f test-build"); executeTest("docker rm -f test-build");
} }
} }
}
# Write files to indicate the last time a build was successful # Write files to indicate the last time a build was successful
if (!$bNoPackage) if (!$bNoPackage)
@@ -1311,7 +1306,7 @@ eval
if (!defined($$oyProcess[$iVmIdx]) && $iTestIdx < @{$oyTestRun}) if (!defined($$oyProcess[$iVmIdx]) && $iTestIdx < @{$oyTestRun})
{ {
my $oJob = new pgBackRestTest::Common::JobTest( my $oJob = new pgBackRestTest::Common::JobTest(
$oStorageTest, $strBackRestBase, $strTestPath, $$oyTestRun[$iTestIdx], $bDryRun, $bVmOut, $oStorageTest, $strBackRestBase, $strTestPath, $$oyTestRun[$iTestIdx], $bDryRun, $strVmHost, $bVmOut,
$iVmIdx, $iVmMax, $iTestIdx, $iTestMax, $strLogLevel, $strLogLevelTest, $bLogForce, $bShowOutputAsync, $iVmIdx, $iVmMax, $iTestIdx, $iTestMax, $strLogLevel, $strLogLevelTest, $bLogForce, $bShowOutputAsync,
$bNoCleanup, $iRetry, !$bNoValgrind, !$bNoCoverage, $bCoverageSummary, !$bNoOptimize, $bBackTrace, $bNoCleanup, $iRetry, !$bNoValgrind, !$bNoCoverage, $bCoverageSummary, !$bNoOptimize, $bBackTrace,
$bProfile, $iScale, !$bNoDebug, $bDebugTestTrace, $iBuildMax / $iVmMax < 1 ? 1 : int($iBuildMax / $iVmMax)); $bProfile, $iScale, !$bNoDebug, $bDebugTestTrace, $iBuildMax / $iVmMax < 1 ? 1 : int($iBuildMax / $iVmMax));
@@ -1494,6 +1489,11 @@ eval
################################################################################################################################ ################################################################################################################################
# Runs tests # Runs tests
################################################################################################################################ ################################################################################################################################
push(
@INC,
"${strBackRestBase}/test/.vagrant/bin/" .
((testDefModuleTest($stryModule[0], $stryModuleTest[0]))->{&TESTDEF_CONTAINER} ? $strVm : $strVmHost) .
"/libc/blib/arch");
buildLoadLibC(); buildLoadLibC();
my $iRun = 0; my $iRun = 0;
@@ -1512,13 +1512,13 @@ eval
$strPgVersion ne 'minimal' ? $strPgVersion: undef, # Pg version $strPgVersion ne 'minimal' ? $strPgVersion: undef, # Pg version
$stryModule[0], $stryModuleTest[0], \@iyModuleTestRun, # Module info $stryModule[0], $stryModuleTest[0], \@iyModuleTestRun, # Module info
$bVmOut, $bDryRun, $bNoCleanup, $bLogForce, # Test options $bVmOut, $bDryRun, $bNoCleanup, $bLogForce, # Test options
TEST_USER, BACKREST_USER, TEST_GROUP); # User/group info TEST_USER, TEST_GROUP); # User/group info
if (!$bNoCleanup) if (!$bNoCleanup)
{ {
if ($oHostGroup->removeAll() > 0) if ($oHostGroup->removeAll() > 0)
{ {
executeTest("sudo rm -rf ${strTestPath}"); executeTest("rm -rf ${strTestPath}");
} }
} }
-4
View File
@@ -194,10 +194,6 @@ eval
# Else run tests that require a container # Else run tests that require a container
else else
{ {
processBegin("create backrest user");
processExec("sudo adduser --ingroup=\${USER?} --uid=5001 --disabled-password --gecos \"\" " . BACKREST_USER);
processEnd();
# Build the container # Build the container
processBegin("${strVm} build"); processBegin("${strVm} build");
processExec("${strTestExe} --vm-build --vm=${strVm}", {bShowOutputAsync => true, bOutLogOnError => false}); processExec("${strTestExe} --vm-build --vm=${strVm}", {bShowOutputAsync => true, bOutLogOnError => false});