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 Go
  2. 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
    $ git clone [email protected]:cloudfoundry/bosh-disaster-recovery-acceptance-tests.git
    $ cd 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",
      "credhub_client":"credhub-client",
      "credhub_client_secret":"credhub-client-secret",
      "credhub_ca_cert":"credhub-ca-cert",
      "timeout_in_minutes": 30,
      "stemcell_src": "stemcell-path.tgz",
      "include_credhub_testcase": true,
      "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
  • 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.

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 blgm avatar cf-rabbit-bot avatar chunyilyu avatar cryogenics-ci avatar dependabot[bot] avatar dlresende avatar gcapizzi avatar gm2552 avatar gmrodgers avatar ifindlay-cci avatar jfmyers9 avatar jhvhs avatar jimbo459 avatar jpalermo avatar luan avatar mdelillo avatar miguelverissimo avatar mingxiao avatar mirahimage avatar nader-ziada avatar neil-hickey avatar nouseforaname avatar terminatingcode avatar tinygrasshopper avatar totherme avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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

Unable to install/run b-drats locally

Hi,

I tried to follow the instructions to run the acceptance test but failed to install all depependencies correctly. If I try to run the script I get

[xxxx@yyyy disaster-recovery-acceptance-tests]$scripts/_run_acceptance_tests.sh
dep: WARNING: branch, version, revision, or source should be provided for "github.com/onsi/ginkgo"
dep: WARNING: branch, version, revision, or source should be provided for "github.com/onsi/gomega"
The following errors occurred while deducing packages:
  * "code.cloudfoundry.org/routing-api/models": unable to deduce repository and source type for "code.cloudfoundry.org/routing-api": unable to read metadata: go-import metadata not found
  * "code.cloudfoundry.org/routing-api": unable to deduce repository and source type for "code.cloudfoundry.org/routing-api": unable to read metadata: go-import metadata not found

validateParams: could not deduce external imports' project roots

I tried to install routing api with
go get -insecure code.cloudfoundry.org/routing-api package code.cloudfoundry.org/trace-logger: unrecognized import path "code.cloudfoundry.org/trace-logger" (parse https://code.cloudfoundry.org/trace-logger?go-get=1: no go-import meta tags ())
but it fails . The repo for routing-api also does not give a hint how to properly install the component in a go environment. Maybe you can give me (and others) a hint how to install all the dependencies?

Thanks, Jochen

Add Credhub B-DRATs testcase

Background

The Platform Recovery team has released some time now this repo, the BOSH Disaster Recovery Acceptance Tests suite (also known as B-DRATs).

Currently the suite ships with a single test case, the deployment_testcase, which tests the backup and restore of a simple deployment. The README has instructions on how to add test cases, it all looks very similar to DRATs. We would like to have test cases for all components deployed on the director VM.

Goal

We would like to have a testcase for Credhub to ensure backup and restore of Credhub in BOSH is properly being tested and covered. The new testcase should be submitted through a PR.

For any questions please refer to @cloudfoundry-incubator/bosh-backup-and-restore-team

Please configure GITBOT

Pivotal provides the Gitbot service to synchronize issues and pull requests made against public GitHub repos with Pivotal Tracker projects.

If you are a Pivotal employee, you can configure Gitbot to sync your GitHub repo to your Pivotal Tracker project with a pull request.

Steps:

  • Fork this repo: cfgitbot-config (an ask+cf@ ticket is the fastest way to get read access if you get a 404)
  • Add the Toolsmiths-Bots team to have admin access to your repo
  • Add the cf-gitbot ([email protected]) user to have owner access to your Pivotal Tracker project
  • Add your new repo and or project to config-production.yml file
  • Submit a PR, which will get auto-merged if you've done it right

If you are not a pivotal employee, you can request that [email protected] set up the integration for you.

You might also be interested in configuring GitHub's Service Hook for Tracker on your repo so you can link your commits to Tracker stories. You can do this yourself by following the directions at:

https://www.pivotaltracker.com/blog/guide-githubs-service-hook-tracker/

If you do not want to use Pivotal Tracker to manage this GitHub repo, Please add this repo to the Ignored repositories list

If there are any questions, please reach out to [email protected].

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.