Add support of custom scenario to scenario tests

Add possible create custom scenario in scenario tests
bp custom-checks

Change-Id: I3e0574dd7c347bce7b255d2ed240038c9fdd063f
This commit is contained in:
Evgeny Sikachev 2015-05-30 11:04:04 +03:00
parent c3f1796173
commit d7733ecd11
7 changed files with 58 additions and 3 deletions

View File

@ -124,7 +124,7 @@ This sections is an array-type.
+-----------------------------+---------+----------+-----------------------------------+---------------------------------------+
| timeout_poll_cluster_status | integer | | 1800 | timeout for polling cluster state |
+-----------------------------+---------+----------+-----------------------------------+---------------------------------------+
| scenario | array | | ['run_jobs', 'scale', 'run_jobs'] | "run_jobs", "scale", "transient" |
| scenario | array | | ['run_jobs', 'scale', 'run_jobs'] | array of checks |
+-----------------------------+---------+----------+-----------------------------------+---------------------------------------+
| edp_jobs_flow | string | | | name of edp job flow |
+-----------------------------+---------+----------+-----------------------------------+---------------------------------------+

View File

@ -0,0 +1,18 @@
# Copyright (c) 2015 Mirantis Inc.
#
# 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.
def check(self):
self.check_run_jobs()

View File

@ -0,0 +1,18 @@
# Copyright (c) 2015 Mirantis Inc.
#
# 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.
def check(self):
self.check_scale()

View File

@ -0,0 +1,18 @@
# Copyright (c) 2015 Mirantis Inc.
#
# 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.
def check(self):
self.check_transient()

View File

@ -16,6 +16,7 @@ class ${testcase['class_name']}TestCase(base.BaseTestCase):
def test_plugin(self):
self.create_cluster()
% for check in testcase['scenario']:
self.check_${check}()
from sahara.tests.scenario.custom_checks import check_${check}
check_${check}.check(self)
% endfor
</%def>

View File

@ -254,7 +254,7 @@ SCHEMA = {
"type": "array",
"items": {
"type": "string",
"enum": ["run_jobs", "scale", "transient"]
"minLength": 1
}
},
"edp_jobs_flow": {