[Pkg-nagios-changes] [pkg-mod-gearman] 27/48: make full test more verbose

Stig Sandbeck Mathisen ssm at debian.org
Sun Nov 24 22:38:10 UTC 2013


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository pkg-mod-gearman.

commit 39374f58c7d58dd6b1ff23af3618d9dcdba9a80f
Author: Sven Nierlein <sven at nierlein.de>
Date:   Fri Nov 1 15:43:24 2013 +0100

    make full test more verbose
---
 t/02-full.c | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/t/02-full.c b/t/02-full.c
index 1046e19..41d660f 100644
--- a/t/02-full.c
+++ b/t/02-full.c
@@ -317,11 +317,31 @@ char* my_tmpfile() {
     return sfn;
 }
 
+void check_no_worker_running(char*);
+void check_no_worker_running(char* worker_logfile) {
+    char cmd[150];
+    char *result, *error;
+    int rrc;
+
+    // ensure no worker are running anymore
+    char *username=getenv("USER");
+    snprintf(cmd, 150, "ps -efl | grep -v grep | grep '%s' | grep mod_gearman_worker", username);
+    rrc = real_exit_code(run_check(cmd, &result, &error));
+    ok(rrc == 1, "no worker running anymore");
+    like(result, "^\\s*$", "ps output should be empty");
+    like(error, "^\\s*$", "ps error output should be empty");
+    if(rrc != 1) {
+        check_logfile(worker_logfile, 3);
+    }
+    return;
+}
+
+
 /* main tests */
 int main (int argc, char **argv, char **env) {
     argc = argc; argv = argv; env  = env;
     int status, chld, rc;
-    int tests = 92;
+    int tests = 110;
     int rrc;
     char cmd[150];
     char *result, *error, *message, *output;
@@ -419,6 +439,7 @@ int main (int argc, char **argv, char **env) {
     ok(status == 0, "worker exited with exit code %d", real_exit_code(status));
     status = 0;
     check_logfile(worker_logfile, 0);
+    check_no_worker_running(worker_logfile);
 
     char * test_keys[] = {
         "12345",
@@ -452,6 +473,7 @@ int main (int argc, char **argv, char **env) {
         ok(status == 0, "worker exited with exit code %d", real_exit_code(status));
         status = 0;
         check_logfile(worker_logfile, 0);
+        check_no_worker_running(worker_logfile);
     }
 
     /*****************************************
@@ -524,6 +546,7 @@ int main (int argc, char **argv, char **env) {
     waitpid(worker_pid, &status, 0);
     ok(status == 0, "worker exited with exit code %d", real_exit_code(status));
     check_logfile(worker_logfile, 2);
+    check_no_worker_running(worker_logfile);
     status = 0;
 
 #ifdef EMBEDDEDPERL

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-nagios/pkg-mod-gearman



More information about the Pkg-nagios-changes mailing list