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:
parent
c3f1796173
commit
d7733ecd11
@ -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 |
|
||||
+-----------------------------+---------+----------+-----------------------------------+---------------------------------------+
|
||||
|
0
sahara/tests/scenario/custom_checks/__init__.py
Normal file
0
sahara/tests/scenario/custom_checks/__init__.py
Normal file
18
sahara/tests/scenario/custom_checks/check_run_jobs.py
Normal file
18
sahara/tests/scenario/custom_checks/check_run_jobs.py
Normal 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()
|
18
sahara/tests/scenario/custom_checks/check_scale.py
Normal file
18
sahara/tests/scenario/custom_checks/check_scale.py
Normal 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()
|
18
sahara/tests/scenario/custom_checks/check_transient.py
Normal file
18
sahara/tests/scenario/custom_checks/check_transient.py
Normal 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()
|
@ -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>
|
||||
|
@ -254,7 +254,7 @@ SCHEMA = {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": ["run_jobs", "scale", "transient"]
|
||||
"minLength": 1
|
||||
}
|
||||
},
|
||||
"edp_jobs_flow": {
|
||||
|
Loading…
Reference in New Issue
Block a user