Git Product home page Git Product logo

vol-test's Introduction

Introduction

vol-test is a set of integration tests that is intended to prove and test API support of volume plugins for Docker. vol-test is based upon BATS(https://github.com/sstephenson/bats.git) and depends on some helper libraries - bats-support and bats-assert which are linked as submodules.

vol-test supports testing against remote environments. Remote Docker hosts should have ssh keys configured for access without a password.

Setup

  • Install BATS.

    git clone https://github.com/sstephenson/bats.git
    cd bats
    sudo ./install.sh /usr/local
    
  • Clone this repository (optionally, fork), and pull submodules

    git clone https://github.com/khudgins/vol-test
    cd vol-test
    git submodule init
    git submodule update --recursive --remote
    

Running

  • Configuration:

vol-test requires a few environment variables to be configured before running:

  • VOLDRIVER - this should be set to the full path (store/vendor/pluginname:tag) of the volume driver to be tested
  • PLUGINOPTS - Gets appended to the 'docker volume install' command for install-time plugin configuration
  • CREATEOPTS - Optional. Used in 'docker volume create' commands in testing to pass options to the driver being tested
  • PREFIX - Optional. Commandline prefix for remote testing. Usually set to 'ssh address_of_node1'
  • PREFIX2 - Optional. Commandline prefix for remote testing. Usually set to 'ssh address_of_node2'
  • To validate a volume plugin:
  1. Export the name of the plugin that is referenced when creating a network as the environmental variable $VOLDRIVER.
  2. Run the bats tests by running bats singlenode.bats secondnode.bats

Example using the vieux/sshfs driver (replace vieux/sshfs with the name of the plugin/driver you wish to test):

Prior to running tests the first time, you'll want to pull all the BATS assist submodules, as well:

git submodule update --recursive --remote
$PREFIX="docker-machine ssh node1 "
$VOLDRIVER=vieux/sshfs
$CREATEOPTS="-o [email protected]:~/tmp -o password=yourpw"

bats singlenode.bats

✓ Test: Create volume using driver (vieux/sshfs)
✓ Test: Confirm volume is created using driver (vieux/sshfs)
...

15 tests, 0 failures

vol-test's People

Contributors

khudgins avatar avagin avatar datamattsson 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.