| 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 |
| Jamie Hannaford | 2a2a146 | 2014-09-10 14:05:45 +0200 | [diff] [blame] | 8 | > may incur bandwidth and service charges for all the resource usage. These |
| 9 | > tests *should* remove their remote products automatically. However, there may |
| 10 | > be certain cases where this does not happen; always double-check to make sure |
| 11 | > you have no stragglers left behind. |
| Jamie Hannaford | e8ab7b4 | 2014-09-09 16:40:06 +0200 | [diff] [blame] | 12 | |
| 13 | ### Step 1. Set environment variables |
| 14 | |
| Ash Wilson | 9d0abb2 | 2014-10-20 15:15:58 -0400 | [diff] [blame] | 15 | A lot of tests rely on environment variables for configuration - so you will need |
| Jamie Hannaford | 0fd6752 | 2014-09-09 17:00:22 +0200 | [diff] [blame] | 16 | to set them before running the suite. If you're testing against pure OpenStack APIs, |
| Ash Wilson | 9d0abb2 | 2014-10-20 15:15:58 -0400 | [diff] [blame] | 17 | you can download a file that contains all of these variables for you: just visit |
| 18 | the `project/access_and_security` page in your control panel and click the "Download |
| 19 | OpenStack RC File" button at the top right. For all other providers, you will need |
| Jamie Hannaford | 0fd6752 | 2014-09-09 17:00:22 +0200 | [diff] [blame] | 20 | to set them manually. |
| 21 | |
| Jamie Hannaford | e8ab7b4 | 2014-09-09 16:40:06 +0200 | [diff] [blame] | 22 | #### Authentication |
| 23 | |
| 24 | |Name|Description| |
| 25 | |---|---| |
| 26 | |`OS_USERNAME`|Your API username| |
| 27 | |`OS_PASSWORD`|Your API password| |
| 28 | |`OS_AUTH_URL`|The identity URL you need to authenticate| |
| 29 | |`OS_TENANT_NAME`|Your API tenant name| |
| 30 | |`OS_TENANT_ID`|Your API tenant ID| |
| Ash Wilson | 9d0abb2 | 2014-10-20 15:15:58 -0400 | [diff] [blame] | 31 | |`RS_USERNAME`|Your Rackspace username| |
| Ash Wilson | 5d1c2c3 | 2014-10-22 15:36:31 -0400 | [diff] [blame] | 32 | |`RS_API_KEY`|Your Rackspace API key| |
| Jamie Hannaford | e8ab7b4 | 2014-09-09 16:40:06 +0200 | [diff] [blame] | 33 | |
| 34 | #### General |
| 35 | |
| 36 | |Name|Description| |
| 37 | |---|---| |
| 38 | |`OS_REGION_NAME`|The region you want your resources to reside in| |
| Ash Wilson | 9d0abb2 | 2014-10-20 15:15:58 -0400 | [diff] [blame] | 39 | |`RS_REGION`|Rackspace region you want your resource to reside in| |
| Jamie Hannaford | e8ab7b4 | 2014-09-09 16:40:06 +0200 | [diff] [blame] | 40 | |
| 41 | #### Compute |
| 42 | |
| 43 | |Name|Description| |
| 44 | |---|---| |
| 45 | |`OS_IMAGE_ID`|The ID of the image your want your server to be based on| |
| 46 | |`OS_FLAVOR_ID`|The ID of the flavor you want your server to be based on| |
| 47 | |`OS_FLAVOR_ID_RESIZE`|The ID of the flavor you want your server to be resized to| |
| Ash Wilson | 9d0abb2 | 2014-10-20 15:15:58 -0400 | [diff] [blame] | 48 | |`RS_IMAGE_ID`|The ID of the image you want servers to be created with| |
| 49 | |`RS_FLAVOR_ID`|The ID of the flavor you want your server to be created with| |
| Jamie Hannaford | e8ab7b4 | 2014-09-09 16:40:06 +0200 | [diff] [blame] | 50 | |
| 51 | ### 2. Run the test suite |
| 52 | |
| Jamie Hannaford | 1c5f553 | 2014-10-22 11:44:55 +0200 | [diff] [blame] | 53 | From the root directory, run: |
| Jamie Hannaford | e8ab7b4 | 2014-09-09 16:40:06 +0200 | [diff] [blame] | 54 | |
| 55 | ``` |
| Jamie Hannaford | 1c5f553 | 2014-10-22 11:44:55 +0200 | [diff] [blame] | 56 | ./script/acceptancetest |
| Ash Wilson | 9d0abb2 | 2014-10-20 15:15:58 -0400 | [diff] [blame] | 57 | ``` |