Reviewed-by: Steven Dake <sdake@xxxxxxxxxx> On 01/24/2012 06:15 AM, Angus Salkeld wrote: > Signed-off-by: Angus Salkeld <asalkeld@xxxxxxxxxx> > --- > cts/agents/sam_test_agent.c | 70 ++++++++++++++++++------------------ > cts/agents/votequorum_test_agent.c | 8 ++-- > 2 files changed, 39 insertions(+), 39 deletions(-) > > diff --git a/cts/agents/sam_test_agent.c b/cts/agents/sam_test_agent.c > index 58c41b3..7863f1f 100644 > --- a/cts/agents/sam_test_agent.c > +++ b/cts/agents/sam_test_agent.c > @@ -615,7 +615,7 @@ static int test5 (void) > static void test6_signal (int sig) { > cs_error_t error; > > - qb_log (LOG_INFO, "%s"); > + qb_enter(); > test6_sig_delivered++; > > if ((error = sam_data_store (&test6_sig_delivered, sizeof (test6_sig_delivered))) != CS_OK) { > @@ -653,17 +653,17 @@ static int test6 (void) { > > signal (SIGUSR1, test6_signal); > > - qb_log (LOG_INFO, "%s iid %d: start", instance_id); > + qb_log (LOG_INFO, " iid %d: start", instance_id); > error = sam_start (); > if (error != CS_OK) { > qb_log (LOG_ERR, "Can't start hc. Error %d", error); > return 1; > } > > - qb_log (LOG_INFO, "%s iid %d: sleep 1", instance_id); > + qb_log (LOG_INFO, "iid %d: sleep 1", instance_id); > sleep (1); > > - qb_log (LOG_INFO, "%s iid %d: hc send", instance_id); > + qb_log (LOG_INFO, "iid %d: hc send", instance_id); > error = sam_hc_send (); > if (error != CS_OK) { > qb_log (LOG_ERR, "Can't send hc. Error %d", error); > @@ -671,16 +671,16 @@ static int test6 (void) { > } > > > - qb_log (LOG_INFO, "%s iid %d: wait for delivery of signal", instance_id); > + qb_log (LOG_INFO, "iid %d: wait for delivery of signal", instance_id); > while (!test6_sig_delivered) { > sleep (1); > } > > - qb_log (LOG_INFO, "%s iid %d: wait for real kill", instance_id); > + qb_log (LOG_INFO, "iid %d: wait for real kill", instance_id); > > sleep (3); > > - qb_log (LOG_INFO, "%s iid %d: wasn't killed", instance_id); > + qb_log (LOG_INFO, "iid %d: wasn't killed", instance_id); > return (1); > } > > @@ -711,10 +711,10 @@ static int test6 (void) { > return 1; > } > > - qb_log (LOG_INFO, "%s iid %d: sleep 1", instance_id); > + qb_log (LOG_INFO, "iid %d: sleep 1", instance_id); > sleep (1); > > - qb_log (LOG_INFO, "%s iid %d: hc send", instance_id); > + qb_log (LOG_INFO, "iid %d: hc send", instance_id); > error = sam_hc_send (); > if (error != CS_OK) { > qb_log (LOG_ERR, "Can't send hc. Error %d", error); > @@ -722,7 +722,7 @@ static int test6 (void) { > } > > > - qb_log (LOG_INFO, "%s iid %d: wait for delivery of signal", instance_id); > + qb_log (LOG_INFO, "iid %d: wait for delivery of signal", instance_id); > while (!test6_sig_delivered) { > sleep (1); > } > @@ -812,14 +812,14 @@ static int test_quorum (void) { > */ > pthread_create (&kill_thread, NULL, test7_thread, NULL); > > - qb_log (LOG_INFO, "%s iid %d: start - should block forever (waiting 5s)", instance_id); > + qb_log (LOG_INFO, "iid %d: start - should block forever (waiting 5s)", instance_id); > err = sam_start (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't start hc. Error %d", err); > return 2; > } > > - qb_log (LOG_INFO, "%s iid %d: wasn't killed", instance_id); > + qb_log (LOG_INFO, "iid %d: wasn't killed", instance_id); > return (2); > } > > @@ -833,7 +833,7 @@ static int test_quorum (void) { > return (2); > } > > - qb_log (LOG_INFO, "%s iid %d: start", instance_id); > + qb_log (LOG_INFO, "iid %d: start", instance_id); > err = sam_start (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't start hc. Error %d", err); > @@ -849,10 +849,10 @@ static int test_quorum (void) { > return (2); > } > > - qb_log (LOG_INFO, "%s iid %d: sleep 3", instance_id); > + qb_log (LOG_INFO, "iid %d: sleep 3", instance_id); > sleep (3); > > - qb_log (LOG_INFO, "%s iid %d: wasn't killed", instance_id); > + qb_log (LOG_INFO, "iid %d: wasn't killed", instance_id); > return (2); > } > > @@ -881,13 +881,13 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > return (1); > } > > - qb_log (LOG_INFO, "%s test %d", test_n); > + qb_log (LOG_INFO, "test %d", test_n); > > if (test_n == 2) { > /* > * Object should not exist > */ > - qb_log (LOG_INFO, "%s Testing if object exists (it shouldn't)"); > + qb_log (LOG_INFO, "Testing if object exists (it shouldn't)"); > > snprintf(key_name, CMAP_KEYNAME_MAXLEN, "resources.process.%d.state", pid); > err = cmap_get_string(cmap_handle, key_name, &str); > @@ -939,7 +939,7 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > } > free(str); > > - qb_log (LOG_INFO, "%s iid %d: start", instance_id); > + qb_log (LOG_INFO, "iid %d: start", instance_id); > err = sam_start (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't start hc. Error %d", err); > @@ -958,7 +958,7 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > } > free(str); > > - qb_log (LOG_INFO, "%s iid %d: stop", instance_id); > + qb_log (LOG_INFO, "iid %d: stop", instance_id); > err = sam_stop (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't stop hc. Error %d", err); > @@ -977,7 +977,7 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > } > free(str); > > - qb_log (LOG_INFO, "%s iid %d: sleeping 5", instance_id); > + qb_log (LOG_INFO, "iid %d: sleeping 5", instance_id); > sleep (5); > > err = cmap_get_string(cmap_handle, key_name, &str); > @@ -992,7 +992,7 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > } > free(str); > > - qb_log (LOG_INFO, "%s iid %d: start 2", instance_id); > + qb_log (LOG_INFO, "iid %d: start 2", instance_id); > err = sam_start (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't start hc. Error %d", err); > @@ -1012,12 +1012,12 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > free(str); > > if (test_n == 2) { > - qb_log (LOG_INFO, "%s iid %d: sleeping 5. Should be killed", instance_id); > + qb_log (LOG_INFO, "iid %d: sleeping 5. Should be killed", instance_id); > sleep (5); > > return (2); > } else { > - qb_log (LOG_INFO, "%s iid %d: Test HC", instance_id); > + qb_log (LOG_INFO, "iid %d: Test HC", instance_id); > err = sam_hc_send (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't send hc. Error %d", err); > @@ -1030,7 +1030,7 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > qb_log (LOG_INFO, "Could not get \"last_updated\" key: %d.", err); > return (2); > } > - qb_log (LOG_INFO, "%s iid %d: Sleep 1", instance_id); > + qb_log (LOG_INFO, "iid %d: Sleep 1", instance_id); > sleep (1); > err = sam_hc_send (); > if (err != CS_OK) { > @@ -1050,7 +1050,7 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > return (2); > } > > - qb_log (LOG_INFO, "%s iid %d: stop 2", instance_id); > + qb_log (LOG_INFO, "iid %d: stop 2", instance_id); > err = sam_stop (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't stop hc. Error %d", err); > @@ -1070,13 +1070,13 @@ static int test8 (pid_t pid, pid_t old_pid, int test_n) { > } > free(str); > > - qb_log (LOG_INFO, "%s iid %d: exiting", instance_id); > + qb_log (LOG_INFO, "iid %d: exiting", instance_id); > return (0); > } > } > > if (test_n == 3) { > - qb_log (LOG_INFO, "%s Testing if status is failed"); > + qb_log (LOG_INFO, "Testing if status is failed"); > > /* > * Previous should be FAILED > @@ -1116,7 +1116,7 @@ static int test9 (pid_t pid, pid_t old_pid, int test_n) { > return (1); > } > > - qb_log (LOG_INFO, "%s test %d", test_n); > + qb_log (LOG_INFO, "test %d", test_n); > > if (test_n == 1) { > qb_log (LOG_INFO, " initialize"); > @@ -1161,7 +1161,7 @@ static int test9 (pid_t pid, pid_t old_pid, int test_n) { > } > free(str); > > - qb_log (LOG_INFO, "%s iid %d: start", instance_id); > + qb_log (LOG_INFO, "iid %d: start", instance_id); > err = sam_start (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't start hc. Error %d", err); > @@ -1180,14 +1180,14 @@ static int test9 (pid_t pid, pid_t old_pid, int test_n) { > } > free(str); > > - qb_log (LOG_INFO, "%s iid %d: waiting for kill", instance_id); > + qb_log (LOG_INFO, "iid %d: waiting for kill", instance_id); > sleep (10); > > return (2); > } > > if (instance_id == 3) { > - qb_log (LOG_INFO, "%s iid %d: mark failed", instance_id); > + qb_log (LOG_INFO, "iid %d: mark failed", instance_id); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't start hc. Error %d", err); > return 2; > @@ -1207,7 +1207,7 @@ static int test9 (pid_t pid, pid_t old_pid, int test_n) { > } > > if (test_n == 2) { > - qb_log (LOG_INFO, "%s Testing if status is failed"); > + qb_log (LOG_INFO, "Testing if status is failed"); > > /* > * Previous should be FAILED > @@ -1233,7 +1233,7 @@ static int test9 (pid_t pid, pid_t old_pid, int test_n) { > > static int hc_allways_respond_cb(void) > { > - qb_log (LOG_INFO, "%s() -> health check OK."); > + qb_log (LOG_INFO, "health check OK."); > return 0; > } > > @@ -1256,7 +1256,7 @@ static int setup_hc (void) > } > err = sam_hc_callback_register (hc_allways_respond_cb); > > - qb_log (LOG_INFO, "%s instance id %d: start", instance_id); > + qb_log (LOG_INFO, "instance id %d: start", instance_id); > err = sam_start (); > if (err != CS_OK) { > qb_log (LOG_ERR, "Can't start hc. Error %d", err); > @@ -1342,7 +1342,7 @@ static void do_command (int sock, char* func, char*args[], int num_args) > snprintf (response, 100, "%s", OK_STR); > } else if (err == 1) { > snprintf (response, 100, "%s", FAIL_STR); > - qb_log (LOG_ERR, "%s() test skipped?! (%d).", func, err); > + qb_log (LOG_ERR, "test skipped?! (%d).", func, err); > } else { > snprintf (response, 100, "%s", FAIL_STR); > qb_log (LOG_ERR, "%s() failed (%d).", func, err); > diff --git a/cts/agents/votequorum_test_agent.c b/cts/agents/votequorum_test_agent.c > index 89cd00a..fa310e3 100644 > --- a/cts/agents/votequorum_test_agent.c > +++ b/cts/agents/votequorum_test_agent.c > @@ -85,8 +85,8 @@ static int vq_dispatch_wrapper_fn ( > { > cs_error_t error = votequorum_dispatch (vq_handle, CS_DISPATCH_ALL); > if (error != CS_OK) { > - qb_log (LOG_ERR, "%s() got %s error, disconnecting.", > - __func__, cs_strerror(error)); > + qb_log (LOG_ERR, "got %s error, disconnecting.", > + cs_strerror(error)); > votequorum_finalize(vq_handle); > qb_loop_poll_del (ta_poll_handle_get(), fd); > close (fd); > @@ -103,8 +103,8 @@ static int q_dispatch_wrapper_fn ( > { > cs_error_t error = quorum_dispatch (q_handle, CS_DISPATCH_ALL); > if (error != CS_OK) { > - qb_log (LOG_ERR, "%s() got %s error, disconnecting.", > - __func__, cs_strerror(error)); > + qb_log (LOG_ERR, "got %s error, disconnecting.", > + cs_strerror(error)); > quorum_finalize(q_handle); > qb_loop_poll_del (ta_poll_handle_get(), fd); > close (fd); _______________________________________________ discuss mailing list discuss@xxxxxxxxxxxx http://lists.corosync.org/mailman/listinfo/discuss