Git Product home page Git Product logo

bosh-disaster-recovery-acceptance-tests's Introduction

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 backup and bbr director restore.

Dependencies

  1. Install Golang
  2. Install ginkgo CLI
  3. Install dep dependency management tool
  4. Download bbr CLI

Running B-DRATs in your pipelines

We encourage you to use our run-b-drats CI 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

  1. Clone this repo
    $ go get github.com/cloudfoundry-incubator/bosh-disaster-recovery-acceptance-tests
    $ cd $GOPATH/src/github.com/cloudfoundry-incubator/bosh-disaster-recovery-acceptance-tests
  2. Create an integration-config.json file, for example:
    {
      "bosh_host": "director-address",
      "bosh_ssh_username": "ssh-username",
      "bosh_ssh_private_key": "bosh-ssh-private-key",
      "bosh_client": "bosh-client-name",
      "bosh_client_secret": "bosh-client-secret",
      "bosh_ca_cert": "bosh-ca-cert",
      "timeout_in_minutes": 30,
      "stemcell_src": "stemcell-path.tgz",
      "include_deployment_testcase": true,
      "include_truncate_db_blobstore_testcase": true
    }
  3. Export INTEGRATION_CONFIG_PATH to be path to integration-config.json file you just created.
  4. Export BBR_BINARY_PATH to the path to the BBR binary.
  5. 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
  • 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.

Creating a new test case

  1. Create a new test case in the testcases package.
  2. Add the newly created test case to []runner.TestCase in acceptance_test.go.

bosh-disaster-recovery-acceptance-tests's People

Contributors

aclevername avatar alamages avatar belinda-liu avatar chunyilyu avatar gcapizzi avatar gmrodgers avatar jfmyers9 avatar luan avatar mirahimage avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.