| 1 |
====================================== |
| 2 |
python-glanceclient functional testing |
| 3 |
====================================== |
| 4 |
|
| 5 |
Idea |
| 6 |
---- |
| 7 |
|
| 8 |
Run real client/server requests in the gate to catch issues which |
| 9 |
are difficult to catch with a purely unit test approach. |
| 10 |
|
| 11 |
Many projects (nova, keystone...) already have this form of testing in |
| 12 |
the gate. |
| 13 |
|
| 14 |
|
| 15 |
Testing Theory |
| 16 |
-------------- |
| 17 |
|
| 18 |
Since python-glanceclient has two uses, CLI and python API, we should |
| 19 |
have two sets of functional tests. CLI and python API. The python API |
| 20 |
tests should never use the CLI. But the CLI tests can use the python API |
| 21 |
where adding native support to the CLI for the required functionality |
| 22 |
would involve a non trivial amount of work. |
| 23 |
|
| 24 |
|
| 25 |
Functional Test Guidelines |
| 26 |
-------------------------- |
| 27 |
|
| 28 |
The functional tests require: |
| 29 |
|
| 30 |
1) A working Glance/Keystone installation (for example, devstack) |
| 31 |
2) A yaml file containing valid credentials |
| 32 |
|
| 33 |
If you are using devstack, a yaml file will have been created for you |
| 34 |
with the name /etc/openstack/clouds.yaml. The test code knows where |
| 35 |
to find it, so if you're using devstack, you don't need to do anything |
| 36 |
else. |
| 37 |
|
| 38 |
If you are not using devstack you should create a yaml file |
| 39 |
with the following format: |
| 40 |
|
| 41 |
clouds: |
| 42 |
devstack-admin: |
| 43 |
auth: |
| 44 |
auth_url: http://10.0.0.1:35357/v2.0 |
| 45 |
password: example |
| 46 |
project_domain_id: default |
| 47 |
project_name: admin |
| 48 |
user_domain_id: default |
| 49 |
username: admin |
| 50 |
identity_api_version: '2.0' |
| 51 |
region_name: RegionOne |
| 52 |
|
| 53 |
The tests will look for a file named 'clouds.yaml' in the |
| 54 |
following locations (in this order, first found wins): |
| 55 |
|
| 56 |
* current directory |
| 57 |
* ~/.config/openstack |
| 58 |
* /etc/openstack |
| 59 |
|
| 60 |
You may also set the environment variable OS_CLIENT_CONFIG_FILE |
| 61 |
to the absolute pathname of a file and that location will be |
| 62 |
inserted at the front of the search list. |