git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prepare for post-2.2.0 (2.2.90).
[sliver-openvswitch.git]
/
tests
/
test-reconnect.c
diff --git
a/tests/test-reconnect.c
b/tests/test-reconnect.c
index
020ae48
..
35d5f41
100644
(file)
--- a/
tests/test-reconnect.c
+++ b/
tests/test-reconnect.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2009, 2010, 2011, 2012
, 2014
Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-28,18
+28,18
@@
#include "svec.h"
#include "util.h"
#include "vlog.h"
#include "svec.h"
#include "util.h"
#include "vlog.h"
+#include "ovstest.h"
static struct reconnect *reconnect;
static int now;
static struct reconnect *reconnect;
static int now;
-static const struct command commands[];
-
static void diff_stats(const struct reconnect_stats *old,
const struct reconnect_stats *new,
int delta);
static void diff_stats(const struct reconnect_stats *old,
const struct reconnect_stats *new,
int delta);
+static const struct command *get_all_commands(void);
-int
-
main(void
)
+static void
+
test_reconnect_main(int argc OVS_UNUSED, char *argv[] OVS_UNUSED
)
{
extern struct vlog_module VLM_reconnect;
struct reconnect_stats prev;
{
extern struct vlog_module VLM_reconnect;
struct reconnect_stats prev;
@@
-69,7
+69,7
@@
main(void)
svec_parse_words(&args, line);
svec_terminate(&args);
if (!svec_is_empty(&args)) {
svec_parse_words(&args, line);
svec_terminate(&args);
if (!svec_is_empty(&args)) {
- run_command(args.n, args.names,
commands
);
+ run_command(args.n, args.names,
get_all_commands()
);
}
svec_destroy(&args);
}
svec_destroy(&args);
@@
-87,8
+87,6
@@
main(void)
old_time = now;
}
old_time = now;
}
-
- return 0;
}
static void
}
static void
@@
-166,7
+164,7
@@
do_run(int argc, char *argv[])
switch (action) {
default:
if (action != 0) {
switch (action) {
default:
if (action != 0) {
- NOT_REACHED();
+
OVS_
NOT_REACHED();
}
break;
}
break;
@@
-272,7
+270,7
@@
do_listen_error(int argc OVS_UNUSED, char *argv[])
reconnect_listen_error(reconnect, now, atoi(argv[1]));
}
reconnect_listen_error(reconnect, now, atoi(argv[1]));
}
-static const struct command commands[] = {
+static const struct command
all_
commands[] = {
{ "enable", 0, 0, do_enable },
{ "disable", 0, 0, do_disable },
{ "force-reconnect", 0, 0, do_force_reconnect },
{ "enable", 0, 0, do_enable },
{ "disable", 0, 0, do_disable },
{ "force-reconnect", 0, 0, do_force_reconnect },
@@
-290,3
+288,11
@@
static const struct command commands[] = {
{ "listen-error", 1, 1, do_listen_error },
{ NULL, 0, 0, NULL },
};
{ "listen-error", 1, 1, do_listen_error },
{ NULL, 0, 0, NULL },
};
+
+static const struct command *
+get_all_commands(void)
+{
+ return all_commands;
+}
+
+OVSTEST_REGISTER("test-reconnect", test_reconnect_main);