diff options
author | Amit Shah <amit.shah@redhat.com> | 2010-04-22 19:08:47 +0530 |
---|---|---|
committer | Amit Shah <amit.shah@redhat.com> | 2010-04-22 19:14:03 +0530 |
commit | 29e903ffc3e83d6336b27dab07bb620cb504256a (patch) | |
tree | 9e2251cec6cf5609c56244825c134c3449055dc7 /auto-virtserial.c | |
parent | a2307cfe4f44a114739f6d97b44d7257e8a74a46 (diff) | |
download | test-virtserial-29e903ffc3e83d6336b27dab07bb620cb504256a.tar.gz test-virtserial-29e903ffc3e83d6336b27dab07bb620cb504256a.tar.xz test-virtserial-29e903ffc3e83d6336b27dab07bb620cb504256a.zip |
auto-test: Don't run further tests if basic ones fail
Some basic tests like reading/writing from/to guests, opening files,
etc., have to succeed. If they fail, we shouldn't attempt to run other
tests.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Diffstat (limited to 'auto-virtserial.c')
-rw-r--r-- | auto-virtserial.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/auto-virtserial.c b/auto-virtserial.c index f52f1d6..4986672 100644 --- a/auto-virtserial.c +++ b/auto-virtserial.c @@ -1234,24 +1234,44 @@ static int run_test(int test_nr, int nr) static int start_tests(void) { + int ret; + /* * These tests can only be tried when the guest program is * up. The guest program will terminate in case we're running * on an incompatible kernel or qemu version. */ - run_test(TEST_OPEN, 2); - run_test(TEST_CLOSE, 2); - run_test(TEST_MULTI_OPEN, 2); + ret = run_test(TEST_OPEN, 2); + if (ret) + return ret; + + ret = run_test(TEST_CLOSE, 2); + if (ret) + return ret; + + ret = run_test(TEST_MULTI_OPEN, 2); + if (ret) + return ret; run_test(TEST_SYSFS_UDEV, 2); - run_test(TEST_READ_WO_HOST, 2); + ret = run_test(TEST_READ_WO_HOST, 2); + if (ret) + return ret; + + ret = run_test(TEST_BLOCKING_READ, 2); + if (ret) + return ret; - run_test(TEST_BLOCKING_READ, 2); - run_test(TEST_NOBLOCK_READ, 2); + ret = run_test(TEST_NOBLOCK_READ, 2); + if (ret) + return ret; + + ret = run_test(TEST_BLOCKING_WRITE, 2); + if (ret) + return ret; - run_test(TEST_BLOCKING_WRITE, 2); // run_test(TEST_NONBLOCK_WRITE, 2); run_test(TEST_POLL, 2); |