From 628ff1bea3e167e2d45dffbffb3c4fffaa3d1916 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sun, 29 Apr 2007 21:37:29 +0000 Subject: r22579: disable progress printing in the build-farm metze (This used to be commit 93089ad5e8b6e20c4fa92bf13b0137765aeac689) --- source4/torture/basic/base.c | 4 +++- source4/torture/basic/denytest.c | 6 ++++-- source4/torture/basic/mangle_test.c | 6 ++++-- source4/torture/basic/misc.c | 27 ++++++++++++++++++++------- source4/torture/basic/utable.c | 5 ++++- source4/torture/ldap/cldapbench.c | 9 ++++++--- source4/torture/local/iconv.c | 2 ++ source4/torture/nbt/query.c | 9 ++++++--- source4/torture/nbt/winsbench.c | 9 ++++++--- source4/torture/raw/composite.c | 24 ++++++++++++++++-------- source4/torture/raw/lockbench.c | 7 +++++-- source4/torture/raw/openbench.c | 8 +++++--- source4/torture/raw/oplock.c | 5 ++++- source4/torture/rpc/bench.c | 6 ++++-- source4/torture/rpc/rpc.c | 1 + 15 files changed, 90 insertions(+), 38 deletions(-) diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index dcec1bbfb5..5fdc2cf421 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -567,7 +567,9 @@ static BOOL rw_torture2(struct torture_context *tctx, { size_t buf_size = ((uint_t)random()%(sizeof(buf)-1))+ 1; if (i % 10 == 0) { - torture_comment(tctx, "%d\r", i); fflush(stdout); + if (torture_setting_bool(tctx, "progress", true)) { + torture_comment(tctx, "%d\r", i); fflush(stdout); + } } generate_random_buffer(buf, buf_size); diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 3d91058174..19431ae360 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1402,8 +1402,10 @@ static const struct { static void progress_bar(struct torture_context *tctx, uint_t i, uint_t total) { - torture_comment(tctx, "%5d/%5d\r", i, total); - fflush(stdout); + if (torture_setting_bool(tctx, "progress", true)) { + torture_comment(tctx, "%5d/%5d\r", i, total); + fflush(stdout); + } } /* diff --git a/source4/torture/basic/mangle_test.c b/source4/torture/basic/mangle_test.c index 68ee0b63f5..98a0d07efb 100644 --- a/source4/torture/basic/mangle_test.c +++ b/source4/torture/basic/mangle_test.c @@ -184,8 +184,10 @@ BOOL torture_mangle(struct torture_context *torture, break; } if (total && total % 100 == 0) { - printf("collisions %u/%u - %.2f%% (%u failures)\r", - collisions, total, (100.0*collisions) / total, failures); + if (torture_setting_bool(torture, "progress", true)) { + printf("collisions %u/%u - %.2f%% (%u failures)\r", + collisions, total, (100.0*collisions) / total, failures); + } } } diff --git a/source4/torture/basic/misc.c b/source4/torture/basic/misc.c index 9467d2fc3c..33f0b9eff6 100644 --- a/source4/torture/basic/misc.c +++ b/source4/torture/basic/misc.c @@ -71,7 +71,10 @@ static BOOL rw_torture(struct torture_context *tctx, struct smbcli_state *c) for (i=0;itree, fname); if (c % 100 == 0) { - torture_comment(tctx, "%d (%d/%d)\r", c, chars_allowed, alt_allowed); + if (torture_setting_bool(tctx, "progress", true)) { + torture_comment(tctx, "%d (%d/%d)\r", c, chars_allowed, alt_allowed); + fflush(stdout); + } } } torture_comment(tctx, "%d (%d/%d)\n", c, chars_allowed, alt_allowed); diff --git a/source4/torture/ldap/cldapbench.c b/source4/torture/ldap/cldapbench.c index 99ab69cee4..68a23ab119 100644 --- a/source4/torture/ldap/cldapbench.c +++ b/source4/torture/ldap/cldapbench.c @@ -76,9 +76,12 @@ static BOOL bench_cldap(TALLOC_CTX *mem_ctx, const char *address) req->async.fn = request_handler; num_sent++; if (num_sent % 50 == 0) { - printf("%.1f queries per second (%d failures) \r", - state->pass_count / timeval_elapsed(&tv), - state->fail_count); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("%.1f queries per second (%d failures) \r", + state->pass_count / timeval_elapsed(&tv), + state->fail_count); + fflush(stdout); + } } } diff --git a/source4/torture/local/iconv.c b/source4/torture/local/iconv.c index f21bacf4bb..4c96d075c0 100644 --- a/source4/torture/local/iconv.c +++ b/source4/torture/local/iconv.c @@ -315,6 +315,7 @@ static bool test_first_1m(struct torture_context *tctx) if (codepoint % 1000 == 0) { if (torture_setting_bool(tctx, "progress", True)) { torture_comment(tctx, "codepoint=%u \r", codepoint); + fflush(stdout); } } @@ -335,6 +336,7 @@ static bool test_random_5m(struct torture_context *tctx) if (i % 1000 == 0) { if (torture_setting_bool(tctx, "progress", true)) { torture_comment(tctx, "i=%u \r", i); + fflush(stdout); } } diff --git a/source4/torture/nbt/query.c b/source4/torture/nbt/query.c index e0bea2775c..8f5ea811e1 100644 --- a/source4/torture/nbt/query.c +++ b/source4/torture/nbt/query.c @@ -78,9 +78,12 @@ static bool bench_namequery(struct torture_context *tctx) req->async.private = result; num_sent++; if (num_sent % 1000 == 0) { - torture_comment(tctx, "%.1f queries per second (%d failures) \r", - result->num_pass / timeval_elapsed(&tv), - result->num_fail); + if (torture_setting_bool(tctx, "progress", true)) { + torture_comment(tctx, "%.1f queries per second (%d failures) \r", + result->num_pass / timeval_elapsed(&tv), + result->num_fail); + fflush(stdout); + } } } diff --git a/source4/torture/nbt/winsbench.c b/source4/torture/nbt/winsbench.c index dc349cb1eb..6a9d265404 100644 --- a/source4/torture/nbt/winsbench.c +++ b/source4/torture/nbt/winsbench.c @@ -254,9 +254,12 @@ static bool bench_wins(struct torture_context *tctx) generate_request(nbtsock, state, num_sent % state->num_names); num_sent++; if (num_sent % 50 == 0) { - torture_comment(tctx, "%.1f queries per second (%d failures) \r", - state->pass_count / timeval_elapsed(&tv), - state->fail_count); + if (torture_setting_bool(tctx, "progress", true)) { + torture_comment(tctx, "%.1f queries per second (%d failures) \r", + state->pass_count / timeval_elapsed(&tv), + state->fail_count); + fflush(stdout); + } } } diff --git a/source4/torture/raw/composite.c b/source4/torture/raw/composite.c index 2dd079c4b0..b551af00b1 100644 --- a/source4/torture/raw/composite.c +++ b/source4/torture/raw/composite.c @@ -87,8 +87,10 @@ static BOOL test_loadfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(cli->transport->socket->event.ctx); - printf("count=%d\r", *count); - fflush(stdout); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("count=%d\r", *count); + fflush(stdout); + } } printf("count=%d\n", *count); @@ -175,8 +177,10 @@ static BOOL test_fetchfile(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count != torture_numops) { event_loop_once(event_ctx); - printf("count=%d\r", *count); - fflush(stdout); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("count=%d\r", *count); + fflush(stdout); + } } printf("count=%d\n", *count); @@ -293,8 +297,10 @@ static BOOL test_appendacl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("waiting for completion\n"); while (*count != num_ops) { event_loop_once(event_ctx); - printf("count=%d\r", *count); - fflush(stdout); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("count=%d\r", *count); + fflush(stdout); + } } printf("count=%d\n", *count); @@ -358,8 +364,10 @@ static BOOL test_fsinfo(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) while (*count < torture_numops) { event_loop_once(event_ctx); - printf("count=%d\r", *count); - fflush(stdout); + if (lp_parm_bool(-1, "torture", "progress", true)) { + printf("count=%d\r", *count); + fflush(stdout); + } } printf("count=%d\n", *count); diff --git a/source4/torture/raw/lockbench.c b/source4/torture/raw/lockbench.c index 4dbefd5d9b..3d02e0f5c4 100644 --- a/source4/torture/raw/lockbench.c +++ b/source4/torture/raw/lockbench.c @@ -171,8 +171,11 @@ BOOL torture_bench_lock(struct torture_context *torture) for (i=0;i