~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/juju/govmomi/govc/test/README.md

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Functional tests for govc
 
2
 
 
3
## Bats
 
4
 
 
5
Install [Bats](https://github.com/sstephenson/bats/)
 
6
 
 
7
## Download test images
 
8
 
 
9
Some tests depend on [ttylinux](http://ttylinux.net) images, these can be downloaded by running:
 
10
 
 
11
```
 
12
./images/update.sh
 
13
```
 
14
 
 
15
These images are uploaded to the esxbox as needed by tests and can be
 
16
removed with the following command:
 
17
 
 
18
```
 
19
./clean.sh
 
20
```
 
21
 
 
22
## GOVC_TEST_URL
 
23
 
 
24
The govc tests need an ESX instance to run against.  The default
 
25
`GOVC_TEST_URL` is that of the vagrant box in the *esxbox* directory:
 
26
 
 
27
```
 
28
(cd esxbox && vagrant up)
 
29
```
 
30
 
 
31
Any other ESX box can be used by exporting the following variable:
 
32
 
 
33
```
 
34
export GOVC_TEST_URL=user:pass@hostname
 
35
```
 
36
 
 
37
## vCenter Simulator
 
38
 
 
39
Some tests require vCenter and depend on the Vagrant box in the
 
40
*vcsim* directory.  These tests are skipped if the vcsim box is not
 
41
running.  To enable these tests:
 
42
 
 
43
```
 
44
(cd vcsim && vagrant up)
 
45
```
 
46
 
 
47
## Running tests
 
48
 
 
49
The *govc* binary should be in your `PATH`; the test helper also prepends ../govc to `PATH`.
 
50
 
 
51
The tests can be run from any directory, as *govc* is found related to
 
52
`PATH` and *images* are found relative to `$BATS_TEST_DIRNAME`.
 
53
 
 
54
The entire suite can be run with the following command:
 
55
 
 
56
```
 
57
bats .
 
58
```
 
59
 
 
60
Or individually, for example:
 
61
 
 
62
```
 
63
./cli.bats
 
64
```