r8817: - fixed return result from LOCAL-MESSAGING test
authorAndrew Tridgell <tridge@samba.org>
Thu, 28 Jul 2005 04:06:54 +0000 (04:06 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:30:08 +0000 (13:30 -0500)
- added timelimit support

source/torture/local/messaging.c

index 22b05a12b5aae1e1aedb911bd2188cfb0d34489d..c9aef1b01df7485f7cbafe1dc532e60d7dbf60ff 100644 (file)
@@ -63,6 +63,7 @@ static BOOL test_ping_speed(TALLOC_CTX *mem_ctx)
        int pong_count = 0;
        BOOL ret = True;
        struct timeval tv;
+       int timelimit = lp_parm_int(-1, "torture", "timelimit", 10);
 
        lp_set_cmdline("lock dir", "lockdir.tmp");
 
@@ -88,8 +89,8 @@ static BOOL test_ping_speed(TALLOC_CTX *mem_ctx)
 
        tv = timeval_current();
 
-       printf("Sending pings for 10 seconds\n");
-       while (timeval_elapsed(&tv) < 10.0) {
+       printf("Sending pings for %d seconds\n", timelimit);
+       while (timeval_elapsed(&tv) < timelimit) {
                DATA_BLOB data;
                NTSTATUS status1, status2;
 
@@ -150,5 +151,5 @@ BOOL torture_local_messaging(void)
 
        talloc_free(mem_ctx);
 
-       return True;
+       return ret;
 }