Create tests to get completely Nova API Samples

Registered by Mauro S M Rodrigues

Create tests to obtain reliable and attested samples of Nova API requests and responses using both XML and Json interfaces.
This samples will be used at api site api.openstack.org and in the manuals.

Blueprint information

Status:
Complete
Approver:
Russell Bryant
Priority:
High
Drafter:
Mauro S M Rodrigues
Direction:
Approved
Assignee:
Tiago Mello
Definition:
Approved
Series goal:
Accepted for grizzly
Implementation:
Implemented
Milestone target:
milestone icon 2013.1
Started by
Russell Bryant
Completed by
Russell Bryant

Related branches

Sprints

Whiteboard

Each piece of Nova API yet to be covered is described in bug reports related to this BP.

The General approach to solve the problem is
1 - JSON API
 * In nova/tests/integrated/test_api_samples.py, create a new test class (XxxxSampleJsonTests) extending from ApiSampleTestBase
 * Set the extension name if necessary
 * For each REST action:
   - create a test case using the existing scaffolding
   - The file nova/tests/integrated/api_samples/<extension.alias>/name_of_test.json.tpl will be generated automatically when you do ./run_tests.sh for the first time (this one is the test sample template)
   - run: GENERATE_SAMPLES=True ./run_tests.sh nova.tests.integrated.test_api_samples:XxxxxSampleJsonTests
   - edit the template with replacement strings
   - add new subs regex items if necessary
 run again: GENERATE_SAMPLES=True ./run_tests.sh nova.tests.integrated.test_api_samples:XxxxxSampleJsonTests
 * this time the tests are supposed to succeed, if they don't you're probably missing some string replacement.

2- XML API
   - create XxxxSampleXmlTests extending from the json class
   - set the ctype to 'xml'
   - follow same strategy for xml samples
   - compare the generated samples against each other
   - compare the generated samples against api.openstack.org
   - report any issues as bugs and fix the underlying code (in a dependent patch if it is a large change.
   - submit the code for reveiw.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070155,n,z

Addressed by: https://review.openstack.org/15876
    Added sample tests to consoles API. Implements blueprint nova-api-samples Fixes bug 1070155

Gerrit topic: https://review.openstack.org/#q,topic:api_samples_updates,n,z

Addressed by: https://review.openstack.org/16140
    updated api_samples with real hypervisor_hostname

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070157,n,z

Addressed by: https://review.openstack.org/16754
    Added sample tests to deferred delete API.

Addressed by: https://review.openstack.org/16841
    Renaming xml test class in sample tests of consoles API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1083642,n,z

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070160,n,z

Addressed by: https://review.openstack.org/17003
    Added sample tests to extended status API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070158,n,z

Addressed by: https://review.openstack.org/17298
    Adds API Sample tests for DiskConfig extension.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070172,n,z

Addressed by: https://review.openstack.org/17412
    Adds API Sample tests for Quotas extension.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070164,n,z

Addressed by: https://review.openstack.org/17551
    Adds API Sample tests for FloatingIPDNS extension.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070163,n,z

Addressed by: https://review.openstack.org/17684
    Added sample tests to FlavorManage API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070162,n,z

Addressed by: https://review.openstack.org/17809
    Modified sample tests to FlavorExtraDate API. Modified sample tests to FlavorManage API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070161,n,z

Addressed by: https://review.openstack.org/18112
    Added sample tests to FlavorDisabled API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1089531,n,z

Addressed by: https://review.openstack.org/18150
    Add API samples tests for the coverage extension.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070165,n,z

Addressed by: https://review.openstack.org/18232
    Added sample tests to floating-ip-pools API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070171,n,z

Addressed by: https://review.openstack.org/18345
    Added sample tests to QuotaClasses API.

Gerrit topic: https://review.openstack.org/#q,topic:coverage-fixes,n,z

Gerrit topic: https://review.openstack.org/#q,topic:bug/1091739,n,z

Addressed by: https://review.openstack.org/18744
    Add API sample tests to FixedIPs extension Partially implements blueprint nova-api-samples Bug 1091739

Gerrit topic: https://review.openstack.org/#q,topic:bug/1091743,n,z

Addressed by: https://review.openstack.org/19209
    Added sample tests to FlavorRxtx API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1096653,n,z

Addressed by: https://review.openstack.org/19263
    Added sample tests to FlavorSwap API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1091755,n,z

Addressed by: https://review.openstack.org/19300
    Add API sample tests to Services extension

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070170,n,z

Addressed by: https://review.openstack.org/19619
    Add API sample tests to Admin network

Gerrit topic: https://review.openstack.org/#q,topic:bug/1091747,n,z

Addressed by: https://review.openstack.org/20175
    Add api samples to fping extension

Addressed by: https://review.openstack.org/20344
    Added sample tests to floating-ip-pools API.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1070169,n,z

Addressed by: https://review.openstack.org/20501
    Add api-samples to multinic extension

Gerrit topic: https://review.openstack.org/#q,topic:bug/1097131,n,z

Addressed by: https://review.openstack.org/20527
    Added sample tests to FlavorExtraSpecs API

Gerrit topic: https://review.openstack.org/#q,topic:bug/1091737,n,z

Addressed by: https://review.openstack.org/21108
    add config drive to api_samples

Gerrit topic: https://review.openstack.org/#q,topic:bug/1091741,n,z

Addressed by: https://review.openstack.org/21142
    Adds API Sample tests for FlavorAccess extension.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1091750,n,z

Addressed by: https://review.openstack.org/22022
    Adds API Sample tests for Hypervisors extension.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1071338,n,z

Addressed by: https://review.openstack.org/22222
    Add os-volumes extension to api samples

Gerrit topic: https://review.openstack.org/#q,topic:bug/1126211,n,z

Addressed by: https://review.openstack.org/22347
    Add API Sample tests for Snapshots extension.

Gerrit topic: https://review.openstack.org/#q,topic:bug/1126204,n,z

Addressed by: https://review.openstack.org/22994
    Adds API Sample tests for Volume Attachments

Gerrit topic: https://review.openstack.org/#q,topic:bug/1130609,n,z

Addressed by: https://review.openstack.org/22419
    Fix typo in the XML serialization os-services API.

Addressed by: https://review.openstack.org/25633
    Fix typo in the XML serialization os-services API.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.