X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-ovsdb.c;h=ede792262e443c8fe5ee108c799e9511065650fa;hb=ff8decf1a318b4a611cb08bb3f12833044e8a872;hp=a0476a922becb52570a2410b7ab415da7a9ddab4;hpb=e9f8f9367e9e654b9582279608af86ea3744a2a0;p=openvswitch diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c index a0476a92..ede79226 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c @@ -1553,6 +1553,7 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) char *cmd, *save_ptr1 = NULL; struct ovsdb_idl_txn *txn; enum ovsdb_idl_txn_status status; + bool increment = false; txn = ovsdb_idl_txn_create(idl); for (cmd = strtok_r(commands, ",", &save_ptr1); cmd; @@ -1614,6 +1615,12 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) "i=%d", atoi(arg1)); } idltest_simple_delete(s); + } else if (!strcmp(name, "increment")) { + if (!arg2 || arg3) { + ovs_fatal(0, "\"set\" command requires 2 arguments"); + } + ovsdb_idl_txn_increment(txn, arg1, arg2, NULL); + increment = true; } else { ovs_fatal(0, "unknown command %s", name); } @@ -1625,8 +1632,13 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) ovsdb_idl_txn_wait(txn); poll_block(); } - printf("%03d: commit, status=%s\n", + printf("%03d: commit, status=%s", step, ovsdb_idl_txn_status_to_string(status)); + if (increment) { + printf(", increment=%"PRId64, + ovsdb_idl_txn_get_increment_new_value(txn)); + } + putchar('\n'); ovsdb_idl_txn_destroy(txn); }