[openstack-dev] [qa][nova] Ownership and path to schema definitions

Kenichi Oomichi oomichi at mxs.nes.nec.co.jp
Thu Mar 6 03:15:16 UTC 2014


Hi David,

That is an interesting idea, I'd like to join in :-)

> -----Original Message-----
> From: David Kranz [mailto:dkranz at redhat.com]
> Sent: Wednesday, March 05, 2014 3:31 AM
> To: OpenStack Development Mailing List
> Subject: [openstack-dev] [qa][nova] Ownership and path to schema definitions
> 
> Given that
> 
> 1. there is an ongoing api discussion in which using json schemas is an
> important part
> 2. tempest now has a schema-based auto-generate feature for negative tests
> 
> I think it would be a good time to have at least an initial discussion
> about the requirements for theses schemas and where they will live.
> The next step in tempest around this is to replace the existing negative
> test files with auto-gen versions, and most of the work in doing that
> is to define the schemas.
> 
> The tempest framework needs to know the http method, url part, expected
> error codes, and payload description. I believe only the last is covered
> by the current nova schema definitions, with the others being some kind
> of attribute or data associated with the method that is doing the
> validation.

Now the schema definitions of Nova cover *request* payload description only.
If Tempest will verify *response* payload in many cases(I hope that), it
would be good to add the schema definitions of response into Tempest.


> Ideally the information being used to do the validation
> could be auto-converted to a more general schema that could be used by
> tempest. I'm interested in what folks have to say about this and
> especially from the folks who are core members of both nova and tempest.
> See below for one example (note that the tempest generator does not yet
> handle "pattern").
> 
>   -David
> 
>  From nova:
> 
> get_console_output = {
>      'type': 'object',
>      'properties': {
>          'get_console_output': {
>              'type': 'object',
>              'properties': {
>                  'length': {
>                      'type': ['integer', 'string'],
>                      'minimum': 0,
>                      'pattern': '^[0-9]+$',
>                  },
>              },
>              'additionalProperties': False,
>          },
>      },
>      'required': ['get_console_output'],
>      'additionalProperties': False,
> }
> 
>  From tempest:
> 
> {
>      "name": "get-console-output",
>      "http-method": "POST",
>      "url": "servers/%s/action",
>      "resources": [
>          {"name":"server", "expected_result": 404}
>      ],

The above "name", "http-method" and "url" would be useful for API
documentation also. So I feel it would be great for Tempest and
API doc if Nova's schemas contain their info. The above "resources"
also would be useful if we can define status code of successful access.


Thanks
Ken'ichi Ohmichi

---

>      "json-schema": {
>          "type": "object",
>          "properties": {
>              "os-getConsoleOutput": {
>                  "type": "object",
>                  "properties": {
>                      "length": {
>                          "type": ["integer", "string"],
>                          "minimum": 0
>                      }
>                  }
>              }
>          },
>          "additionalProperties": false
>      }
> }
> 
> 
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev



More information about the OpenStack-dev mailing list