Browse Source

* more changes in backend test util

master
Alex 'AdUser' Z 8 years ago
parent
commit
81db1b8dca
  1. 15
      src/backend-test.c

15
src/backend-test.c

@ -41,18 +41,19 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
if (!backend->ban(backend->cfg, ip)) {
f2b_log_msg(log_error, "action 'ban' failed");
if (!f2b_backend_ban(backend, ip)) {
f2b_log_msg(log_error, "action 'ban' failed: %s", f2b_backend_error(backend));
goto cleanup;
}
if (!backend->check(backend->cfg, ip)) {
f2b_log_msg(log_error, "action 'check' failed");
goto cleanup;
if (f2b_backend_check(backend, ip)) {
f2b_log_msg(log_info, "action 'check' failed returned true");
} else {
f2b_log_msg(log_info, "action 'check' failed returned false");
}
if (!backend->unban(backend->cfg, ip)) {
f2b_log_msg(log_error, "action 'unban' failed");
if (f2b_backend_unban(backend, ip)) {
f2b_log_msg(log_error, "action 'unban' failed: %s", f2b_backend_error(backend));
goto cleanup;
}

Loading…
Cancel
Save