summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmit Shah <amit.shah@redhat.com>2010-04-22 19:08:47 +0530
committerAmit Shah <amit.shah@redhat.com>2010-04-22 19:14:03 +0530
commit29e903ffc3e83d6336b27dab07bb620cb504256a (patch)
tree9e2251cec6cf5609c56244825c134c3449055dc7
parenta2307cfe4f44a114739f6d97b44d7257e8a74a46 (diff)
downloadtest-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>
-rw-r--r--auto-virtserial.c34
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);