This Vagrantfile
is bootstrapping 3 possible test cases:
icinga-srv
executes check_pgbackrest by ssh with Icinga 2;pgsql-srv
hosting a pgsql cluster with pgBackRest installed;backup-srv
hosting the CIFS share.
Backups and archiving are done locally on pgsql-srv
on the CIFS mount point.
icinga-srv
executes check_pgbackrest by ssh with Icinga 2;pgsql-srv
hosting a pgsql cluster with pgBackRest installed;backup-srv
hosting the pgBackRest backups and archives.
Backups of pgsql-srv
are taken from backup-srv
.
Archives are pushed from pgsql-srv
to backup-srv
.
Checks (retention and archives) are done both locally (on backup-srv
) and
remotely (on pgsql-srv
). Checks are performed from icinga-srv
by ssh.
pgBackRest backups are use to build a Streaming Replication with backup-srv
as standby server.
icinga-srv
executes check_pgbackrest by ssh with Icinga 2;pgsql-srv
hosting a pgsql cluster with pgBackRest installed;backup-srv
hosting the MinIO server.
The easiest way to start testing is with the included Makefile
.
Build:
cd test
make s1
Expected make time: 7 min.
Check the results of a manual execution of check_pgbackrest:
vagrant ssh pgsql-srv -c "sudo /check_pgbackrest/test/regress/test-s1.bash"
Expected run time: 30 sec.
To simulate some activity with pgBackRest:
vagrant ssh pgsql-srv -c "sudo /check_pgbackrest/test/regress/simulate-activity-local.bash"
Modify SCALE
factor or ACTIVITY_TIME
in this script to simulate more activity.
Build:
cd test
make s2
Expected make time: 6 min.
Check the results of a manual execution of check_pgbackrest:
vagrant ssh pgsql-srv -c "sudo /check_pgbackrest/test/regress/test-s2-from-primary.bash"
Expected run time: 50 sec.
Build:
cd test
make s3
Expected make time: 8 min. (depends on MinIO download time)
Check the results of a manual execution of check_pgbackrest:
vagrant ssh pgsql-srv -c "sudo /check_pgbackrest/test/regress/test-s3.bash"
Expected run time: 40 sec.
To simulate some activity with pgBackRest:
vagrant ssh pgsql-srv -c "sudo /check_pgbackrest/test/regress/simulate-activity-local.bash"
Modify SCALE
factor or ACTIVITY_TIME
in this script to simulate more activity.
_Check the results of check_pgbackrest launched by Icinga 2:
vagrant ssh icinga-srv -c "sudo icingacli monitoring list services --service=pgbackrest* --verbose"
Navigate to Icinga Web 2:
Get the IP address of icinga-srv
with:
vagrant ssh icinga-srv -c "ip addr show eth0"
And then go to http://IP/icingaweb2
. Credentials are icingaweb / icingaweb
.
Don't forget to clean the VM's after the tests:
make clean
Edit the test-*.bash
scripts and set GENERATE_EXPECTED
to true. Run it.
Currently, expected tests results are the same for test cases 1 and 2.
To perform tests using the latest GitHub version, execute the following script on each server where pgBackRest is installed :
vagrant ssh pgsql-srv -c "sudo /check_pgbackrest/test/regress/pgbackrest_build.bash"
Find all existing VM created by vagrant on your system:
vagrant global-status
Shutdown all VM:
vagrant halt
Restart the halted cluster:
vagrant up