KVM test: Fail a test right away if 'dependency_fail = yes' is on params
commitff2dc6c9754853c9f6cbfa9e621823c83802fbfa
authorlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
Mon, 11 Apr 2011 01:36:45 +0000 (11 01:36 +0000)
committerlmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4>
Mon, 11 Apr 2011 01:36:45 +0000 (11 01:36 +0000)
treee044bb649d2665722822c5212218601671926e17
parentc3fb49e5938050918b8a113a50df05f162c5bcf5
KVM test: Fail a test right away if 'dependency_fail = yes' is on params

When the KVM config file parser generates the list of tests,
it will generate a full list of dicts, each dict maps to a
test to be executed. However, due to the design of our
dependency system, we skip running tests that had a dependency
failure.

While fair, this also masks the fact that the tests that were
not executed are indeed failures (test couldn't run because a
dependency failed). So test jobs that had very serious problem
(say, kvm build failed so every other test failed in sequence),
will yield fairly reasonable PASS rates, that can fool developers.

So, here's what we are going to do to solve this:

 * When a dependency fails, when it comes to execute a dependency
test, don't just skip it. Execute it in a way that it will always
throw a TestNA exception.

In order to do that:

 * Introduce an extra parameter 'dependency_fail = yes' on the
dependent test 'params' dict.
 * Make test load code to fail the test right away with
TestNA whenever params[dependency_fail] is 'yes'.

Changes from v1:

* Move failing test code from kvm_preprocessing to kvm.py. Conceptually
that logic belongs to the high level kvm test load code.
* Fix typo on the TestNAError class name.

Changes from v2:
* Fix typo, not params("dependency_failed"),
* params.get("dependency_failed")

Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@5297 592f7852-d20e-0410-864c-8624ca9c26a4
client/tests/kvm/kvm.py
client/tests/kvm/kvm_preprocessing.py
client/tests/kvm/kvm_utils.py