Adam Litke has uploaded a new change for review.
Change subject: testing: Add support for failure injection ......................................................................
testing: Add support for failure injection
Change-Id: I30e562383fb08c4eeeeb91cca33d44a80bbff7f1 Signed-off-by: Adam Litke alitke@redhat.com --- M vdsm/storage/misc.py M vdsm/storage/storage_exception.py 2 files changed, 10 insertions(+), 0 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/31/44831/1
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py index b14fd26..c53f46d 100644 --- a/vdsm/storage/misc.py +++ b/vdsm/storage/misc.py @@ -1007,3 +1007,8 @@ def deprecated(f): """Used to mark exported methods as deprecated""" return f + + +def maybe_fail(chance=0.1): + if chance != 0 and random.random() <= chance: + raise se.InjectedFailure() diff --git a/vdsm/storage/storage_exception.py b/vdsm/storage/storage_exception.py index 3a4d33f..4ca0b56 100644 --- a/vdsm/storage/storage_exception.py +++ b/vdsm/storage/storage_exception.py @@ -1724,3 +1724,8 @@ code = 855 message = ("Could not acquire resource. " "Probably resource factory threw an exception.") + + +class InjectedFailure(GeneralException): + code = 999 + message = "Injected Failure"
automation@ovirt.org has posted comments on this change.
Change subject: testing: Add support for failure injection ......................................................................
Patch Set 1:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Nir Soffer has posted comments on this change.
Change subject: testing: Add support for failure injection ......................................................................
Patch Set 1: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/44831/1//COMMIT_MSG Commit Message:
Line 3: AuthorDate: 2015-08-11 12:14:20 -0400 Line 4: Commit: Adam Litke alitke@redhat.com Line 5: CommitDate: 2015-08-13 16:35:12 -0400 Line 6: Line 7: testing: Add support for failure injection Why do we need this? Line 8: Line 9: Change-Id: I30e562383fb08c4eeeeb91cca33d44a80bbff7f1
automation@ovirt.org has posted comments on this change.
Change subject: testing: Add support for failure injection ......................................................................
Patch Set 2:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
automation@ovirt.org has posted comments on this change.
Change subject: testing: Add support for failure injection ......................................................................
Patch Set 3:
* Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3'])
Jenkins CI RO has abandoned this change.
Change subject: testing: Add support for failure injection ......................................................................
Abandoned
Abandoned due to no activity - please restore if still relevant
gerrit-hooks has posted comments on this change.
Change subject: testing: Add support for failure injection ......................................................................
Patch Set 3:
* Update tracker: IGNORE, no Bug-Url found
vdsm-patches@lists.fedorahosted.org