X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-reconnect.c;h=0f49d7f5847c0bc590a7ca279b35b17d24e76b67;hb=246f5b5edee9a35d8126a1d15c4f43328cf38570;hp=93991ff56ba82ed9a59b9e23feafdd24c9029dee;hpb=c69ee87c10818267f991236201150b1fa51ae519;p=openvswitch diff --git a/tests/test-reconnect.c b/tests/test-reconnect.c index 93991ff5..0f49d7f5 100644 --- a/tests/test-reconnect.c +++ b/tests/test-reconnect.c @@ -27,6 +27,7 @@ #include "compiler.h" #include "svec.h" #include "util.h" +#include "vlog.h" static struct reconnect *reconnect; static int now; @@ -39,11 +40,14 @@ static void diff_stats(const struct reconnect_stats *old, int main(void) { + extern struct vlog_module VLM_reconnect; struct reconnect_stats prev; unsigned int old_max_tries; int old_time; char line[128]; + vlog_set_levels(&VLM_reconnect, VLF_ANY_FACILITY, VLL_EMER); + now = 1000; reconnect = reconnect_create(now); reconnect_set_name(reconnect, "remote"); @@ -235,6 +239,24 @@ diff_stats(const struct reconnect_stats *old, } } +static void +do_set_passive(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +{ + reconnect_set_passive(reconnect, true, now); +} + +static void +do_listening(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) +{ + reconnect_listening(reconnect, now); +} + +static void +do_listen_error(int argc OVS_UNUSED, char *argv[]) +{ + reconnect_listen_error(reconnect, now, atoi(argv[1])); +} + static const struct command commands[] = { { "enable", 0, 0, do_enable }, { "disable", 0, 0, do_disable }, @@ -248,6 +270,9 @@ static const struct command commands[] = { { "advance", 1, 1, do_advance }, { "timeout", 0, 0, do_timeout }, { "set-max-tries", 1, 1, do_set_max_tries }, + { "passive", 0, 0, do_set_passive }, + { "listening", 0, 0, do_listening }, + { "listen-error", 1, 1, do_listen_error }, { NULL, 0, 0, NULL }, };