Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #760 from markdryan/master
Browse files Browse the repository at this point in the history
Rewrite BAT tests in GO
  • Loading branch information
mcastelino authored Nov 2, 2016
2 parents f44a9cd + 00a9bae commit 56e2ebd
Show file tree
Hide file tree
Showing 11 changed files with 1,131 additions and 1,004 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ script:
- sudo mkdir -p /var/lib/ciao/instances
- sudo chmod 0777 /var/lib/ciao/instances
- test-cases -v -timeout 9 -coverprofile /tmp/cover.out -short github.com/01org/ciao/ciao-controller/...
- test-cases -v -timeout 9 -coverprofile /tmp/cover.out -append-profile -short github.com/01org/ciao/ciao-launcher github.com/01org/ciao/ciao-scheduler github.com/01org/ciao/payloads github.com/01org/ciao/configuration github.com/01org/ciao/testutil github.com/01org/ciao/ssntp/uuid github.com/01org/ciao/qemu github.com/01org/ciao/openstack/...
- test-cases -v -timeout 9 -coverprofile /tmp/cover.out -append-profile -short github.com/01org/ciao/ciao-launcher github.com/01org/ciao/ciao-scheduler github.com/01org/ciao/payloads github.com/01org/ciao/configuration github.com/01org/ciao/testutil github.com/01org/ciao/ssntp/uuid github.com/01org/ciao/qemu github.com/01org/ciao/openstack/... github.com/01org/ciao/bat
- export GOROOT=`go env GOROOT` && sudo -E PATH=$PATH:$GOROOT/bin $GOPATH/bin/test-cases -v -timeout 9 -coverprofile /tmp/cover.out -append-profile github.com/01org/ciao/ssntp
- export GOROOT=`go env GOROOT` && export SNNET_ENV=198.51.100.0/24 && sudo -E PATH=$PATH:$GOROOT/bin $GOPATH/bin/test-cases -v -timeout 9 -short -tags travis -coverprofile /tmp/cover.out -append-profile github.com/01org/ciao/networking/libsnnet
# API Documentation is automated by swagger, every PR will verify the documentation can be generated
Expand Down
525 changes: 0 additions & 525 deletions _release/bat/README

This file was deleted.

71 changes: 71 additions & 0 deletions _release/bat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# BAT tests

This folder contains a set of BAT tests. Each set of tests validates a specific
part of ciao, such as storage, and is implemented by a separate go package in one of
the following sub folders.

```
.
├── base - Basic tests that verify that the cluster is functional
```

The tests are implemented using the go testing framework. This is convenient
as this framework is used for ciao's unit tests and so is already familiar
to ciao developers, it requires no additional dependencies and it works with ciao's
existing test case runner, test-cases.

# A Short Guide to Running the BAT Tests

## Set up

The BAT tests require that certain environment variables have been set before they
can be run:

* "CIAO_IDENTITY" - the URL and port number of your identity service
* "CIAO_CONTROLLER" - the URL and port number of the ciao compute service
* "CIAO_USERNAME" - a test user with user level access to a test tenant
* "CIAO_PASSWORD" - your test user's password
* "CIAO_ADMIN_USERNAME" - your cluster admin user name
* "CIAO_ADMIN_PASSWORD" - your cluster admin password.

## Running all the BAT tests

```
# cd $GOPATH/src/github.com/01org/ciao/_release/bat
# go test -v ./...
```

## Run the BAT Tests and Generate a Pretty Report

```
# cd $GOPATH/src/github.com/01org/ciao/_release/bat
# test-cases ./...
```

## Run the BAT Tests and Generate TAP report

```
# cd $GOPATH/src/github.com/01org/ciao/_release/bat
# test-cases -format tap ./...
```

## Run the BAT Tests and Generate a Test Plan

```
# cd $GOPATH/src/github.com/01org/ciao/_release/bat
# test-cases -format html ./...
```

## Run a Single Set of Tests

```
# cd $GOPATH/src/github.com/01org/ciao/_release/bat
# go test -v github.com/01org/ciao/_release/bat/base
```

## Run a Single Test

```
# cd $GOPATH/src/github.com/01org/ciao/_release/bat
# go test -v -run TestGetAllInstances ./...
```
18 changes: 18 additions & 0 deletions _release/bat/base/base.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//
// Copyright (c) 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

// base is a placeholder package for the basic BAT tests.
package base
Loading

0 comments on commit 56e2ebd

Please sign in to comment.