| Jamie Hannaford | e8ab7b4 | 2014-09-09 16:40:06 +0200 | [diff] [blame] | 1 | # Gophercloud Acceptance tests |
| 2 | |
| 3 | The purpose of these acceptance tests is to validate that SDK features meet |
| 4 | the requirements of a contract - to consumers, other parts of the library, and |
| 5 | to 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 Hannaford | 0fd6752 | 2014-09-09 17:00:22 +0200 | [diff] [blame^] | 13 | A lot of tests rely on environment variables for configuration - so you will need |
| 14 | to set them before running the suite. If you're testing against pure OpenStack APIs, |
| 15 | you can download a file that contains all of these variables for you: just visit |
| 16 | the `project/access_and_security` page in your control panel and click the "Download |
| 17 | OpenStack RC File" button at the top right. For all other providers, you will need |
| 18 | to set them manually. |
| 19 | |
| Jamie Hannaford | e8ab7b4 | 2014-09-09 16:40:06 +0200 | [diff] [blame] | 20 | #### 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 | |
| 46 | From your `$GOPATH` directory, run: |
| 47 | |
| 48 | ``` |
| 49 | go test -v -tags acceptance github.com/rackspace/gophercloud/... |
| 50 | ``` |
| 51 | |
| 52 | Alternatively, 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 `./...` |