blob: dd4599b6a68dd482a68c3b323cebee927b3b322d [file] [log] [blame] [view]
Jamie Hannaforde8ab7b42014-09-09 16:40:06 +02001# Gophercloud Acceptance tests
2
3The purpose of these acceptance tests is to validate that SDK features meet
4the requirements of a contract - to consumers, other parts of the library, and
5to a remote API.
6
7> **Note:** Because every test will be run against a real API endpoint, you
8> will incur bandwidth and service charges for all the resource usage. Please
9> ensure you delete these resources when you're finished!
10
11### Step 1. Set environment variables
12
Jamie Hannaford0fd67522014-09-09 17:00:22 +020013A lot of tests rely on environment variables for configuration - so you will need
14to set them before running the suite. If you're testing against pure OpenStack APIs,
15you can download a file that contains all of these variables for you: just visit
16the `project/access_and_security` page in your control panel and click the "Download
17OpenStack RC File" button at the top right. For all other providers, you will need
18to set them manually.
19
Jamie Hannaforde8ab7b42014-09-09 16:40:06 +020020#### Authentication
21
22|Name|Description|
23|---|---|
24|`OS_USERNAME`|Your API username|
25|`OS_PASSWORD`|Your API password|
26|`OS_AUTH_URL`|The identity URL you need to authenticate|
27|`OS_TENANT_NAME`|Your API tenant name|
28|`OS_TENANT_ID`|Your API tenant ID|
29
30#### General
31
32|Name|Description|
33|---|---|
34|`OS_REGION_NAME`|The region you want your resources to reside in|
35
36#### Compute
37
38|Name|Description|
39|---|---|
40|`OS_IMAGE_ID`|The ID of the image your want your server to be based on|
41|`OS_FLAVOR_ID`|The ID of the flavor you want your server to be based on|
42|`OS_FLAVOR_ID_RESIZE`|The ID of the flavor you want your server to be resized to|
43
44### 2. Run the test suite
45
46From your `$GOPATH` directory, run:
47
48```
49go test -v -tags acceptance github.com/rackspace/gophercloud/...
50```
51
52Alternatively, you can execute the above from your nested git folder (i.e. the
53 workspace visible when browsing the Github repository) by replacing
54 `github.com/rackspace/gophercloud/...` with `./...`