[openstack-dev] [qa][nova] Ownership and path to schema definitions
David Kranz
dkranz at redhat.com
Tue Mar 4 18:31:07 UTC 2014
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. 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}
],
"json-schema": {
"type": "object",
"properties": {
"os-getConsoleOutput": {
"type": "object",
"properties": {
"length": {
"type": ["integer", "string"],
"minimum": 0
}
}
}
},
"additionalProperties": false
}
}
More information about the OpenStack-dev
mailing list