Merge "Convert request schema (servers)"

This commit is contained in:
Jenkins 2014-08-20 21:15:08 +00:00 committed by Gerrit Code Review
commit 9cfa75e3af
4 changed files with 56 additions and 24 deletions

View File

@ -1,23 +0,0 @@
{
"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
}
}

View File

@ -15,6 +15,7 @@
from tempest.api.compute import base
from tempest.api_schema.request.compute.v2 import servers
from tempest import test
@ -25,7 +26,7 @@ load_tests = test.NegativeAutoTest.load_tests
class GetConsoleOutputNegativeTestJSON(base.BaseV2ComputeTest,
test.NegativeAutoTest):
_service = 'compute'
_schema_file = 'compute/servers/get_console_output.json'
_schema = servers.get_console_output
@classmethod
def setUpClass(cls):

View File

@ -0,0 +1,36 @@
# (c) 2014 Deutsche Telekom AG
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
common_get_console_output = {
"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
}
}

View File

@ -0,0 +1,18 @@
# (c) 2014 Deutsche Telekom AG
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import copy
from tempest.api_schema.request.compute import servers
get_console_output = copy.deepcopy(servers.common_get_console_output)