Export INTEGRATION_CONFIG_PATH to be path to integration-config.json file you just created.
Export BBR_BINARY_PATH to the path to the BBR binary.
Run acceptance tests
$ ./scripts/_run_acceptance_tests.sh
Integration Config Variables
bosh_host - the BOSH director hostname
bosh_ssh_username - the BOSH director VM SSH username
bosh_ssh_private_key - the BOSH director VM SSH private key
bosh_client - the BOSH director API client
bosh_client_secret - the BOSH director API client secret
bosh_ca_cert - the BOSH director API CA certificate
credhub_client - the UAA client that is used to authenticate with CredHub
credhub_client_secret - the UAA secret that is used to authenticate with CredHub
credhub_ca_cert - the mTLS certificate that is used to communicate with CredHub
timeout_in_minutes - default ginkgo Eventually timeout in minutes, defaults to 30
stemcell_src - absolute path to stemcell tarball
include_<testcase-name> - flag for whether to run a given testcase, if omitted defaults to false
deployment_vm_type - cloud config vm_type to be passed into config, if omitted defaults to default (used by example deployment_testcase)
deployment_network - cloud config network to be passed into config, if omitted defaults to default (used by example deployment_testcase)
deployment_az - cloud config az to be passed into config, if omitted defaults to z1 (used by example deployment_testcase)
Contributing to B-DRATs
B-DRATS runs a collection of test cases against a bosh director.
Test cases should be used for checking that BOSH director components’ data has been backed up and restored correctly. For example, if your release backs up a database during bbr director backup, and the database is altered after taking the backup. Then after a successful bbr director restore, the content of the database will be restored to its original state.
To add extra test cases, create a new test case that implements the TestCase interface.
The methods that need to be implemented are:
Name() string - should return name of the test case.
BeforeBackup(Config) - runs before the backup is taken, and should create state in the BOSH director to be backed up.
AfterBackup(Config) - runs after the backup is complete but before the restore is started.
AfterRestore(Config) - runs after the restore is complete, and should assert that the state in the restored BOSH director matches that created in BeforeBackup(Config).
Cleanup(Config) - should clean up the state created in the BOSH director through the test.
Config contains the config for the BOSH Director and for the CF deployments to backup and restore.
bosh-disaster-recovery-acceptance-tests (B-DRATs)
Tests a given BOSH director can be backed up and restored using
bbr.The test runner provides hooks around
bbr director backupandbbr director restore.Dependencies
bbrCLIRunning B-DRATs in your pipelines
We encourage you to use our
run-b-dratsCI task to run B-DRATS in your Concourse pipeline.Please refer to our b-drats pipeline definition for a working example.
Running B-DRATs locally
integration-config.jsonfile, for example:INTEGRATION_CONFIG_PATHto be path tointegration-config.jsonfile you just created.BBR_BINARY_PATHto the path to the BBR binary.Integration Config Variables
bosh_host- the BOSH director hostnamebosh_ssh_username- the BOSH director VM SSH usernamebosh_ssh_private_key- the BOSH director VM SSH private keybosh_client- the BOSH director API clientbosh_client_secret- the BOSH director API client secretbosh_ca_cert- the BOSH director API CA certificatecredhub_client- the UAA client that is used to authenticate with CredHubcredhub_client_secret- the UAA secret that is used to authenticate with CredHubcredhub_ca_cert- the mTLS certificate that is used to communicate with CredHubtimeout_in_minutes- default ginkgoEventuallytimeout in minutes, defaults to30stemcell_src- absolute path to stemcell tarballinclude_<testcase-name>- flag for whether to run a given testcase, if omitted defaults tofalsedeployment_vm_type- cloud config vm_type to be passed into config, if omitted defaults todefault(used by example deployment_testcase)deployment_network- cloud config network to be passed into config, if omitted defaults todefault(used by example deployment_testcase)deployment_az- cloud config az to be passed into config, if omitted defaults toz1(used by example deployment_testcase)Contributing to B-DRATs
B-DRATS runs a collection of test cases against a bosh director.
Test cases should be used for checking that BOSH director components’ data has been backed up and restored correctly. For example, if your release backs up a database during
bbr director backup, and the database is altered after taking the backup. Then after a successfulbbr director restore, the content of the database will be restored to its original state.To add extra test cases, create a new test case that implements the
TestCaseinterface.The methods that need to be implemented are:
Name() string- should return name of the test case.BeforeBackup(Config)- runs before the backup is taken, and should create state in the BOSH director to be backed up.AfterBackup(Config)- runs after the backup is complete but before the restore is started.AfterRestore(Config)- runs after the restore is complete, and should assert that the state in the restored BOSH director matches that created inBeforeBackup(Config).Cleanup(Config)- should clean up the state created in the BOSH director through the test.Configcontains the config for the BOSH Director and for the CF deployments to backup and restore.Creating a new test case
[]runner.TestCaseinacceptance_test.go.