[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bbcombotest patch
- To: hobbit (at) hswn.dk
- Subject: bbcombotest patch
- From: Cade Robinson <cade.robinson (at) gmail.com>
- Date: Tue, 02 Mar 2010 14:56:00 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=aX29TCW3TnZ/zmH4KHmCCkR3u4UoKdYReSJdKgzz6fo=; b=jR4EJWvCK2cf4igXgpLhuCWNO4gRjgkUAxSnvyzeo/z/XP7Uwj6zKF2uaZQzh6cTNu FTvUtuO66UNjfd8WWDBJtqytv2V8N5RD213gPYiExqMiUhMlIfLRkHoJ9BCvbDzhcsZf twYtyWmEPxzIYU75a6c3z882S2QHbakTbk2zw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=YdjY3YRWc/4sZOvp5Sc4Ck79/FGY0PP9a4HDv87OZzp9c1faLL5W3HIigJ6E/QHJKE oXcWtOuN5PcUKu/M4YOGoNFGAD1EPuYqXF09wXe4Q79XoKM57cI5r/i77tP4nehBHMPN qUw2RHu6YS3UGfPiyEL258k67gBUL2xUEjZUY=
bbcombotest in 4.4.0 (probably 4.3.0 too) was failing for me with the
error:
Could not access hobbitd board, error 0
I found that line:
if ((hobbitdresult != BB_OK) || (board == NULL)) {
always evaled true due to board being set to NULL at the start of the
function and then never being set again.
Also I didn't like that a yellow status didn't trip the combo test
color, so that is the last part.
So here is a patch:
Index: bbcombotest.c
===================================================================
--- bbcombotest.c (revision 6223)
+++ bbcombotest.c (working copy)
@@ -209,20 +209,16 @@
int result = COL_CLEAR;
char *pattern, *found, *colstr;
- if (board == NULL) {
sendreturn_t *sres = newsendreturnbuf(1, NULL);
hobbitdresult = sendmessage("hobbitdboard
fields=hostname,testname,color", NULL, BBTALK_TIMEOUT, sres);
+ board = getsendreturnstr(sres, 1);
if ((hobbitdresult != BB_OK) || (board == NULL)) {
board = "";
*errptr += sprintf(*errptr, "Could not access
hobbitd board, error %d\n", hobbitdresult);
return COL_CLEAR;
}
- else {
- board = getsendreturnstr(sres, 1);
- }
freesendreturnbuf(sres);
- }
pattern = (char *)malloc(1 + strlen(hostname) + 1 +
strlen(testname) + 1 + 1);
sprintf(pattern, "\n%s|%s|", hostname, testname);
@@ -275,7 +271,7 @@
}
if (*color == -1) return -1;
- else return ( (*color == COL_GREEN) || (*color == COL_YELLOW) ||
(*color == COL_CLEAR) );
+ else return ( (*color == COL_GREEN) || (*color == COL_CLEAR) );
}