X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Ftest-ovsdb.c;h=aca68dcd359e53667242659ba841b4f104d83985;hb=ed4031e4676affcb39962942ff437382d8f30c27;hp=04db65421a29ff1a03b65c2572af4735e2919782;hpb=2a022368f4b37559de5d5621a88c648023493f75;p=openvswitch diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c index 04db6542..aca68dcd 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c @@ -1468,8 +1468,7 @@ do_transact_print(int argc OVS_UNUSED, char *argv[] OVS_UNUSED) n_rows = hmap_count(&do_transact_table->rows); rows = xmalloc(n_rows * sizeof *rows); i = 0; - HMAP_FOR_EACH (row, struct ovsdb_row, hmap_node, - &do_transact_table->rows) { + HMAP_FOR_EACH (row, hmap_node, &do_transact_table->rows) { rows[i++] = row; } assert(i == n_rows); @@ -1780,9 +1779,36 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) "i=%d", atoi(arg1)); } idltest_simple_delete(s); + } else if (!strcmp(name, "verify")) { + const struct idltest_simple *s; + + if (!arg2 || arg3) { + ovs_fatal(0, "\"verify\" command requires 2 arguments"); + } + + s = idltest_find_simple(idl, atoi(arg1)); + if (!s) { + ovs_fatal(0, "\"verify\" command asks for nonexistent " + "i=%d", atoi(arg1)); + } + + if (!strcmp(arg2, "i")) { + idltest_simple_verify_i(s); + } else if (!strcmp(arg2, "b")) { + idltest_simple_verify_b(s); + } else if (!strcmp(arg2, "s")) { + idltest_simple_verify_s(s); + } else if (!strcmp(arg2, "u")) { + idltest_simple_verify_s(s); + } else if (!strcmp(arg2, "r")) { + idltest_simple_verify_r(s); + } else { + ovs_fatal(0, "\"verify\" command asks for unknown column %s", + arg2); + } } else if (!strcmp(name, "increment")) { if (!arg2 || arg3) { - ovs_fatal(0, "\"set\" command requires 2 arguments"); + ovs_fatal(0, "\"increment\" command requires 2 arguments"); } ovsdb_idl_txn_increment(txn, arg1, arg2, NULL); increment = true; @@ -1816,7 +1842,7 @@ do_idl(int argc, char *argv[]) idltest_init(); - idl = ovsdb_idl_create(argv[1], &idltest_idl_class); + idl = ovsdb_idl_create(argv[1], &idltest_idl_class, true); if (argc > 2) { struct stream *stream;