Skip to content

Latest commit

 

History

History
193 lines (178 loc) · 5.91 KB

testing_with_config.md

File metadata and controls

193 lines (178 loc) · 5.91 KB

Running DRATS with Integration Config

In order to run DRATs using an integration config file, you can use scripts/run_acceptance_tests_local_with_config.sh or on the jumpbox using ginkgo.

From a jumpbox

  1. Create an integration config json file e.g. integration_config.json:
  2. Export the following environment variables:
    • BBR_BUILD_PATH: Path to your bbr binary
    • CONFIG: Path to your integration_config.json
  3. Run the tests
    $> go mod tidy
    $> go run github.com/onsi/ginkgo/v2/ginkgo -v --trace acceptance

Locally

  1. Create an integration config json file e.g. integration_config.json:
  2. Setup the following environment variables:
    • BBR_BUILD_PATH
  3. Add the following additional properties to the integration config:
    • ssh_proxy_user: The jumpbox user
    • ssh_proxy_host: The jumpbox host
    • ssh_proxy_private_key: The jumpbox private key
  4. Run scripts/run_acceptance_tests_local_with_config.sh

Required Integration Config Properties

To run all of the default test cases in DRATs, you must set the following integration config properties:

Required Integration Config Properties Usage
`cf_deployment_name` Name of the Cloud Foundry deployment to backup and restore
`cf_api_url` Cloud Foundry API URL
`cf_admin_username` Cloud Foundry API admin user
`cf_admin_password` Cloud Foundry API admin password
`credhub_client_name` Credhub for Cloud Foundry admin user
`credhub_client_secret` Credhub for Cloud Foundry admin password
`bosh_environment` URL of BOSH Director which has deployed the above Cloud Foundries
`bosh_client` BOSH Director username
`bosh_client` BOSH Director password
`bosh_ca_cert` BOSH Director's CA cert content
`include_TESTCASE_NAME` Flag for whether to run a given testcase; if omitted, it defaults to false

Optional Integration Config Properties

For further configure the run of DRATs, you can set the following integration config properties:

Optional Integration Config Property Usage
`timeout_in_minutes` Timeout for commands run in the test (defaults to 15 minutes)
`ssh_destination_cidr` Default to "10.0.0.0/8"; change if your CF deployment is deployed in a different internal network range
`delete_and_redeploy_cf` Set to "true" to have the CF deployment destroyed and redeployed from scratch during the test cycle. **Exercise extreme care when using this option!**

**If these variables are not set, all test suites will be run.


DRATs with NFS Broker

To also run the test case for the optional component NFS Broker, set the following properties:

NFS Broker Integration Config Property Usage
`nfs_service_name` Required to run the NFS test case
`nfs_plan_name` Required to run the NFS test case
`nfs_create_service_broker` Set to "true" to register the NFS service broker in the NFS test case
`nfs_broker_user` Required to register the NFS service broker when running the NFS test case
`nfs_broker_password` Required to register the NFS service broker when running the NFS test case
`nfs_broker_url` Required to register the NFS service broker when running the NFS test case

DRATs with SMB Broker

To also run the test case for the optional component SMB Broker, set the following properties:

SMB Broker Integration Config Property Usage
`smb_service_name` Required to run the SMB test case
`smb_plan_name` Required to run the SMB test case
`smb_create_service_broker` Set to "true" to register the SMB service broker in the SMB test case
`smb_broker_user` Required to register the SMB service broker when running the SMB test case
`smb_broker_password` Required to register the SMB service broker when running the SMB test case
`smb_broker_url` Required to register the SMB service broker when running the SMB test case

DRATs with Selective Backup

If you have deployed your cf-deployment to selectively backup blobs, set the following variables:

Selective Backup Environment Variable Usage
`selective_backup` Set to "true" to run the EnsureAfterSelectiveRestore test case step
`selective_backup_type` set to droplets or droplets_and_packages