From 5811f42f82becb0310c3e0b7c0b6af1bc8cce417 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Fri, 13 Nov 2009 19:55:11 +0000 Subject: [PATCH] Update test script (cleanup only manually), tuning debug output. --- org.glite.lb.harvester/examples/test.sh | 24 ++++++++++++++++++++++++ org.glite.lb.harvester/src/harvester.c | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/org.glite.lb.harvester/examples/test.sh b/org.glite.lb.harvester/examples/test.sh index b6d5753..7105ee1 100755 --- a/org.glite.lb.harvester/examples/test.sh +++ b/org.glite.lb.harvester/examples/test.sh @@ -347,6 +347,22 @@ start_harvester() { } +cleanup_harvester() { + echo -n "cleaning up..." + X509_USER_KEY=${X509_USER_KEY} X509_USER_CERT=${X509_USER_CERT} \ + ${rtm} \ + -m $GLITE_RTM_TEST_DB \ + --cleanup \ + --debug 12 ${GLITE_RTM_TEST_ADDITIONAL_ARGS} >`pwd`/RTM/glite-rtm-test-cleanup.log 2>&1 + if [ x"$?" != x"0" ]; then + cat `pwd`/RTM/glite-rtm-test-cleanup.log + echo FAILED + return 1 + fi + echo -n "OK " +} + + kill_daemons() { pid1=`cat ${GLITE_LB_TEST_PIDFILE} 2>/dev/null` [ -f "${GLITE_RTM_TEST_PIDFILE}" ] && pid2=`cat ${GLITE_RTM_TEST_PIDFILE}` @@ -606,6 +622,14 @@ test_cleanup() { return 0 fi + echo -n "$n_notifs notifications..." + my_get "SELECT notifid FROM notif_registrations" || return 1 + if [ "$lines" != "$n_notifs" ]; then + echo "FAIL" + return 0 + fi + + cleanup_harvester || return $? echo -n "0 notifications..." my_get "SELECT notifid FROM notif_registrations" || return 1 if [ "$lines" != "0" ]; then diff --git a/org.glite.lb.harvester/src/harvester.c b/org.glite.lb.harvester/src/harvester.c index 6945ee3..7af1b5e 100644 --- a/org.glite.lb.harvester/src/harvester.c +++ b/org.glite.lb.harvester/src/harvester.c @@ -1644,7 +1644,7 @@ void *notify_thread(void *thread_data) { i--; continue; } - lprintf(t, INF, "bound %d. notification '%s' (%s)", i, notif->id_str, rtm_notiftype2str(notif->type)); + lprintf(t, INF, "bound %d. notification '%s' (%s), valid: %s", i, notif->id_str, rtm_notiftype2str(notif->type), time2str(t, notif->valid)); rtm_update_error_state(t, notif, i, 0); // no bootstrap here, reliable delivery will send changes updated = 1; @@ -1994,6 +1994,7 @@ int config_preload(int argn, char *argv[]) { if (INF <= config.debug) { lprintf(NULL, INF, "threads: %d", config.nthreads); + lprintf(NULL, INF, "notifs ttl: %d", config.ttl); lprintf(NULL, INF, "historic dive: %d", config.dive); if (config.dbcs) { lprintf(NULL, INF, "database storage: '%s'", config.dbcs); -- 1.8.2.3