Merge "Port hooks to the new format"

This commit is contained in:
Jenkins 2017-10-06 03:33:22 +00:00 committed by Gerrit Code Review
commit 840de23dc6
2 changed files with 26 additions and 31 deletions

View File

@ -253,28 +253,25 @@
times: 20
concurrency: 2
hooks:
- name: sys_call
description: Run script
args: sh rally-jobs/extra/hook_example_script.sh
- description: Run script
action:
sys_call: sh rally-jobs/extra/hook_example_script.sh
trigger:
name: event
args:
event:
unit: iteration
at: [2, 5, 8, 13, 17]
- name: sys_call
description: Show time
args: date +%Y-%m-%dT%H:%M:%S
- description: Show time
action:
sys_call: date +%Y-%m-%dT%H:%M:%S
trigger:
name: event
args:
event:
unit: time
at: [0, 2, 5, 6, 9]
- name: sys_call
description: Show system name
args: uname -a
- description: Show system name
action:
sys_call: uname -a
trigger:
name: event
args:
event:
unit: iteration
at: [2, 3, 4, 5, 6, 8, 10, 12, 13, 15, 17, 18]
sla:
@ -290,12 +287,11 @@
times: 10
concurrency: 2
hooks:
- name: sys_call
description: test hook
args: /bin/true
- description: test hook
action:
sys_call: /bin/true
trigger:
name: periodic
args:
periodic:
unit: iteration
step: 2
start: 4
@ -312,12 +308,11 @@
serial:
times: 10
hooks:
- name: sys_call
description: Get system name
args: uname -a
- description: Show system name
action:
sys_call: uname -a
trigger:
name: event
args:
event:
unit: time
at: [0, 2, 4, 6, 8, 10]
sla:
@ -332,12 +327,11 @@
serial:
times: 10
hooks:
- name: sys_call
description: test hook
args: /bin/true
- description: test hook
action:
sys_call: /bin/true
trigger:
name: periodic
args:
periodic:
unit: time
step: 2
start: 0

View File

@ -40,7 +40,8 @@ class FaultInjectionHookTestCase(test.TestCase):
(dict(), False))
@ddt.unpack
def test_config_schema(self, config, valid):
results = hook.Hook.validate("fault_injection", None, None, config)
results = hook.HookAction.validate("fault_injection", None, None,
config)
if valid:
self.assertEqual([], results)
else: