Skip to content

isabella232/docker-cache-acceptance-tests

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Cache Acceptance Tests (DCATs)

This test suite exercises the Docker Cache when deployed alongside CF Runtime and Diego .

Usage

Getting the tests

To get these tests, you can either git clone this repo:

git clone https://github.com/cloudfoundry-incubator/docker-cache-acceptance-tests $GOPATH/src/github.com/cloudfoundry-incubator
cd $GOPATH/src/github.com/cloudfoundry-incubator
go get -t -v ./...

or go get it:

go get -t -v github.com/cloudfoundry-incubator/docker-cache-acceptance-tests/...

Either way, we assume you have Golang setup on your workstation.

Test setup

To run the Diego Acceptance tests, you will need:

  • a running CF deployment
  • a running Diego deployment
  • a running Docker Cache deployment
  • credentials for an Admin user
  • an environment variable CONFIG which points to a .json file that contains the application domain
  • the cf CLI
  • ginkgo testing framework
  • Docker executable

Configuration

The following commands will setup the CONFIG for a bosh-lite installation. Replace credentials, URLs and the path to Docker as appropriate for your environment.

cd $GOPATH/src/github.com/cloudfoundry-incubator/docker-cache-acceptance-tests
cat > integration_config.json <<EOF
{
  "api": "api.bosh-lite.com",
  "admin_user": "admin",
  "admin_password": "admin",
  "apps_domain": "bosh-lite.com",
  "docker_registry_address": "10.244.2.6:8080",
  "docker_executable": "docker",
  "docker_private_image": "private-docker-app",
  "docker_user": "user",
  "docker_password": "password",
  "docker_email": "email@example.com",
  "skip_ssl_validation": true
}
EOF
export CONFIG=$PWD/integration_config.json

Note: The tests require that you have a copy of the public docker image cloudfoundry/diego-docker-app:latest, stored in a private repo in Docker Hub. Therefore you need to provide the Docker credentials (user, password and email) for access to the image in the config above.

Install ginkgo:

Install the testing framework with:

go install github.com/onsi/ginkgo/ginkgo

Setup docker (OSX)

The tests use Docker to check the Cache functionality. Install Docker

In case you use boot2docker you will need to allow access to the insecure registry by adding your registry address to /var/lib/boot2docker/profile. For example:

EXTRA_ARGS='--insecure-registry 10.244.2.6:8080'

If you use docker-machine, you should configure a machine to accept the diego cache registry as insecure.

docker-machine create -d virtualbox --engine-insecure-registry=10.244.2.6:8080 default
eval "$(docker-machine env default)"

Enable Docker Feature Flag

In order to run the docker tests you need to enable Docker support in Diego as follows:

cf enable-feature-flag diego_docker

After the tests complete you may disable Docker support with:

cf diable-feature-flag diego_docker

Running the tests

After correctly setting the CONFIG environment variable, the following command will run the tests:

./bin/test

Running as BOSH errand

To deploy the tests as BOSH errand you have to:

  1. Copy the public docker image cloudfoundry/diego-docker-app:latest, in your private repo in Docker Hub.
  2. Add the Docker credentials (user, password and email) for access to the image in $GOPATH/src/github.com/cloudfoundry-incubator/docker-cache-acceptance-tests/templates/bosh-lite.yml
  3. Deploy the test errand
cd $GOPATH

bosh deployment $GOPATH/src/github.com/cloudfoundry-incubator/docker-cache-acceptance-tests/templates/bosh-lite.yml
bosh -n deploy

To start the tests:

bosh run errand docker_acceptance_tests

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.3%
  • Shell 0.7%