summaryrefslogtreecommitdiff
path: root/tests/test-ovsdb.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2017-12-28 13:21:11 -0800
committerBen Pfaff <blp@ovn.org>2018-03-24 12:04:52 -0700
commit53178986d7fc86bcfc2f297b547a97ee71a21bb7 (patch)
treebc01be74235a8c3e2cb80180f64c0ef61fac0ab3 /tests/test-ovsdb.c
parent10621d795331a3ddddb3e96086a9fda7ad156efc (diff)
downloadopenvswitch-53178986d7fc86bcfc2f297b547a97ee71a21bb7.tar.gz
ovsdb: Add support for online schema conversion.
With this change, "ovsdb-client convert" can be used to convert a database from one schema to another without taking the database offline. This can be useful to minimize downtime for a database during a software upgrade. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'tests/test-ovsdb.c')
-rw-r--r--tests/test-ovsdb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c
index c0c5a4df5..8502ad73f 100644
--- a/tests/test-ovsdb.c
+++ b/tests/test-ovsdb.c
@@ -1522,14 +1522,14 @@ struct test_trigger {
static void
do_trigger_dump(struct test_trigger *t, long long int now, const char *title)
{
- struct json *result;
+ struct jsonrpc_msg *reply;
char *s;
- result = ovsdb_trigger_steal_result(&t->trigger);
- s = json_to_string(result, JSSF_SORT);
+ reply = ovsdb_trigger_steal_reply(&t->trigger);
+ s = json_to_string(reply->result, JSSF_SORT);
printf("t=%lld: trigger %d (%s): %s\n", now, t->number, title, s);
free(s);
- json_destroy(result);
+ jsonrpc_msg_destroy(reply);
ovsdb_trigger_destroy(&t->trigger);
free(t);
}
@@ -1569,8 +1569,10 @@ do_trigger(struct ovs_cmdl_context *ctx)
json_destroy(params);
} else {
struct test_trigger *t = xmalloc(sizeof *t);
- ovsdb_trigger_init(&session, db, &t->trigger, params, now, false,
- NULL, NULL);
+ ovsdb_trigger_init(&session, db, &t->trigger,
+ jsonrpc_create_request("transact", params,
+ NULL),
+ now, false, NULL, NULL);
t->number = number++;
if (ovsdb_trigger_is_complete(&t->trigger)) {
do_trigger_dump(t, now, "immediate");