diff --git a/SOURCES/openvswitch-2.13.0.patch b/SOURCES/openvswitch-2.13.0.patch index 36605d6..4892042 100644 --- a/SOURCES/openvswitch-2.13.0.patch +++ b/SOURCES/openvswitch-2.13.0.patch @@ -82745,11 +82745,16 @@ index 30d1d08eba..00497d940c 100644 struct ovsdb_idl_class { diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c -index 190143f363..1ff9b2bb75 100644 +index 190143f363..2fc8a91e37 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c -@@ -221,7 +221,7 @@ struct ovsdb_idl_db { +@@ -219,9 +219,12 @@ struct ovsdb_idl_db { + + /* Last db txn id, used for fast resync through monitor_cond_since */ struct uuid last_id; ++ struct ovs_list deleted_untracked_rows; /* Stores rows deleted in the ++ * current run, that are not yet ++ * added to the track_list. */ }; -static void ovsdb_idl_db_track_clear(struct ovsdb_idl_db *); @@ -82757,7 +82762,7 @@ index 190143f363..1ff9b2bb75 100644 static void ovsdb_idl_db_add_column(struct ovsdb_idl_db *, const struct ovsdb_idl_column *); static void ovsdb_idl_db_omit(struct ovsdb_idl_db *, -@@ -240,6 +240,10 @@ static void ovsdb_idl_send_monitor_request(struct ovsdb_idl *, +@@ -240,6 +243,10 @@ static void ovsdb_idl_send_monitor_request(struct ovsdb_idl *, struct ovsdb_idl_db *, enum ovsdb_idl_monitor_method); static void ovsdb_idl_db_clear(struct ovsdb_idl_db *db); @@ -82768,7 +82773,34 @@ index 190143f363..1ff9b2bb75 100644 struct ovsdb_idl { struct ovsdb_idl_db server; -@@ -422,9 +426,11 @@ ovsdb_idl_db_init(struct ovsdb_idl_db *db, const struct ovsdb_idl_class *class, +@@ -330,6 +337,7 @@ static void ovsdb_idl_delete_row(struct ovsdb_idl_row *); + static bool ovsdb_idl_modify_row(struct ovsdb_idl_row *, const struct json *); + static bool ovsdb_idl_modify_row_by_diff(struct ovsdb_idl_row *, + const struct json *); ++static void ovsdb_idl_reparse_deleted(struct ovsdb_idl_db *); + + static bool ovsdb_idl_row_is_orphan(const struct ovsdb_idl_row *); + static struct ovsdb_idl_row *ovsdb_idl_row_create__( +@@ -346,6 +354,10 @@ static void ovsdb_idl_row_unparse(struct ovsdb_idl_row *); + static void ovsdb_idl_row_clear_old(struct ovsdb_idl_row *); + static void ovsdb_idl_row_clear_new(struct ovsdb_idl_row *); + static void ovsdb_idl_row_clear_arcs(struct ovsdb_idl_row *, bool destroy_dsts); ++static void ovsdb_idl_row_reparse_backrefs(struct ovsdb_idl_row *); ++static void ovsdb_idl_row_track_change(struct ovsdb_idl_row *, ++ enum ovsdb_idl_change); ++static void ovsdb_idl_row_untrack_change(struct ovsdb_idl_row *); + + static void ovsdb_idl_db_txn_abort_all(struct ovsdb_idl_db *); + static void ovsdb_idl_txn_abort_all(struct ovsdb_idl *); +@@ -379,7 +391,6 @@ ovsdb_idl_db_table_from_class(const struct ovsdb_idl_db *, + static struct ovsdb_idl_table * + ovsdb_idl_table_from_class(const struct ovsdb_idl *, + const struct ovsdb_idl_table_class *); +-static bool ovsdb_idl_track_is_set(struct ovsdb_idl_table *table); + static void ovsdb_idl_send_cond_change(struct ovsdb_idl *idl); + + static void ovsdb_idl_destroy_indexes(struct ovsdb_idl_table *); +@@ -422,15 +433,20 @@ ovsdb_idl_db_init(struct ovsdb_idl_db *db, const struct ovsdb_idl_class *class, = table->change_seqno[OVSDB_IDL_CHANGE_MODIFY] = table->change_seqno[OVSDB_IDL_CHANGE_DELETE] = 0; table->db = db; @@ -82783,7 +82815,16 @@ index 190143f363..1ff9b2bb75 100644 } db->monitor_id = json_array_create_2(json_string_create("monid"), json_string_create(class->database)); -@@ -556,12 +562,15 @@ ovsdb_idl_set_shuffle_remotes(struct ovsdb_idl *idl, bool shuffle) + hmap_init(&db->outstanding_txns); ++ ovs_list_init(&db->deleted_untracked_rows); + } + ++static void add_tracked_change_for_references(struct ovsdb_idl_row *); ++ + /* Creates and returns a connection to database 'remote', which should be in a + * form acceptable to jsonrpc_session_open(). The connection will maintain an + * in-memory replica of the remote database whose schema is described by +@@ -556,12 +572,15 @@ ovsdb_idl_set_shuffle_remotes(struct ovsdb_idl *idl, bool shuffle) static void ovsdb_idl_db_destroy(struct ovsdb_idl_db *db) { @@ -82800,7 +82841,19 @@ index 190143f363..1ff9b2bb75 100644 ovsdb_idl_destroy_indexes(table); shash_destroy(&table->columns); hmap_destroy(&table->rows); -@@ -610,7 +619,6 @@ ovsdb_idl_db_clear(struct ovsdb_idl_db *db) +@@ -606,11 +625,18 @@ ovsdb_idl_db_clear(struct ovsdb_idl_db *db) + bool changed = false; + size_t i; + ++ /* Process deleted rows, removing them from the 'deleted_untracked_rows' ++ * list and reparsing their backrefs. ++ */ ++ ovsdb_idl_reparse_deleted(db); ++ ++ /* Cleanup all rows; each row gets added to its own table's ++ * 'track_list'. ++ */ + for (i = 0; i < db->class_->n_tables; i++) { struct ovsdb_idl_table *table = &db->tables[i]; struct ovsdb_idl_row *row, *next_row; @@ -82808,18 +82861,39 @@ index 190143f363..1ff9b2bb75 100644 if (hmap_is_empty(&table->rows)) { continue; } -@@ -634,9 +642,8 @@ ovsdb_idl_db_clear(struct ovsdb_idl_db *db) +@@ -624,19 +650,27 @@ ovsdb_idl_db_clear(struct ovsdb_idl_db *db) + ovsdb_idl_row_unparse(row); + } + LIST_FOR_EACH_SAFE (arc, next_arc, src_node, &row->src_arcs) { ++ ovs_list_remove(&arc->src_node); ++ ovs_list_remove(&arc->dst_node); ++ free(arc); ++ } ++ LIST_FOR_EACH_SAFE (arc, next_arc, dst_node, &row->dst_arcs) { ++ ovs_list_remove(&arc->src_node); ++ ovs_list_remove(&arc->dst_node); + free(arc); + } +- /* No need to do anything with dst_arcs: some node has those arcs +- * as forward arcs and will destroy them itself. */ + + ovsdb_idl_row_destroy(row); + } } ++ ++ /* Free rows deleted from tables with change tracking disabled. */ ovsdb_idl_row_destroy_postprocess(db); - db->cond_changed = false; db->cond_seqno = 0; - ovsdb_idl_db_track_clear(db); ++ /* Free rows deleted from tables with change tracking enabled. */ + ovsdb_idl_db_track_clear(db, true); ++ ovs_assert(ovs_list_is_empty(&db->deleted_untracked_rows)); if (changed) { db->change_seqno++; -@@ -692,6 +699,12 @@ ovsdb_idl_send_request(struct ovsdb_idl *idl, struct jsonrpc_msg *request) +@@ -692,6 +726,12 @@ ovsdb_idl_send_request(struct ovsdb_idl *idl, struct jsonrpc_msg *request) static void ovsdb_idl_restart_fsm(struct ovsdb_idl *idl) { @@ -82832,7 +82906,7 @@ index 190143f363..1ff9b2bb75 100644 ovsdb_idl_send_schema_request(idl, &idl->server); ovsdb_idl_transition(idl, IDL_S_SERVER_SCHEMA_REQUESTED); idl->data.monitoring = OVSDB_IDL_NOT_MONITORING; -@@ -799,7 +812,9 @@ ovsdb_idl_process_response(struct ovsdb_idl *idl, struct jsonrpc_msg *msg) +@@ -799,7 +839,9 @@ ovsdb_idl_process_response(struct ovsdb_idl *idl, struct jsonrpc_msg *msg) * do, it's a "monitor_cond_change", which means that the conditional * monitor clauses were updated. * @@ -82843,7 +82917,15 @@ index 190143f363..1ff9b2bb75 100644 ovsdb_idl_send_cond_change(idl); idl->data.cond_seqno++; break; -@@ -1495,35 +1510,66 @@ ovsdb_idl_condition_equals(const struct ovsdb_idl_condition *a, +@@ -912,6 +954,7 @@ ovsdb_idl_run(struct ovsdb_idl *idl) + ovsdb_idl_process_msg(idl, msg); + jsonrpc_msg_destroy(msg); + } ++ ovsdb_idl_reparse_deleted(&idl->data); + ovsdb_idl_row_destroy_postprocess(&idl->data); + } + +@@ -1495,17 +1538,34 @@ ovsdb_idl_condition_equals(const struct ovsdb_idl_condition *a, } static void @@ -82866,9 +82948,9 @@ index 190143f363..1ff9b2bb75 100644 HMAP_FOR_EACH (clause, hmap_node, &src->clauses) { - ovsdb_idl_condition_add_clause__(dst, clause, clause->hmap_node.hash); + ovsdb_idl_condition_add_clause__(*dst, clause, clause->hmap_node.hash); - } - } - ++ } ++} ++ +static void +ovsdb_idl_condition_move(struct ovsdb_idl_condition **dst, + struct ovsdb_idl_condition **src) @@ -82876,13 +82958,13 @@ index 190143f363..1ff9b2bb75 100644 + if (*dst) { + ovsdb_idl_condition_destroy(*dst); + free(*dst); -+ } + } + *dst = *src; + *src = NULL; -+} -+ + } + static unsigned int - ovsdb_idl_db_set_condition(struct ovsdb_idl_db *db, +@@ -1513,17 +1573,31 @@ ovsdb_idl_db_set_condition(struct ovsdb_idl_db *db, const struct ovsdb_idl_table_class *tc, const struct ovsdb_idl_condition *condition) { @@ -82921,7 +83003,7 @@ index 190143f363..1ff9b2bb75 100644 } /* Sets the replication condition for 'tc' in 'idl' to 'condition' and -@@ -1563,9 +1609,8 @@ ovsdb_idl_condition_to_json(const struct ovsdb_idl_condition *cnd) +@@ -1563,9 +1637,8 @@ ovsdb_idl_condition_to_json(const struct ovsdb_idl_condition *cnd) } static struct json * @@ -82932,7 +83014,7 @@ index 190143f363..1ff9b2bb75 100644 struct json *monitor_cond_change_request = json_object_create(); struct json *cond_json = ovsdb_idl_condition_to_json(cond); -@@ -1585,8 +1630,12 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) +@@ -1585,8 +1658,12 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) for (size_t i = 0; i < db->class_->n_tables; i++) { struct ovsdb_idl_table *table = &db->tables[i]; @@ -82947,7 +83029,7 @@ index 190143f363..1ff9b2bb75 100644 if (req) { if (!monitor_cond_change_requests) { monitor_cond_change_requests = json_object_create(); -@@ -1595,7 +1644,11 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) +@@ -1595,7 +1672,11 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) table->class_->name, json_array_create_1(req)); } @@ -82960,7 +83042,7 @@ index 190143f363..1ff9b2bb75 100644 } } -@@ -1610,6 +1663,73 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) +@@ -1610,6 +1691,73 @@ ovsdb_idl_db_compose_cond_change(struct ovsdb_idl_db *db) return jsonrpc_create_request("monitor_cond_change", params, NULL); } @@ -83034,7 +83116,16 @@ index 190143f363..1ff9b2bb75 100644 static void ovsdb_idl_send_cond_change(struct ovsdb_idl *idl) { -@@ -1753,29 +1873,37 @@ ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) +@@ -1739,7 +1887,7 @@ ovsdb_idl_track_add_all(struct ovsdb_idl *idl) + } + + /* Returns true if 'table' has any tracked column. */ +-static bool ++bool + ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) + { + size_t i; +@@ -1753,29 +1901,37 @@ ovsdb_idl_track_is_set(struct ovsdb_idl_table *table) } /* Returns the first tracked row in table with class 'table_class' @@ -83079,7 +83170,7 @@ index 190143f363..1ff9b2bb75 100644 return NULL; } -@@ -1808,7 +1936,7 @@ ovsdb_idl_track_is_updated(const struct ovsdb_idl_row *row, +@@ -1808,7 +1964,7 @@ ovsdb_idl_track_is_updated(const struct ovsdb_idl_row *row, * loop when it is ready to do ovsdb_idl_run() again. */ static void @@ -83088,18 +83179,15 @@ index 190143f363..1ff9b2bb75 100644 { size_t i; -@@ -1823,19 +1951,39 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) +@@ -1823,19 +1979,34 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) free(row->updated); row->updated = NULL; } -+ -+ row->change_seqno[OVSDB_IDL_CHANGE_INSERT] = -+ row->change_seqno[OVSDB_IDL_CHANGE_MODIFY] = -+ row->change_seqno[OVSDB_IDL_CHANGE_DELETE] = 0; -+ - ovs_list_remove(&row->track_node); - ovs_list_init(&row->track_node); +- ovs_list_remove(&row->track_node); +- ovs_list_init(&row->track_node); - if (ovsdb_idl_row_is_orphan(row) && row->tracked_old_datum) { ++ ovsdb_idl_row_untrack_change(row); ++ + if (ovsdb_idl_row_is_orphan(row)) { ovsdb_idl_row_unparse(row); - const struct ovsdb_idl_table_class *class = @@ -83137,7 +83225,7 @@ index 190143f363..1ff9b2bb75 100644 } } } -@@ -1850,7 +1998,7 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) +@@ -1850,7 +2021,7 @@ ovsdb_idl_db_track_clear(struct ovsdb_idl_db *db) void ovsdb_idl_track_clear(struct ovsdb_idl *idl) { @@ -83146,7 +83234,7 @@ index 190143f363..1ff9b2bb75 100644 } static void -@@ -2064,13 +2212,15 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, +@@ -2064,13 +2235,15 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, monitor_request = json_object_create(); json_object_put(monitor_request, "columns", columns); @@ -83165,7 +83253,7 @@ index 190143f363..1ff9b2bb75 100644 } json_object_put(monitor_requests, tc->name, json_array_create_1(monitor_request)); -@@ -2078,8 +2228,6 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, +@@ -2078,8 +2251,6 @@ ovsdb_idl_send_monitor_request(struct ovsdb_idl *idl, struct ovsdb_idl_db *db, } free_schema(schema); @@ -83174,7 +83262,49 @@ index 190143f363..1ff9b2bb75 100644 struct json *params = json_array_create_3( json_string_create(db->class_->database), json_clone(db->monitor_id), -@@ -2504,22 +2652,25 @@ ovsdb_idl_process_update2(struct ovsdb_idl_table *table, +@@ -2379,6 +2550,33 @@ ovsdb_idl_db_parse_update(struct ovsdb_idl_db *db, + } + } + ++/* Reparses references to rows that have been deleted in the current IDL run. ++ * ++ * To ensure that reference sources that are deleted are not reparsed, ++ * this function must be called after all updates have been processed in ++ * the current IDL run, i.e., after all calls to ovsdb_idl_parse_update(). ++ */ ++static void ++ovsdb_idl_reparse_deleted(struct ovsdb_idl_db *db) ++{ ++ struct ovsdb_idl_row *row, *next; ++ ++ LIST_FOR_EACH_SAFE (row, next, track_node, &db->deleted_untracked_rows) { ++ ovsdb_idl_row_untrack_change(row); ++ add_tracked_change_for_references(row); ++ ovsdb_idl_row_reparse_backrefs(row); ++ ++ /* Orphan rows that are still unreferenced or are part of tables that ++ * have change tracking enabled should be added to their table's ++ * 'track_list'. ++ */ ++ if (ovs_list_is_empty(&row->dst_arcs) ++ || ovsdb_idl_track_is_set(row->table)) { ++ ovsdb_idl_row_track_change(row, OVSDB_IDL_CHANGE_DELETE); ++ } ++ } ++} ++ + static struct ovsdb_idl_row * + ovsdb_idl_get_row(struct ovsdb_idl_table *table, const struct uuid *uuid) + { +@@ -2418,6 +2616,7 @@ ovsdb_idl_process_update(struct ovsdb_idl_table *table, + if (!row) { + ovsdb_idl_insert_row(ovsdb_idl_row_create(table, uuid), new); + } else if (ovsdb_idl_row_is_orphan(row)) { ++ ovsdb_idl_row_untrack_change(row); + ovsdb_idl_insert_row(row, new); + } else { + VLOG_WARN_RL(&semantic_rl, "cannot add existing row "UUID_FMT" to " +@@ -2504,22 +2703,20 @@ ovsdb_idl_process_update2(struct ovsdb_idl_table *table, return true; } @@ -83192,28 +83322,22 @@ index 190143f363..1ff9b2bb75 100644 - row->change_seqno[OVSDB_IDL_CHANGE_MODIFY] - = row->table->change_seqno[OVSDB_IDL_CHANGE_MODIFY] - = row->table->db->change_seqno + 1; -- -- const struct ovsdb_idl_arc *arc; -- LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) { -- add_tracked_change_for_references(arc->src); + const struct ovsdb_idl_arc *arc; + LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) { + struct ovsdb_idl_row *ref = arc->src; -+ + +- const struct ovsdb_idl_arc *arc; +- LIST_FOR_EACH (arc, dst_node, &row->dst_arcs) { +- add_tracked_change_for_references(arc->src); + if (ovs_list_is_empty(&ref->track_node) && + ovsdb_idl_track_is_set(ref->table)) { -+ ovs_list_push_back(&ref->table->track_list, -+ &ref->track_node); -+ -+ ref->change_seqno[OVSDB_IDL_CHANGE_MODIFY] -+ = ref->table->change_seqno[OVSDB_IDL_CHANGE_MODIFY] -+ = ref->table->db->change_seqno + 1; + ++ ovsdb_idl_row_track_change(ref, OVSDB_IDL_CHANGE_MODIFY); + add_tracked_change_for_references(ref); } } } -@@ -2587,7 +2738,14 @@ ovsdb_idl_row_change__(struct ovsdb_idl_row *row, const struct json *row_json, +@@ -2587,7 +2784,14 @@ ovsdb_idl_row_change__(struct ovsdb_idl_row *row, const struct json *row_json, row->change_seqno[change] = row->table->change_seqno[change] = row->table->db->change_seqno + 1; @@ -83228,7 +83352,7 @@ index 190143f363..1ff9b2bb75 100644 add_tracked_change_for_references(row); if (!row->updated) { row->updated = bitmap_allocate(class->n_columns); -@@ -3021,7 +3179,7 @@ ovsdb_idl_row_clear_old(struct ovsdb_idl_row *row) +@@ -3021,7 +3225,7 @@ ovsdb_idl_row_clear_old(struct ovsdb_idl_row *row) { ovs_assert(row->old_datum == row->new_datum); if (!ovsdb_idl_row_is_orphan(row)) { @@ -83237,7 +83361,91 @@ index 190143f363..1ff9b2bb75 100644 row->tracked_old_datum = row->old_datum; } else { const struct ovsdb_idl_table_class *class = row->table->class_; -@@ -4663,6 +4821,7 @@ ovsdb_idl_txn_insert(struct ovsdb_idl_txn *txn, +@@ -3104,6 +3308,32 @@ ovsdb_idl_row_reparse_backrefs(struct ovsdb_idl_row *row) + } + } + ++static void ++ovsdb_idl_row_track_change(struct ovsdb_idl_row *row, ++ enum ovsdb_idl_change change) ++{ ++ row->change_seqno[change] ++ = row->table->change_seqno[change] ++ = row->table->db->change_seqno + 1; ++ if (ovs_list_is_empty(&row->track_node)) { ++ ovs_list_push_back(&row->table->track_list, &row->track_node); ++ } ++} ++ ++static void ++ovsdb_idl_row_untrack_change(struct ovsdb_idl_row *row) ++{ ++ if (ovs_list_is_empty(&row->track_node)) { ++ return; ++ } ++ ++ row->change_seqno[OVSDB_IDL_CHANGE_INSERT] = ++ row->change_seqno[OVSDB_IDL_CHANGE_MODIFY] = ++ row->change_seqno[OVSDB_IDL_CHANGE_DELETE] = 0; ++ ovs_list_remove(&row->track_node); ++ ovs_list_init(&row->track_node); ++} ++ + static struct ovsdb_idl_row * + ovsdb_idl_row_create__(const struct ovsdb_idl_table_class *class) + { +@@ -3130,22 +3360,26 @@ ovsdb_idl_row_create(struct ovsdb_idl_table *table, const struct uuid *uuid) + return row; + } + ++/* If 'row' is not referenced anymore, removes 'row' from the table hmap, ++ * clears the old datum and adds 'row' to the table's track_list. ++ * ++ * If 'row' is still referenced, i.e., became "orphan", queues 'row' for ++ * reparsing after all updates have been processed by adding it to the ++ * 'deleted_untracked_rows' list. ++ */ + static void + ovsdb_idl_row_destroy(struct ovsdb_idl_row *row) + { +- if (row) { +- ovsdb_idl_row_clear_old(row); ++ ovsdb_idl_row_clear_old(row); ++ if (ovs_list_is_empty(&row->dst_arcs)) { + hmap_remove(&row->table->rows, &row->hmap_node); + ovsdb_idl_destroy_all_map_op_lists(row); + ovsdb_idl_destroy_all_set_op_lists(row); +- if (ovsdb_idl_track_is_set(row->table)) { +- row->change_seqno[OVSDB_IDL_CHANGE_DELETE] +- = row->table->change_seqno[OVSDB_IDL_CHANGE_DELETE] +- = row->table->db->change_seqno + 1; +- } +- if (ovs_list_is_empty(&row->track_node)) { +- ovs_list_push_back(&row->table->track_list, &row->track_node); +- } ++ ovsdb_idl_row_track_change(row, OVSDB_IDL_CHANGE_DELETE); ++ } else { ++ ovsdb_idl_row_untrack_change(row); ++ ovs_list_push_back(&row->table->db->deleted_untracked_rows, ++ &row->track_node); + } + } + +@@ -3237,12 +3471,7 @@ ovsdb_idl_delete_row(struct ovsdb_idl_row *row) + { + ovsdb_idl_remove_from_indexes(row); + ovsdb_idl_row_clear_arcs(row, true); +- ovsdb_idl_row_clear_old(row); +- if (ovs_list_is_empty(&row->dst_arcs)) { +- ovsdb_idl_row_destroy(row); +- } else { +- ovsdb_idl_row_reparse_backrefs(row); +- } ++ ovsdb_idl_row_destroy(row); + } + + /* Returns true if a column with mode OVSDB_IDL_MODE_RW changed, false +@@ -4663,6 +4892,7 @@ ovsdb_idl_txn_insert(struct ovsdb_idl_txn *txn, hmap_insert(&row->table->rows, &row->hmap_node, uuid_hash(&row->uuid)); hmap_insert(&txn->txn_rows, &row->txn_node, uuid_hash(&row->uuid)); ovsdb_idl_add_to_indexes(row); @@ -83245,6 +83453,26 @@ index 190143f363..1ff9b2bb75 100644 return row; } +diff --git a/lib/ovsdb-idl.h b/lib/ovsdb-idl.h +index 9f12ce3206..6ad6d3a54e 100644 +--- a/lib/ovsdb-idl.h ++++ b/lib/ovsdb-idl.h +@@ -53,6 +53,7 @@ struct ovsdb_datum; + struct ovsdb_idl_class; + struct ovsdb_idl_row; + struct ovsdb_idl_column; ++struct ovsdb_idl_table; + struct ovsdb_idl_table_class; + struct uuid; + +@@ -217,6 +218,7 @@ unsigned int ovsdb_idl_row_get_seqno( + void ovsdb_idl_track_add_column(struct ovsdb_idl *idl, + const struct ovsdb_idl_column *column); + void ovsdb_idl_track_add_all(struct ovsdb_idl *idl); ++bool ovsdb_idl_track_is_set(struct ovsdb_idl_table *table); + const struct ovsdb_idl_row *ovsdb_idl_track_get_first( + const struct ovsdb_idl *, const struct ovsdb_idl_table_class *); + const struct ovsdb_idl_row *ovsdb_idl_track_get_next(const struct ovsdb_idl_row *); diff --git a/lib/pvector.c b/lib/pvector.c index aaeee92147..cc527fdc41 100644 --- a/lib/pvector.c @@ -85859,9 +86087,18 @@ index 8d777a0275..5e3b26aea8 100644 AT_KEYWORDS([ovsdb client positive]) diff --git a/tests/ovsdb-cluster.at b/tests/ovsdb-cluster.at -index 3a0bd4579e..92aa427093 100644 +index 3a0bd4579e..cf43e9cf86 100644 --- a/tests/ovsdb-cluster.at +++ b/tests/ovsdb-cluster.at +@@ -128,7 +128,7 @@ ovsdb_test_cluster_disconnect () { + "rows": [{"i": 1}]}]]' > test-ovsdb.log 2>&1 & + echo $! > test-ovsdb.pid + +- OVS_WAIT_UNTIL([grep "000: i=1" test-ovsdb.log]) ++ OVS_WAIT_UNTIL([grep "000: table simple: i=1" test-ovsdb.log]) + + # Start collecting raft_is_connected logs for $target before shutting down + # any servers. @@ -179,6 +179,41 @@ AT_KEYWORDS([ovsdb server negative unix cluster disconnect]) ovsdb_test_cluster_disconnect 5 leader yes AT_CLEANUP @@ -86065,7 +86302,7 @@ index 3a0bd4579e..92aa427093 100644 done=0 for j in $(seq 0 $(expr $n1 - 1)); do diff --git a/tests/ovsdb-idl.at b/tests/ovsdb-idl.at -index cc38d69c10..d0feaa31fe 100644 +index cc38d69c10..a1daf9a137 100644 --- a/tests/ovsdb-idl.at +++ b/tests/ovsdb-idl.at @@ -12,25 +12,6 @@ ovsdb_start_idltest () { @@ -86130,7 +86367,449 @@ index cc38d69c10..d0feaa31fe 100644 # OVSDB_CHECK_IDL_C(TITLE, [PRE-IDL-TXN], TRANSACTIONS, OUTPUT, [KEYWORDS], # [FILTER]) # -@@ -954,7 +964,10 @@ AT_CHECK([sort stdout | uuidfilt], [0], +@@ -131,7 +141,7 @@ m4_define([OVSDB_CHECK_IDL_REGISTER_COLUMNS_PY], + AT_CHECK([ovsdb_start_idltest]) + m4_if([$2], [], [], + [AT_CHECK([ovsdb-client transact unix:socket $2], [0], [ignore], [ignore])]) +- AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?link1:i,k,ka,l2?link2:i,l1?singleton:name $3], ++ AT_CHECK([$PYTHON3 $srcdir/test-ovsdb.py -t10 idl $srcdir/idltest.ovsschema unix:socket ?simple:b,ba,i,ia,r,ra,s,sa,u,ua?simple3:name,uset,uref?simple4:name?simple6:name,weak_ref?link1:i,k,ka,l2?link2:i,l1?singleton:name $3], + [0], [stdout], [ignore]) + AT_CHECK([sort stdout | uuidfilt]m4_if([$6],,, [[| $6]]), + [0], [$4]) +@@ -345,28 +355,28 @@ OVSDB_CHECK_IDL([simple idl, initially empty, various ops], + 'reconnect']], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]} +-002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++002: table simple: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++002: table simple: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 003: {"error":null,"result":[{"count":2}]} +-004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++004: table simple: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++004: table simple: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 005: {"error":null,"result":[{"count":2}]} +-006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++006: table simple: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++006: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]} +-008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++008: table simple: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++008: table simple: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++008: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 009: {"error":null,"result":[{"count":2}]} +-010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++010: table simple: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++010: table simple: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++010: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 011: {"error":null,"result":[{"count":1}]} +-012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++012: table simple: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++012: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 013: reconnect +-014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++014: table simple: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++014: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 015: done + ]]) + +@@ -393,11 +403,11 @@ OVSDB_CHECK_IDL([simple idl, initially populated], + "table": "simple", + "where": [], + "row": {"b": true}}]']], +- [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> ++ [[000: table simple: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++000: table simple: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> + 001: {"error":null,"result":[{"count":2}]} +-002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> ++002: table simple: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++002: table simple: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> + 003: done + ]]) + +@@ -421,14 +431,14 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL], + "row": {}}]']], + [['verify 0 b, verify 1 r, set 0 b 1, set 1 r 3.5' \ + 'insert 2, verify 2 i, verify 1 b, delete 1']], +- [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-000: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> ++ [[000: table simple: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++000: table simple: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> + 001: commit, status=success +-002: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-002: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> ++002: table simple: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++002: table simple: i=1 r=3.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<5> + 003: commit, status=success +-004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-004: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6> ++004: table simple: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++004: table simple: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<6> + 005: done + ]]) + +@@ -438,10 +448,10 @@ OVSDB_CHECK_IDL([simple idl, writing via IDL with unicode], + "table": "simple", + "row": {"s": "(╯°□°)╯︵ ┻━┻"}}]']], + [['set 0 b 1, insert 1, set 1 s "¯\_(ツ)_/¯"']], +- [[000: i=0 r=0 b=false s=(╯°□°)╯︵ ┻━┻ u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++ [[000: table simple: i=0 r=0 b=false s=(╯°□°)╯︵ ┻━┻ u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 001: commit, status=success +-002: i=0 r=0 b=true s=(╯°□°)╯︵ ┻━┻ u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-002: i=1 r=0 b=false s="¯\_(ツ)_/¯" u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++002: table simple: i=0 r=0 b=true s=(╯°□°)╯︵ ┻━┻ u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++002: table simple: i=1 r=0 b=false s="¯\_(ツ)_/¯" u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> + 003: done + ]]) + +@@ -465,10 +475,10 @@ OVSDB_CHECK_IDL_PY_WITH_EXPOUT([simple idl, writing large data via IDL with unic + "table": "simple", + "row": {"s": "'$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50})'"}}]']], + [['set 0 b 1, insert 1, set 1 s '$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..100})'']], +- [[000: i=0 r=0 b=false s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++ [[000: table simple: i=0 r=0 b=false s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 001: commit, status=success +-002: i=0 r=0 b=true s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-002: i=1 r=0 b=false s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..100}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++002: table simple: i=0 r=0 b=true s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..50}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++002: table simple: i=1 r=0 b=false s=$(printf "测试超过四千零九十六个字节的中文字符串以使解码出现问题。%.0s" {1..100}) u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> + 003: done]]) + + OVSDB_CHECK_IDL([simple idl, handling verification failure], +@@ -489,16 +499,16 @@ OVSDB_CHECK_IDL([simple idl, handling verification failure], + '+verify 1 r, set 1 r 3' \ + 'verify 1 r, set 1 r 3' \ + ]], +- [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-000: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++ [[000: table simple: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++000: table simple: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> + 001: commit, status=success + 002: {"error":null,"result":[{"count":1}]} + 003: commit, status=try again +-004: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-004: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++004: table simple: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++004: table simple: i=1 r=5 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> + 005: commit, status=success +-006: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-006: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++006: table simple: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++006: table simple: i=1 r=3 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> + 007: done + ]]) + +@@ -508,9 +518,9 @@ OVSDB_CHECK_IDL([simple idl, increment operation], + "table": "simple", + "row": {}}]']], + [['set 0 r 2.0, increment 0']], +- [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++ [[000: table simple: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 001: commit, status=success, increment=1 +-002: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++002: table simple: i=1 r=2 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 003: done + ]]) + +@@ -521,10 +531,10 @@ OVSDB_CHECK_IDL([simple idl, aborting], + "row": {}}]']], + [['set 0 r 2.0, abort' \ + '+set 0 b 1']], +- [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++ [[000: table simple: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 001: commit, status=aborted + 002: commit, status=success +-003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 004: done + ]]) + +@@ -535,10 +545,10 @@ OVSDB_CHECK_IDL([simple idl, destroy without commit or abort], + "row": {}}]']], + [['set 0 r 2.0, destroy' \ + '+set 0 b 1']], +- [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++ [[000: table simple: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 001: destroy + 002: commit, status=success +-003: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=0 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 004: done + ]]) + +@@ -554,7 +564,7 @@ OVSDB_CHECK_IDL([simple idl, conditional, false condition], + [[000: change conditions + 001: empty + 002: change conditions +-003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 004: done + ]]) + +@@ -570,7 +580,7 @@ OVSDB_CHECK_IDL([simple idl, conditional, true condition], + [[000: change conditions + 001: empty + 002: change conditions +-003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 004: done + ]]) + +@@ -591,8 +601,8 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple clauses in condition], + [[000: change conditions + 001: empty + 002: change conditions +-003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-003: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> + 004: done + ]]) + +@@ -608,7 +618,7 @@ OVSDB_CHECK_IDL([simple idl, conditional, modify as insert due to condition], + [[000: change conditions + 001: empty + 002: change conditions +-003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 004: done + ]]) + +@@ -631,11 +641,11 @@ OVSDB_CHECK_IDL([simple idl, conditional, modify as delete due to condition], + [[000: change conditions + 001: empty + 002: change conditions +-003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 004: change conditions + 005: empty + 006: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} +-007: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++007: table simple: i=2 r=3 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> + 008: done + ]]) + +@@ -666,15 +676,15 @@ OVSDB_CHECK_IDL([simple idl, conditional, multiple tables], + [[000: change conditions + 001: empty + 002: change conditions +-003: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 004: change conditions +-005: i=0 k=0 ka=[] l2= uuid=<2> +-005: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++005: table link1: i=0 k=0 ka=[] l2= uuid=<2> ++005: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 006: change conditions + 007: {"error":null,"result":[{"uuid":["uuid","<3>"]}]} +-008: i=0 k=0 ka=[] l2= uuid=<2> +-008: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-008: i=3 l1= uuid=<3> ++008: table link1: i=0 k=0 ka=[] l2= uuid=<2> ++008: table link2: i=3 l1= uuid=<3> ++008: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 009: done + ]]) + +@@ -706,19 +716,19 @@ OVSDB_CHECK_IDL([self-linking idl, consistent ops], + "row": {"k": ["uuid", "#0#"]}}]']], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} +-002: i=0 k=0 ka=[] l2= uuid=<0> ++002: table link1: i=0 k=0 ka=[] l2= uuid=<0> + 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]} +-004: i=0 k=0 ka=[] l2= uuid=<0> +-004: i=1 k=2 ka=[] l2= uuid=<1> +-004: i=2 k=1 ka=[] l2= uuid=<2> ++004: table link1: i=0 k=0 ka=[] l2= uuid=<0> ++004: table link1: i=1 k=2 ka=[] l2= uuid=<1> ++004: table link1: i=2 k=1 ka=[] l2= uuid=<2> + 005: {"error":null,"result":[{"count":1}]} +-006: i=0 k=0 ka=[] l2= uuid=<0> +-006: i=1 k=1 ka=[] l2= uuid=<1> +-006: i=2 k=1 ka=[] l2= uuid=<2> ++006: table link1: i=0 k=0 ka=[] l2= uuid=<0> ++006: table link1: i=1 k=1 ka=[] l2= uuid=<1> ++006: table link1: i=2 k=1 ka=[] l2= uuid=<2> + 007: {"error":null,"result":[{"count":3}]} +-008: i=0 k=0 ka=[] l2= uuid=<0> +-008: i=1 k=0 ka=[] l2= uuid=<1> +-008: i=2 k=0 ka=[] l2= uuid=<2> ++008: table link1: i=0 k=0 ka=[] l2= uuid=<0> ++008: table link1: i=1 k=0 ka=[] l2= uuid=<1> ++008: table link1: i=2 k=0 ka=[] l2= uuid=<2> + 009: done + ]]) + +@@ -757,12 +767,12 @@ OVSDB_CHECK_IDL([self-linking idl, inconsistent ops], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"details":"Table link1 column k row <0> references nonexistent row <1> in table link1.","error":"referential integrity violation"}]} + 002: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]} +-003: i=1 k=1 ka=[] l2= uuid=<2> +-003: i=2 k=1 ka=[] l2= uuid=<3> ++003: table link1: i=1 k=1 ka=[] l2= uuid=<2> ++003: table link1: i=2 k=1 ka=[] l2= uuid=<3> + 004: {"error":null,"result":[{"count":2},{"details":"Table link1 column k row references nonexistent row <4> in table link1.","error":"referential integrity violation"}]} + 005: {"error":null,"result":[{"count":1},{"details":"cannot delete link1 row <2> because of 1 remaining reference(s)","error":"referential integrity violation"}]} + 006: {"error":null,"result":[{"count":1}]} +-007: i=1 k=1 ka=[] l2= uuid=<2> ++007: table link1: i=1 k=1 ka=[] l2= uuid=<2> + 008: {"error":null,"result":[{"count":1}]} + 009: empty + 010: done +@@ -805,15 +815,15 @@ OVSDB_CHECK_IDL([self-linking idl, sets], + "where": []}]']], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]} +-002: i=0 k=0 ka=[0] l2= uuid=<0> +-002: i=1 k=0 ka=[1] l2= uuid=<1> +-002: i=2 k=0 ka=[2] l2= uuid=<2> +-002: i=3 k=0 ka=[3] l2= uuid=<3> ++002: table link1: i=0 k=0 ka=[0] l2= uuid=<0> ++002: table link1: i=1 k=0 ka=[1] l2= uuid=<1> ++002: table link1: i=2 k=0 ka=[2] l2= uuid=<2> ++002: table link1: i=3 k=0 ka=[3] l2= uuid=<3> + 003: {"error":null,"result":[{"count":4}]} +-004: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0> +-004: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1> +-004: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2> +-004: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3> ++004: table link1: i=0 k=0 ka=[0 1 2 3] l2= uuid=<0> ++004: table link1: i=1 k=0 ka=[0 1 2 3] l2= uuid=<1> ++004: table link1: i=2 k=0 ka=[0 1 2 3] l2= uuid=<2> ++004: table link1: i=3 k=0 ka=[0 1 2 3] l2= uuid=<3> + 005: {"error":null,"result":[{"count":1},{"details":"Table link1 column ka row <2> references nonexistent row <4> in table link1.","error":"referential integrity violation"}]} + 006: {"error":null,"result":[{"count":4}]} + 007: empty +@@ -833,8 +843,8 @@ OVSDB_CHECK_IDL([external-linking idl, consistent ops], + "uuid-name": "row1"}]']], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]} +-002: i=0 l1= uuid=<0> +-002: i=1 k=1 ka=[] l2=0 uuid=<1> ++002: table link1: i=1 k=1 ka=[] l2=0 uuid=<1> ++002: table link2: i=0 l1= uuid=<0> + 003: done + ]]) + +@@ -857,20 +867,49 @@ OVSDB_CHECK_IDL([singleton idl, constraints], + "row": {"name": "bar"}}]']], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} +-002: name=foo uuid=<0> ++002: table singleton: name=foo uuid=<0> + 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"details":"transaction causes \"singleton\" table to contain 2 rows, greater than the schema-defined limit of 1 row(s)","error":"constraint violation"}]} + 004: {"error":null,"result":[{"count":1},{"uuid":["uuid","<2>"]}]} +-005: name=bar uuid=<2> ++005: table singleton: name=bar uuid=<2> + 006: done + ]]) + ++dnl This test creates a database with references and checks that deleting both ++dnl source and destination rows of a reference in a single update doesn't leak ++dnl rows that got orphaned when processing the update. ++OVSDB_CHECK_IDL([simple idl, references, multiple deletes], ++ [['["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s"}, ++ "uuid-name": "weak_row0"}, ++ {"op": "insert", ++ "table": "simple6", ++ "row": {"name": "first_row", ++ "weak_ref": ["set", ++ [["named-uuid", "weak_row0"]] ++ ]}}]']], ++ [['["idltest", ++ {"op": "delete", ++ "table": "simple", ++ "where": [["s", "==", "row0_s"]]}, ++ {"op": "delete", ++ "table": "simple6", ++ "where": [["name", "==", "first_row"]]}]']], ++ [[000: table simple6: name=first_row weak_ref=[<0>] uuid=<1> ++000: table simple: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<0> ++001: {"error":null,"result":[{"count":1},{"count":1}]} ++002: empty ++003: done ++]]) ++ + OVSDB_CHECK_IDL_PY([external-linking idl, insert ops], + [], + [['linktest']], + [[000: empty + 001: commit, status=success +-002: i=1 k=1 ka=[1] l2= uuid=<0> +-002: i=2 k=1 ka=[1 2] l2= uuid=<1> ++002: table link1: i=1 k=1 ka=[1] l2= uuid=<0> ++002: table link1: i=2 k=1 ka=[1 2] l2= uuid=<1> + 003: done + ]]) + +@@ -879,7 +918,7 @@ OVSDB_CHECK_IDL_PY([getattr idl, insert ops], + [['getattrtest']], + [[000: empty + 001: commit, status=success +-002: i=2 k=2 ka=[] l2= uuid=<0> ++002: table link1: i=2 k=2 ka=[] l2= uuid=<0> + 003: done + ]]) + +@@ -892,11 +931,11 @@ OVSDB_CHECK_IDL_PY([row-from-json idl, whats this], + "table": "simple", + "row": {}}]']], + [['notifytest insert 2, notifytest set 1 b 1, notifytest delete 0']], +- [[000: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-000: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++ [[000: table simple: i=0 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++000: table simple: i=1 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> + 001: commit, status=success, events=create|2|None, delete|0|None, update|1|b +-002: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> +-002: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++002: table simple: i=1 r=0 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++002: table simple: i=2 r=0 b=false s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> + 003: done + ]]) + +@@ -936,25 +975,28 @@ AT_CHECK([test-ovsdb '-vPATTERN:console:test-ovsdb|%c|%m' -vjsonrpc -t10 idl uni + AT_CHECK([sort stdout | uuidfilt], [0], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]}]} +-002: i=0 k=0 ka=[] l2= uuid=<0> ++002: table link1: i=0 k=0 ka=[] l2= uuid=<0> + 003: {"error":null,"result":[{"uuid":["uuid","<1>"]},{"uuid":["uuid","<2>"]}]} +-004: i=0 k=0 ka=[] l2= uuid=<0> +-004: i=1 k=2 ka=[] l2= uuid=<1> +-004: i=2 k=1 ka=[] l2= uuid=<2> ++004: table link1: i=0 k=0 ka=[] l2= uuid=<0> ++004: table link1: i=1 k=2 ka=[] l2= uuid=<1> ++004: table link1: i=2 k=1 ka=[] l2= uuid=<2> + 005: {"error":null,"result":[{"count":1}]} +-006: i=0 k=0 ka=[] l2= uuid=<0> +-006: i=1 k=1 ka=[] l2= uuid=<1> +-006: i=2 k=1 ka=[] l2= uuid=<2> ++006: table link1: i=0 k=0 ka=[] l2= uuid=<0> ++006: table link1: i=1 k=1 ka=[] l2= uuid=<1> ++006: table link1: i=2 k=1 ka=[] l2= uuid=<2> + 007: {"error":null,"result":[{"count":3}]} +-008: i=0 k=0 ka=[] l2= uuid=<0> +-008: i=1 k=0 ka=[] l2= uuid=<1> +-008: i=2 k=0 ka=[] l2= uuid=<2> ++008: table link1: i=0 k=0 ka=[] l2= uuid=<0> ++008: table link1: i=1 k=0 ka=[] l2= uuid=<1> ++008: table link1: i=2 k=0 ka=[] l2= uuid=<2> + 009: done + ]]) # Check that ovsdb-idl figured out that table link2 and column l2 are missing. AT_CHECK([grep ovsdb_idl stderr | sort], [0], [dnl @@ -86141,15 +86820,82 @@ index cc38d69c10..d0feaa31fe 100644 test-ovsdb|ovsdb_idl|idltest database lacks singleton table (database needs upgrade?) test-ovsdb|ovsdb_idl|link1 table in idltest database lacks l2 column (database needs upgrade?) ]) -@@ -1150,6 +1163,7 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated], +@@ -1009,11 +1051,11 @@ OVSDB_CHECK_IDL_FETCH_COLUMNS([simple idl, initially populated], + "row": {}}]']], + [?simple:i,r!], + ['fetch 0 r'], +- [[000: i=0 uuid=<0> +-000: i=1 uuid=<1> ++ [[000: table simple: i=0 uuid=<0> ++000: table simple: i=1 uuid=<1> + 001: commit, status=success +-002: i=0 r=0 uuid=<0> +-002: i=1 uuid=<1> ++002: table simple: i=0 r=0 uuid=<0> ++002: table simple: i=1 uuid=<1> + 003: done + ]]) + +@@ -1085,28 +1127,28 @@ OVSDB_CHECK_IDL_WO_MONITOR_COND([simple idl disable monitor-cond], + 'reconnect']], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]} +-002: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-002: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++002: table simple: i=0 r=0 b=false s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++002: table simple: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 003: {"error":null,"result":[{"count":2}]} +-004: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-004: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++004: table simple: i=0 r=0 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++004: table simple: i=1 r=2 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 005: {"error":null,"result":[{"count":2}]} +-006: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-006: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++006: table simple: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++006: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]} +-008: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-008: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-008: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++008: table simple: i=-1 r=125 b=false s= u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++008: table simple: i=0 r=123.5 b=true s= u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++008: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 009: {"error":null,"result":[{"count":2}]} +-010: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-010: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-010: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++010: table simple: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++010: table simple: i=0 r=123.5 b=true s=newstring u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++010: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 011: {"error":null,"result":[{"count":1}]} +-012: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-012: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++012: table simple: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++012: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 013: reconnect +-014: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-014: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> ++014: table simple: i=-1 r=125 b=false s=newstring u=<2> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++014: table simple: i=1 r=123.5 b=true s=mystring u=<3> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<4> <5>] uuid=<0> + 015: done + ]]) + +@@ -1149,15 +1191,354 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated], + "table": "simple", "where": [], "row": {"b": true}}]']], - [[000: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3> -+000: inserted row: uuid=<3> - 000: updated columns: b ba i ia r ra s sa u ua +- [[000: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3> +-000: updated columns: b ba i ia r ra s sa u ua ++ [[000: table simple: inserted row: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3> ++000: table simple: updated columns: b ba i ia r ra s sa u ua 001: {"error":null,"result":[{"count":2}]} - 002: i=0 r=0 b=true s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<5> -@@ -1158,6 +1172,111 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated], +-002: i=0 r=0 b=true s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<5> +-002: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3> +-002: updated columns: b ++002: table simple: i=0 r=0 b=true s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<5> ++002: table simple: i=1 r=2 b=true s=mystring u=<0> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<1> <2>] uuid=<3> ++002: table simple: updated columns: b 003: done ]]) @@ -86190,19 +86936,17 @@ index cc38d69c10..d0feaa31fe 100644 + "table": "simple6", + "where": []}]']], + [[000: change conditions -+001: inserted row: uuid=<0> -+001: name=first_row weak_ref=[] uuid=<0> -+001: updated columns: name weak_ref ++001: table simple6: inserted row: name=first_row weak_ref=[] uuid=<0> ++001: table simple6: updated columns: name weak_ref +002: change conditions -+003: i=0 r=0 b=false s=row1_s u=<1> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -+003: inserted row: uuid=<2> -+003: name=first_row weak_ref=[<2>] uuid=<0> -+003: updated columns: s ++003: table simple6: name=first_row weak_ref=[<1>] uuid=<0> ++003: table simple: inserted row: i=0 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: updated columns: s +004: {"error":null,"result":[{"count":1}]} -+005: name=new_name weak_ref=[<2>] uuid=<0> -+005: updated columns: name ++005: table simple6: name=new_name weak_ref=[<1>] uuid=<0> ++005: table simple6: updated columns: name +006: {"error":null,"result":[{"count":1}]} -+007: i=0 r=0 b=false s=row1_s u=<1> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++007: table simple: i=0 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +008: done +]]) + @@ -86234,79 +86978,419 @@ index cc38d69c10..d0feaa31fe 100644 + "table": "simple6", + "where": []}]']], + [[000: change conditions -+001: inserted row: uuid=<0> -+001: name=first_row weak_ref=[] uuid=<0> -+001: updated columns: name weak_ref ++001: table simple6: inserted row: name=first_row weak_ref=[] uuid=<0> ++001: table simple6: updated columns: name weak_ref +002: change conditions -+003: i=0 r=0 b=false s=row0_s u=<1> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -+003: inserted row: uuid=<2> -+003: name=first_row weak_ref=[<2>] uuid=<0> -+003: updated columns: s ++003: table simple6: name=first_row weak_ref=[<1>] uuid=<0> ++003: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: updated columns: s +004: change conditions -+005: i=0 r=0 b=false s=row1_s u=<1> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> -+005: inserted row: uuid=<3> -+005: updated columns: s ++005: table simple6: name=first_row weak_ref=[] uuid=<0> ++005: table simple: deleted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++005: table simple: inserted row: i=0 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++005: table simple: updated columns: s +006: change conditions -+007: deleted row: uuid=<3> -+007: i=0 r=0 b=false s=row0_s u=<1> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> -+007: i=0 r=0 b=false s=row1_s u=<1> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> -+007: inserted row: uuid=<2> -+007: name=first_row weak_ref=[<2>] uuid=<0> -+007: updated columns: s ++007: table simple6: name=first_row weak_ref=[<1>] uuid=<0> ++007: table simple: deleted row: i=0 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++007: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++007: table simple: updated columns: s +008: {"error":null,"result":[{"count":1}]} -+009: i=0 r=0 b=false s=row0_s u=<1> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++009: table simple: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +010: done +]]) + - OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], - [], - [['["idltest", -@@ -1212,6 +1331,7 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], - [[000: empty - 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]} - 002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0> -+002: inserted row: uuid=<0> - 002: updated columns: b ba i ia r ra s sa u ua - 003: {"error":null,"result":[{"count":2}]} - 004: i=0 r=0 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> -@@ -1223,6 +1343,7 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], - 006: updated columns: r - 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]} - 008: i=-1 r=125 b=false s= u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -+008: inserted row: uuid=<6> - 008: updated columns: ba i ia r ra - 009: {"error":null,"result":[{"count":2}]} - 010: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> -@@ -1230,7 +1351,8 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], - 010: updated columns: s - 010: updated columns: s - 011: {"error":null,"result":[{"count":1}]} --012: ##deleted## uuid=<1> -+012: deleted row: uuid=<1> -+012: i=0 r=123.5 b=true s=newstring u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> - 013: reconnect - 014: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> - 014: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0> -@@ -1288,6 +1410,18 @@ OVSDB_CHECK_IDL_PY([partial-map idl], - 009: done - ]]) - -+OVSDB_CHECK_IDL_PY([partial-map update set refmap idl], -+[['["idltest", {"op":"insert", "table":"simple3", "row":{"name":"myString1"}}, -+ {"op":"insert", "table":"simple5", "row":{"name":"myString2"}}]']], -+['partialmapmutateirefmap'], -+[[000: name=myString1 uset=[] -+000: name=myString2 irefmap=[] -+001: commit, status=success -+002: name=myString1 uset=[] -+002: name=myString2 irefmap=[(1 <0>)] -+003: done ++dnl This test checks that deleting the destination of a weak reference ++dnl without deleting the source, through monitor condition change, updates ++dnl the source tracked record. ++OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, conditional delete], ++ [['["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s", "i": 0}, ++ "uuid-name": "weak_row0"}, ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row1_s", "i": 1}, ++ "uuid-name": "weak_row1"}, ++ {"op": "insert", ++ "table": "simple6", ++ "row": {"name": "first_row", ++ "weak_ref": ["set", ++ [["named-uuid", "weak_row0"], ++ ["named-uuid", "weak_row1"]] ++ ]}}]']], ++ [['condition simple []' \ ++ 'condition simple [["s","==","row0_s"]]' \ ++ 'condition simple [["s","==","row1_s"]]' \ ++ '["idltest", ++ {"op": "update", ++ "table": "simple6", ++ "where": [], ++ "row": {"name": "new_name"}}]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "simple6", ++ "where": []}]']], ++ [[000: change conditions ++001: table simple6: inserted row: name=first_row weak_ref=[] uuid=<0> ++001: table simple6: updated columns: name weak_ref ++002: change conditions ++003: table simple6: name=first_row weak_ref=[<1>] uuid=<0> ++003: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: updated columns: s ++004: change conditions ++005: table simple6: name=first_row weak_ref=[<3>] uuid=<0> ++005: table simple: deleted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++005: table simple: inserted row: i=1 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++005: table simple: updated columns: i s ++006: {"error":null,"result":[{"count":1}]} ++007: table simple6: name=new_name weak_ref=[<3>] uuid=<0> ++007: table simple6: updated columns: name ++008: {"error":null,"result":[{"count":1}]} ++009: table simple: i=1 r=0 b=false s=row1_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++010: done +]]) + - m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN], - [AT_SETUP([$1 - C]) - AT_KEYWORDS([ovsdb server idl partial update set column positive $5]) -@@ -1352,6 +1486,28 @@ m4_define([OVSDB_CHECK_IDL_NOTIFY], ++dnl This test checks that deleting the destination of a reference updates the ++dnl source tracked record. ++OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, references, single delete], ++ [['["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s"}, ++ "uuid-name": "uuid_row0_s"}, ++ {"op": "insert", ++ "table": "simple6", ++ "row": {"name": "row0_s6", ++ "weak_ref": ["set", ++ [["named-uuid", "uuid_row0_s"]] ++ ]}}]']], ++ [['condition simple [true];simple6 [true]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "simple", ++ "where": []}]' \ ++ '["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s"}}]']], ++ [[000: change conditions ++001: table simple6: inserted row: name=row0_s6 weak_ref=[<0>] uuid=<1> ++001: table simple6: updated columns: name weak_ref ++001: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<0> ++001: table simple: updated columns: s ++002: {"error":null,"result":[{"count":1}]} ++003: table simple6: name=row0_s6 weak_ref=[] uuid=<1> ++003: table simple6: updated columns: weak_ref ++003: table simple: deleted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<0> ++004: {"error":null,"result":[{"uuid":["uuid","<3>"]}]} ++005: table simple6: name=row0_s6 weak_ref=[] uuid=<1> ++005: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++005: table simple: updated columns: s ++006: done ++]]) ++ ++dnl This test checks that deleting both the destination and source of the ++dnl reference doesn't remove the reference in the source tracked record. ++OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, weak references, multiple deletes], ++ [['["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s"}, ++ "uuid-name": "uuid_row0_s"}, ++ {"op": "insert", ++ "table": "simple6", ++ "row": {"name": "row0_s6", ++ "weak_ref": ["set", ++ [["named-uuid", "uuid_row0_s"]] ++ ]}}]']], ++ [['condition simple [true];simple6 [true]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "simple", ++ "where": []}, ++ {"op": "delete", ++ "table": "simple6", ++ "where": []}]' \ ++ '["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s"}}]']], ++ [[000: change conditions ++001: table simple6: inserted row: name=row0_s6 weak_ref=[<0>] uuid=<1> ++001: table simple6: updated columns: name weak_ref ++001: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<0> ++001: table simple: updated columns: s ++002: {"error":null,"result":[{"count":1},{"count":1}]} ++003: table simple6: deleted row: name=row0_s6 weak_ref=[<0>] uuid=<1> ++003: table simple: deleted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<0> ++004: {"error":null,"result":[{"uuid":["uuid","<3>"]}]} ++005: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<2> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++005: table simple: updated columns: s ++006: done ++]]) ++ ++dnl This test checks that deleting both the destination and source of the ++dnl reference doesn't remove the reference in the source tracked record. ++OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, strong references, multiple deletes], ++ [['["idltest", ++ {"op": "insert", ++ "table": "simple4", ++ "row": {"name": "row0_s4"}, ++ "uuid-name": "uuid_row0_s4"}, ++ {"op": "insert", ++ "table": "simple3", ++ "row": {"name": "row0_s3", ++ "uref": ["set", ++ [["named-uuid", "uuid_row0_s4"]] ++ ]}}]']], ++ [['condition simple [true];simple3 [true];simple4 [true]' \ ++ '["idltest", ++ {"op": "delete", ++ "table": "simple3", ++ "where": []}, ++ {"op": "delete", ++ "table": "simple4", ++ "where": []}]' \ ++ '["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s"}}]']], ++ [[000: change conditions ++001: table simple3: inserted row: name=row0_s3 uset=[] uref=[<0>] uuid=<1> ++001: table simple3: updated columns: name uref ++001: table simple4: inserted row: name=row0_s4 uuid=<0> ++001: table simple4: updated columns: name ++002: {"error":null,"result":[{"count":1},{"count":1}]} ++003: table simple3: deleted row: name=row0_s3 uset=[] uref=[<0>] uuid=<1> ++003: table simple4: deleted row: name=row0_s4 uuid=<0> ++004: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} ++005: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<3> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++005: table simple: updated columns: s ++006: done ++]]) ++ ++dnl This test checks that changing conditions to not include the target of ++dnl a strong reference also updates the source row when change tracking is ++dnl enabled. ++OVSDB_CHECK_IDL_TRACK([track, simple idl, initially populated, strong references, conditional], ++ [['["idltest", ++ {"op": "insert", ++ "table": "simple4", ++ "row": {"name": "row0_s4"}, ++ "uuid-name": "uuid_row0_s4"}, ++ {"op": "insert", ++ "table": "simple3", ++ "row": {"name": "row0_s3", ++ "uref": ["set", ++ [["named-uuid", "uuid_row0_s4"]] ++ ]}}]']], ++ [['condition simple [true];simple3 [true];simple4 [true]' \ ++ 'condition simple4 []' \ ++ '["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s"}}]']], ++ [[000: change conditions ++001: table simple3: inserted row: name=row0_s3 uset=[] uref=[<0>] uuid=<1> ++001: table simple3: updated columns: name uref ++001: table simple4: inserted row: name=row0_s4 uuid=<0> ++001: table simple4: updated columns: name ++002: change conditions ++003: table simple3: name=row0_s3 uset=[] uref=[] uuid=<1> ++003: table simple4: deleted row: name=row0_s4 uuid=<0> ++004: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} ++005: table simple3: name=row0_s3 uset=[] uref=[] uuid=<1> ++005: table simple: inserted row: i=0 r=0 b=false s=row0_s u=<3> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++005: table simple: updated columns: s ++006: done ++]]) ++ ++dnl This test checks that changing conditions to not include the target of ++dnl a strong reference also updates the source row when change tracking is ++dnl disabled. ++OVSDB_CHECK_IDL([simple idl, initially populated, strong references, conditional], ++ [['["idltest", ++ {"op": "insert", ++ "table": "simple4", ++ "row": {"name": "row0_s4"}, ++ "uuid-name": "uuid_row0_s4"}, ++ {"op": "insert", ++ "table": "simple3", ++ "row": {"name": "row0_s3", ++ "uref": ["set", ++ [["named-uuid", "uuid_row0_s4"]] ++ ]}}]']], ++ [['condition simple [true];simple3 [true];simple4 [true]' \ ++ 'condition simple4 []' \ ++ '["idltest", ++ {"op": "insert", ++ "table": "simple", ++ "row": {"s": "row0_s"}}]']], ++ [[000: change conditions ++001: table simple3: name=row0_s3 uset=[] uref=[<0>] uuid=<1> ++001: table simple4: name=row0_s4 uuid=<0> ++002: change conditions ++003: table simple3: name=row0_s3 uset=[] uref=[] uuid=<1> ++004: {"error":null,"result":[{"uuid":["uuid","<2>"]}]} ++005: table simple3: name=row0_s3 uset=[] uref=[] uuid=<1> ++005: table simple: i=0 r=0 b=false s=row0_s u=<3> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++006: done ++]]) ++ + OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], + [], + [['["idltest", +@@ -1211,31 +1592,31 @@ OVSDB_CHECK_IDL_TRACK([track, simple idl, initially empty, various ops], + 'reconnect']], + [[000: empty + 001: {"error":null,"result":[{"uuid":["uuid","<0>"]},{"uuid":["uuid","<1>"]}]} +-002: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0> +-002: updated columns: b ba i ia r ra s sa u ua ++002: table simple: inserted row: i=1 r=2 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0> ++002: table simple: updated columns: b ba i ia r ra s sa u ua + 003: {"error":null,"result":[{"count":2}]} +-004: i=0 r=0 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-004: updated columns: b ++004: table simple: i=0 r=0 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++004: table simple: updated columns: b + 005: {"error":null,"result":[{"count":2}]} +-006: i=0 r=123.5 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-006: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0> +-006: updated columns: r +-006: updated columns: r ++006: table simple: i=0 r=123.5 b=true s= u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++006: table simple: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0> ++006: table simple: updated columns: r ++006: table simple: updated columns: r + 007: {"error":null,"result":[{"uuid":["uuid","<6>"]}]} +-008: i=-1 r=125 b=false s= u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-008: updated columns: ba i ia r ra ++008: table simple: inserted row: i=-1 r=125 b=false s= u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++008: table simple: updated columns: ba i ia r ra + 009: {"error":null,"result":[{"count":2}]} +-010: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-010: i=0 r=123.5 b=true s=newstring u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +-010: updated columns: s +-010: updated columns: s ++010: table simple: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++010: table simple: i=0 r=123.5 b=true s=newstring u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++010: table simple: updated columns: s ++010: table simple: updated columns: s + 011: {"error":null,"result":[{"count":1}]} +-012: ##deleted## uuid=<1> ++012: table simple: deleted row: i=0 r=123.5 b=true s=newstring u=<5> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> + 013: reconnect +-014: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> +-014: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0> +-014: updated columns: b ba i ia r ra s sa u ua +-014: updated columns: ba i ia r ra s ++014: table simple: inserted row: i=-1 r=125 b=false s=newstring u=<5> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<6> ++014: table simple: inserted row: i=1 r=123.5 b=true s=mystring u=<2> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<3> <4>] uuid=<0> ++014: table simple: updated columns: b ba i ia r ra s sa u ua ++014: table simple: updated columns: ba i ia r ra s + 015: done + ]]) + +@@ -1275,19 +1656,31 @@ OVSDB_CHECK_IDL_PY([partial-map idl], + "row":{"name":"myString1","smap":["map",[["key1","value1"],["key2","value2"]]]} }]'] + ], + [?simple2:name,smap,imap 'partialmapinsertelement' 'partialmapinsertmultipleelements' 'partialmapdelelements' 'partialmapmutatenew'], +-[[000: name=myString1 smap=[(key1 value1) (key2 value2)] imap=[] ++[[000: table simple2: name=myString1 smap=[(key1 value1) (key2 value2)] imap=[] uuid=<0> + 001: commit, status=success +-002: name=String2 smap=[(key1 myList1) (key2 value2)] imap=[(3 myids2)] ++002: table simple2: name=String2 smap=[(key1 myList1) (key2 value2)] imap=[(3 myids2)] uuid=<0> + 003: commit, status=success +-004: name=String2 smap=[(key1 myList1) (key2 myList2) (key3 myList3) (key4 myList4)] imap=[(3 myids2)] ++004: table simple2: name=String2 smap=[(key1 myList1) (key2 myList2) (key3 myList3) (key4 myList4)] imap=[(3 myids2)] uuid=<0> + 005: commit, status=success +-006: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)] ++006: table simple2: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)] uuid=<0> + 007: commit, status=success +-008: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)] +-008: name=String2New smap=[(key1 newList1) (key2 newList2)] imap=[] ++008: table simple2: name=String2 smap=[(key2 myList2)] imap=[(3 myids2)] uuid=<0> ++008: table simple2: name=String2New smap=[(key1 newList1) (key2 newList2)] imap=[] uuid=<1> + 009: done + ]]) + ++OVSDB_CHECK_IDL_PY([partial-map update set refmap idl], ++[['["idltest", {"op":"insert", "table":"simple3", "row":{"name":"myString1"}}, ++ {"op":"insert", "table":"simple5", "row":{"name":"myString2"}}]']], ++['partialmapmutateirefmap'], ++[[000: table simple3: name=myString1 uset=[] uref=[] uuid=<0> ++000: table simple5: name=myString2 irefmap=[] uuid=<1> ++001: commit, status=success ++002: table simple3: name=myString1 uset=[] uref=[] uuid=<0> ++002: table simple5: name=myString2 irefmap=[(1 <0>)] uuid=<1> ++003: done ++]]) ++ + m4_define([OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN], + [AT_SETUP([$1 - C]) + AT_KEYWORDS([ovsdb server idl partial update set column positive $5]) +@@ -1307,17 +1700,17 @@ OVSDB_CHECK_IDL_PARTIAL_UPDATE_SET_COLUMN([set, simple3 idl-partial-update-set-c + ], + [], + [[000: Getting records +-001: name=mySet1 uset=[[<0>],[<1>]] uref=[] ++001: table simple3: name=mySet1 uset=[<0>,<1>] uref=[] uuid=<2> + 002: After rename+add new value +-003: name=String2 uset=[[<0>],[<1>],[<2>]] uref=[] ++003: table simple3: name=String2 uset=[<0>,<1>,<3>] uref=[] uuid=<2> + 004: After add new value +-005: name=String2 uset=[[<0>],[<1>],[<2>],[<3>]] uref=[] ++005: table simple3: name=String2 uset=[<0>,<1>,<3>,<4>] uref=[] uuid=<2> + 006: After delete value +-007: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[] ++007: table simple3: name=String2 uset=[<0>,<1>,<4>] uref=[] uuid=<2> + 008: After trying to delete a deleted value +-009: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[] ++009: table simple3: name=String2 uset=[<0>,<1>,<4>] uref=[] uuid=<2> + 010: After add to other table + set of strong ref +-011: name=String2 uset=[[<0>],[<1>],[<3>]] uref=[[<4>]] ++011: table simple3: name=String2 uset=[<0>,<1>,<4>] uref=[<5>] uuid=<2> + 012: End test + ]]) + +@@ -1329,22 +1722,26 @@ OVSDB_CHECK_IDL_PY([partial-set idl], + "mutations": [["uset", "insert", ["set", [["uuid", "000d2f6a-76af-412f-b59d-e7bcd3e84eff"]]]]]}]'] + ], + ['partialrenamesetadd' 'partialduplicateadd' 'partialsetdel' 'partialsetref' 'partialsetoverrideops' 'partialsetadddelete' 'partialsetmutatenew'], +-[[000: name=mySet1 uset=[<0> <1>] ++[[000: table simple3: name=mySet1 uset=[<0> <1>] uref=[] uuid=<2> + 001: commit, status=success +-002: name=String2 uset=[<0> <1> <2>] ++002: table simple3: name=String2 uset=[<0> <1> <3>] uref=[] uuid=<2> + 003: commit, status=success +-004: name=String2 uset=[<0> <1> <2> <3>] ++004: table simple3: name=String2 uset=[<0> <1> <3> <4>] uref=[] uuid=<2> + 005: commit, status=success +-006: name=String2 uset=[<0> <1> <3>] ++006: table simple3: name=String2 uset=[<0> <1> <4>] uref=[] uuid=<2> + 007: commit, status=success +-008: name=String2 uset=[<0> <1> <3>] ++008: table simple3: name=String2 uset=[<0> <1> <4>] uref=[<5>] uuid=<2> ++008: table simple4: name=test uuid=<5> + 009: commit, status=success +-010: name=String2 uset=[<3>] ++010: table simple3: name=String2 uset=[<4>] uref=[<5>] uuid=<2> ++010: table simple4: name=test uuid=<5> + 011: commit, status=success +-012: name=String2 uset=[<4> <5>] ++012: table simple3: name=String2 uset=[<6> <7>] uref=[<5>] uuid=<2> ++012: table simple4: name=test uuid=<5> + 013: commit, status=success +-014: name=String2 uset=[<4> <5>] +-014: name=String3 uset=[<6>] ++014: table simple3: name=String2 uset=[<6> <7>] uref=[<5>] uuid=<2> ++014: table simple3: name=String3 uset=[<8>] uref=[] uuid=<9> ++014: table simple4: name=test uuid=<5> + 015: done + ]]) + +@@ -1352,6 +1749,28 @@ m4_define([OVSDB_CHECK_IDL_NOTIFY], [OVSDB_CHECK_IDL_PY([$1], [], [$2], [$3], [notify $4], [$5]) OVSDB_CHECK_IDL_SSL_PY([$1], [], [$2], [$3], [notify $4], [$5])]) @@ -86322,20 +87406,108 @@ index cc38d69c10..d0feaa31fe 100644 + "uuid-name": "l2row", + "row": {"i": 2, "l1": ["set", [["named-uuid", "l1row"]]]}}]']], +[[000: empty -+000: event:create, row={uuid=<0>}, updates=None -+000: event:create, row={uuid=<1>}, updates=None ++000: event:create, row={}, uuid=<0>, updates=None ++000: event:create, row={}, uuid=<1>, updates=None +001: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]} -+002: event:create, row={i=1 uuid=<2> l2=[<3>]}, updates=None -+002: event:create, row={i=2 uuid=<3> l1=[<2>]}, updates=None -+002: i=1 k=1 ka=[] l2=2 uuid=<2> -+002: i=2 l1=1 uuid=<3> ++002: event:create, row={i=1 l2=[<3>]}, uuid=<2>, updates=None ++002: event:create, row={i=2 l1=[<2>]}, uuid=<3>, updates=None ++002: table link1: i=1 k=1 ka=[] l2=2 uuid=<2> ++002: table link2: i=2 l1=1 uuid=<3> +003: done +]]) + OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], [['track-notify' \ '["idltest", -@@ -1764,33 +1920,25 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF([set, simple3 idl-compound-index-with-re +@@ -1404,44 +1823,44 @@ OVSDB_CHECK_IDL_NOTIFY([simple idl verify notify], + "where": [["i", "==", 0]]}]' \ + 'reconnect']], + [[000: empty +-000: event:create, row={uuid=<0>}, updates=None +-000: event:create, row={uuid=<1>}, updates=None ++000: event:create, row={}, uuid=<0>, updates=None ++000: event:create, row={}, uuid=<1>, updates=None + 001: {"error":null,"result":[{"uuid":["uuid","<2>"]},{"uuid":["uuid","<3>"]}]} +-002: event:create, row={i=0 r=0 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>}, updates=None +-002: event:create, row={i=1 r=2 b=true s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2>}, updates=None +-002: i=0 r=0 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> +-002: i=1 r=2 b=true s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> ++002: event:create, row={i=0 r=0 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[]}, uuid=<3>, updates=None ++002: event:create, row={i=1 r=2 b=true s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>]}, uuid=<2>, updates=None ++002: table simple: i=0 r=0 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++002: table simple: i=1 r=2 b=true s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> + 003: {"error":null,"result":[{"count":2}]} +-004: event:update, row={i=1 r=2 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2>}, updates={b=true uuid=<2>} +-004: i=0 r=0 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> +-004: i=1 r=2 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> ++004: event:update, row={i=1 r=2 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>]}, uuid=<2>, updates={b=true} ++004: table simple: i=0 r=0 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++004: table simple: i=1 r=2 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> + 005: {"error":null,"result":[{"count":2}]} +-006: event:update, row={i=0 r=123.5 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>}, updates={r=0 uuid=<3>} +-006: event:update, row={i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2>}, updates={r=2 uuid=<2>} +-006: i=0 r=123.5 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> +-006: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> ++006: event:update, row={i=0 r=123.5 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[]}, uuid=<3>, updates={r=0} ++006: event:update, row={i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>]}, uuid=<2>, updates={r=2} ++006: table simple: i=0 r=123.5 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++006: table simple: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> + 007: {"error":null,"result":[{"uuid":["uuid","<8>"]}]} +-008: event:create, row={i=-1 r=125 b=false s= u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8>}, updates=None +-008: i=-1 r=125 b=false s= u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8> +-008: i=0 r=123.5 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> +-008: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> ++008: event:create, row={i=-1 r=125 b=false s= u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[]}, uuid=<8>, updates=None ++008: table simple: i=-1 r=125 b=false s= u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8> ++008: table simple: i=0 r=123.5 b=false s= u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++008: table simple: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> + 009: {"error":null,"result":[{"count":2}]} +-010: event:update, row={i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8>}, updates={s= uuid=<8>} +-010: event:update, row={i=0 r=123.5 b=false s=newstring u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>}, updates={s= uuid=<3>} +-010: i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8> +-010: i=0 r=123.5 b=false s=newstring u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> +-010: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> ++010: event:update, row={i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[]}, uuid=<8>, updates={s=} ++010: event:update, row={i=0 r=123.5 b=false s=newstring u=<4> ia=[] ra=[] ba=[] sa=[] ua=[]}, uuid=<3>, updates={s=} ++010: table simple: i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8> ++010: table simple: i=0 r=123.5 b=false s=newstring u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3> ++010: table simple: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> + 011: {"error":null,"result":[{"count":1}]} +-012: event:delete, row={i=0 r=123.5 b=false s=newstring u=<4> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<3>}, updates=None +-012: i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8> +-012: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> ++012: event:delete, row={i=0 r=123.5 b=false s=newstring u=<4> ia=[] ra=[] ba=[] sa=[] ua=[]}, uuid=<3>, updates=None ++012: table simple: i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8> ++012: table simple: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> + 013: reconnect +-014: event:create, row={i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8>}, updates=None +-014: event:create, row={i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2>}, updates=None +-014: event:create, row={uuid=<0>}, updates=None +-014: event:create, row={uuid=<1>}, updates=None +-014: i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8> +-014: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> ++014: event:create, row={i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[]}, uuid=<8>, updates=None ++014: event:create, row={i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>]}, uuid=<2>, updates=None ++014: event:create, row={}, uuid=<0>, updates=None ++014: event:create, row={}, uuid=<1>, updates=None ++014: table simple: i=-1 r=125 b=false s=newstring u=<4> ia=[1] ra=[1.5] ba=[false] sa=[] ua=[] uuid=<8> ++014: table simple: i=1 r=123.5 b=false s=mystring u=<5> ia=[1 2 3] ra=[-0.5] ba=[true] sa=[abc def] ua=[<6> <7>] uuid=<2> + 015: done + ]]) + +@@ -1754,43 +2173,35 @@ OVSDB_CHECK_IDL_COMPOUND_INDEX_WITH_REF([set, simple3 idl-compound-index-with-re + [], + [], + [[000: After add to other table + set of strong ref +-001: name= uset=[] uref=[[<0>]] ++001: table simple3: name= uset=[] uref=[<0>] uuid=<1> + 002: check simple4: not empty + 003: Query using index with reference +-004: name= uset=[] uref=[[<0>]] ++004: table simple3: name= uset=[] uref=[<0>] uuid=<1> + 005: After delete + 007: check simple4: empty + 008: End test ]]) m4_define([CHECK_STREAM_OPEN_BLOCK], @@ -86383,7 +87555,7 @@ index cc38d69c10..d0feaa31fe 100644 # same as OVSDB_CHECK_IDL but uses Python IDL implementation with tcp # with multiple remotes to assert the idl connects to the leader of the Raft cluster -@@ -1798,7 +1946,7 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], +@@ -1798,7 +2209,7 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], [AT_SETUP([$1 - Python3 (leader only)]) AT_KEYWORDS([ovsdb server idl Python leader_only with tcp socket]) m4_define([LPBK],[127.0.0.1]) @@ -86392,7 +87564,7 @@ index cc38d69c10..d0feaa31fe 100644 PARSE_LISTENING_PORT([s2.log], [TCP_PORT_1]) PARSE_LISTENING_PORT([s3.log], [TCP_PORT_2]) PARSE_LISTENING_PORT([s1.log], [TCP_PORT_3]) -@@ -1814,3 +1962,59 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], +@@ -1814,3 +2225,59 @@ m4_define([OVSDB_CHECK_IDL_LEADER_ONLY_PY], OVSDB_CHECK_IDL_LEADER_ONLY_PY([Check Python IDL connects to leader], 3, ['remote']) OVSDB_CHECK_IDL_LEADER_ONLY_PY([Check Python IDL reconnects to leader], 3, ['remote' '+remotestop' 'remote']) @@ -86444,12 +87616,12 @@ index cc38d69c10..d0feaa31fe 100644 + [[000: change conditions +001: empty +002: change conditions -+003: i=2 r=1 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++003: table simple: i=2 r=1 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +004: change conditions +005: reconnect -+006: i=2 r=1 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> ++006: table simple: i=2 r=1 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<1> +007: {"error":null,"result":[{"count":1}]} -+008: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> ++008: table simple: i=1 r=2 b=true s= u=<0> ia=[] ra=[] ba=[] sa=[] ua=[] uuid=<2> +009: done +]]) diff --git a/tests/ovsdb-monitor-sort.py b/tests/ovsdb-monitor-sort.py @@ -86735,66 +87907,459 @@ index d7854a1df3..32a77392c6 100755 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/test-ovsdb.c b/tests/test-ovsdb.c -index b1a4be36bb..31513c537f 100644 +index b1a4be36bb..a886f971e7 100644 --- a/tests/test-ovsdb.c +++ b/tests/test-ovsdb.c -@@ -1904,6 +1904,26 @@ print_idl_row_updated_link2(const struct idltest_link2 *l2, int step) +@@ -19,6 +19,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -52,6 +53,8 @@ + #include "util.h" + #include "openvswitch/vlog.h" + ++VLOG_DEFINE_THIS_MODULE(test_ovsdb); ++ + struct test_ovsdb_pvt_context { + bool track; + }; +@@ -1844,164 +1847,319 @@ compare_link1(const void *a_, const void *b_) + return a->i < b->i ? -1 : a->i > b->i; + } + ++static void OVS_PRINTF_FORMAT(1, 2) ++print_and_log(const char *format, ...) ++{ ++ va_list args; ++ va_start(args, format); ++ char *message = xvasprintf(format, args); ++ va_end(args); ++ ++ printf("%s\n", message); ++ VLOG_INFO("%s", message); ++ ++ free(message); ++} ++ ++static char * ++format_idl_row(const struct ovsdb_idl_row *row, int step, const char *contents) ++{ ++ const char *change_str = ++ !ovsdb_idl_track_is_set(row->table) ++ ? "" ++ : ovsdb_idl_row_get_seqno(row, OVSDB_IDL_CHANGE_INSERT) > 0 ++ ? "inserted row: " ++ : ovsdb_idl_row_get_seqno(row, OVSDB_IDL_CHANGE_DELETE) > 0 ++ ? "deleted row: " ++ : ""; ++ ++ return xasprintf("%03d: table %s: %s%s uuid=" UUID_FMT, ++ step, row->table->class_->name, change_str, contents, ++ UUID_ARGS(&row->uuid)); ++} ++ + static void + print_idl_row_updated_simple(const struct idltest_simple *s, int step) + { +- size_t i; +- bool updated = false; +- +- for (i = 0; i < IDLTEST_SIMPLE_N_COLUMNS; i++) { ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ for (size_t i = 0; i < IDLTEST_SIMPLE_N_COLUMNS; i++) { + if (idltest_simple_is_updated(s, i)) { +- if (!updated) { +- printf("%03d: updated columns:", step); +- updated = true; +- } +- printf(" %s", idltest_simple_columns[i].name); ++ ds_put_format(&updates, " %s", idltest_simple_columns[i].name); + } + } +- if (updated) { +- printf("\n"); ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, s->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); + } + } + + static void + print_idl_row_updated_link1(const struct idltest_link1 *l1, int step) + { +- size_t i; +- bool updated = false; +- +- for (i = 0; i < IDLTEST_LINK1_N_COLUMNS; i++) { ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ for (size_t i = 0; i < IDLTEST_LINK1_N_COLUMNS; i++) { + if (idltest_link1_is_updated(l1, i)) { +- if (!updated) { +- printf("%03d: updated columns:", step); +- updated = true; +- } +- printf(" %s", idltest_link1_columns[i].name); ++ ds_put_format(&updates, " %s", idltest_link1_columns[i].name); + } + } +- if (updated) { +- printf("\n"); ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, l1->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); } } + static void + print_idl_row_updated_link2(const struct idltest_link2 *l2, int step) + { +- size_t i; +- bool updated = false; +- +- for (i = 0; i < IDLTEST_LINK2_N_COLUMNS; i++) { ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ for (size_t i = 0; i < IDLTEST_LINK2_N_COLUMNS; i++) { + if (idltest_link2_is_updated(l2, i)) { +- if (!updated) { +- printf("%03d: updated columns:", step); +- updated = true; +- } +- printf(" %s", idltest_link2_columns[i].name); ++ ds_put_format(&updates, " %s", idltest_link2_columns[i].name); + } + } +- if (updated) { +- printf("\n"); ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, l2->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); + } + } + + static void +-print_idl_row_updated_singleton(const struct idltest_singleton *sng, int step) ++print_idl_row_updated_simple3(const struct idltest_simple3 *s3, int step) + { +- size_t i; +- bool updated = false; ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ for (size_t i = 0; i < IDLTEST_SIMPLE3_N_COLUMNS; i++) { ++ if (idltest_simple3_is_updated(s3, i)) { ++ ds_put_format(&updates, " %s", idltest_simple3_columns[i].name); ++ } ++ } ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, s3->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); ++ } ++} ++ ++static void ++print_idl_row_updated_simple4(const struct idltest_simple4 *s4, int step) ++{ ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ for (size_t i = 0; i < IDLTEST_SIMPLE4_N_COLUMNS; i++) { ++ if (idltest_simple4_is_updated(s4, i)) { ++ ds_put_format(&updates, " %s", idltest_simple4_columns[i].name); ++ } ++ } ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, s4->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); ++ } ++} + +- for (i = 0; i < IDLTEST_SINGLETON_N_COLUMNS; i++) { +static void +print_idl_row_updated_simple6(const struct idltest_simple6 *s6, int step) +{ -+ size_t i; -+ bool updated = false; -+ -+ for (i = 0; i < IDLTEST_SIMPLE6_N_COLUMNS; i++) { ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ for (size_t i = 0; i < IDLTEST_SIMPLE6_N_COLUMNS; i++) { + if (idltest_simple6_is_updated(s6, i)) { -+ if (!updated) { -+ printf("%03d: updated columns:", step); -+ updated = true; -+ } -+ printf(" %s", idltest_simple6_columns[i].name); ++ ds_put_format(&updates, " %s", idltest_simple6_columns[i].name); + } + } -+ if (updated) { -+ printf("\n"); ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, s6->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); + } +} + ++static void ++print_idl_row_updated_singleton(const struct idltest_singleton *sng, int step) ++{ ++ struct ds updates = DS_EMPTY_INITIALIZER; ++ for (size_t i = 0; i < IDLTEST_SINGLETON_N_COLUMNS; i++) { + if (idltest_singleton_is_updated(sng, i)) { +- if (!updated) { +- printf("%03d: updated columns:", step); +- updated = true; +- } +- printf(" %s", idltest_singleton_columns[i].name); ++ ds_put_format(&updates, " %s", idltest_singleton_columns[i].name); + } + } +- if (updated) { +- printf("\n"); ++ if (updates.length) { ++ print_and_log("%03d: table %s: updated columns:%s", ++ step, sng->header_.table->class_->name, ++ ds_cstr(&updates)); ++ ds_destroy(&updates); + } + } + + static void + print_idl_row_simple(const struct idltest_simple *s, int step) + { +- size_t i; +- +- printf("%03d: i=%"PRId64" r=%g b=%s s=%s u="UUID_FMT" ia=[", +- step, s->i, s->r, s->b ? "true" : "false", +- s->s, UUID_ARGS(&s->u)); +- for (i = 0; i < s->n_ia; i++) { +- printf("%s%"PRId64, i ? " " : "", s->ia[i]); ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ ds_put_format(&msg, "i=%"PRId64" r=%g b=%s s=%s u="UUID_FMT" ia=[", ++ s->i, s->r, s->b ? "true" : "false", ++ s->s, UUID_ARGS(&s->u)); ++ for (size_t i = 0; i < s->n_ia; i++) { ++ ds_put_format(&msg, "%s%"PRId64, i ? " " : "", s->ia[i]); + } +- printf("] ra=["); +- for (i = 0; i < s->n_ra; i++) { +- printf("%s%g", i ? " " : "", s->ra[i]); ++ ds_put_cstr(&msg, "] ra=["); ++ for (size_t i = 0; i < s->n_ra; i++) { ++ ds_put_format(&msg, "%s%g", i ? " " : "", s->ra[i]); + } +- printf("] ba=["); +- for (i = 0; i < s->n_ba; i++) { +- printf("%s%s", i ? " " : "", s->ba[i] ? "true" : "false"); ++ ds_put_cstr(&msg, "] ba=["); ++ for (size_t i = 0; i < s->n_ba; i++) { ++ ds_put_format(&msg, "%s%s", i ? " " : "", s->ba[i] ? "true" : "false"); + } +- printf("] sa=["); +- for (i = 0; i < s->n_sa; i++) { +- printf("%s%s", i ? " " : "", s->sa[i]); ++ ds_put_cstr(&msg, "] sa=["); ++ for (size_t i = 0; i < s->n_sa; i++) { ++ ds_put_format(&msg, "%s%s", i ? " " : "", s->sa[i]); + } +- printf("] ua=["); +- for (i = 0; i < s->n_ua; i++) { +- printf("%s"UUID_FMT, i ? " " : "", UUID_ARGS(&s->ua[i])); ++ ds_put_cstr(&msg, "] ua=["); ++ for (size_t i = 0; i < s->n_ua; i++) { ++ ds_put_format(&msg, "%s"UUID_FMT, i ? " " : "", UUID_ARGS(&s->ua[i])); + } +- printf("] uuid="UUID_FMT"\n", UUID_ARGS(&s->header_.uuid)); ++ ds_put_cstr(&msg, "]"); ++ ++ char *row_msg = format_idl_row(&s->header_, step, ds_cstr(&msg)); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); ++ + print_idl_row_updated_simple(s, step); + } + static void - print_idl_row_updated_singleton(const struct idltest_singleton *sng, int step) + print_idl_row_link1(const struct idltest_link1 *l1, int step) { -@@ -1991,6 +2011,22 @@ print_idl_row_link2(const struct idltest_link2 *l2, int step) +- struct idltest_link1 **links; +- size_t i; +- +- printf("%03d: i=%"PRId64" k=", step, l1->i); ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ ds_put_format(&msg, "i=%"PRId64" k=", l1->i); + if (l1->k) { +- printf("%"PRId64, l1->k->i); ++ ds_put_format(&msg, "%"PRId64, l1->k->i); + } +- printf(" ka=["); +- links = xmemdup(l1->ka, l1->n_ka * sizeof *l1->ka); ++ ds_put_cstr(&msg, " ka=["); ++ struct idltest_link1 **links = xmemdup(l1->ka, l1->n_ka * sizeof *l1->ka); + qsort(links, l1->n_ka, sizeof *links, compare_link1); +- for (i = 0; i < l1->n_ka; i++) { +- printf("%s%"PRId64, i ? " " : "", links[i]->i); ++ for (size_t i = 0; i < l1->n_ka; i++) { ++ ds_put_format(&msg, "%s%"PRId64, i ? " " : "", links[i]->i); + } + free(links); +- printf("] l2="); ++ ds_put_cstr(&msg, "] l2="); + if (l1->l2) { +- printf("%"PRId64, l1->l2->i); ++ ds_put_format(&msg, "%"PRId64, l1->l2->i); + } +- printf(" uuid="UUID_FMT"\n", UUID_ARGS(&l1->header_.uuid)); ++ ++ char *row_msg = format_idl_row(&l1->header_, step, ds_cstr(&msg)); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); ++ + print_idl_row_updated_link1(l1, step); + } + + static void + print_idl_row_link2(const struct idltest_link2 *l2, int step) + { +- printf("%03d: i=%"PRId64" l1=", step, l2->i); ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ ds_put_format(&msg, "i=%"PRId64" l1=", l2->i); + if (l2->l1) { +- printf("%"PRId64, l2->l1->i); ++ ds_put_format(&msg, "%"PRId64, l2->l1->i); + } +- printf(" uuid="UUID_FMT"\n", UUID_ARGS(&l2->header_.uuid)); ++ ++ char *row_msg = format_idl_row(&l2->header_, step, ds_cstr(&msg)); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); ++ print_idl_row_updated_link2(l2, step); } +static void -+print_idl_row_simple6(const struct idltest_simple6 *s6, int step) ++print_idl_row_simple3(const struct idltest_simple3 *s3, int step) +{ -+ int i; ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ size_t i; + -+ printf("%03d: name=%s ", step, s6->name); -+ printf("weak_ref=["); -+ for (i = 0; i < s6->n_weak_ref; i++) { -+ printf("%s"UUID_FMT, i ? " " : "", -+ UUID_ARGS(&s6->weak_ref[i]->header_.uuid)); ++ ds_put_format(&msg, "name=%s uset=[", s3->name); ++ for (i = 0; i < s3->n_uset; i++) { ++ ds_put_format(&msg, UUID_FMT"%s", ++ UUID_ARGS(&s3->uset[i]), ++ i < s3->n_uset - 1 ? "," : ""); ++ } ++ ds_put_cstr(&msg, "] uref=["); ++ for (i = 0; i < s3->n_uref; i++) { ++ ds_put_format(&msg, UUID_FMT"%s", ++ UUID_ARGS(&s3->uref[i]->header_.uuid), ++ i < s3->n_uref -1 ? "," : ""); + } ++ ds_put_cstr(&msg, "]"); ++ ++ char *row_msg = format_idl_row(&s3->header_, step, ds_cstr(&msg)); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); ++ ++ print_idl_row_updated_simple3(s3, step); ++} ++ ++static void ++print_idl_row_simple4(const struct idltest_simple4 *s4, int step) ++{ ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ ds_put_format(&msg, "name=%s", s4->name); ++ ++ char *row_msg = format_idl_row(&s4->header_, step, ds_cstr(&msg)); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); ++ ++ print_idl_row_updated_simple4(s4, step); ++} ++ ++static void ++print_idl_row_simple6(const struct idltest_simple6 *s6, int step) ++{ ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ ds_put_format(&msg, "name=%s ", s6->name); ++ ds_put_cstr(&msg, "weak_ref=["); ++ for (size_t i = 0; i < s6->n_weak_ref; i++) { ++ ds_put_format(&msg, "%s"UUID_FMT, i ? " " : "", ++ UUID_ARGS(&s6->weak_ref[i]->header_.uuid)); ++ } ++ ds_put_cstr(&msg, "]"); ++ ++ char *row_msg = format_idl_row(&s6->header_, step, ds_cstr(&msg)); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); + -+ printf("] uuid="UUID_FMT"\n", UUID_ARGS(&s6->header_.uuid)); + print_idl_row_updated_simple6(s6, step); +} + static void print_idl_row_singleton(const struct idltest_singleton *sng, int step) { -@@ -2030,37 +2066,64 @@ print_idl(struct ovsdb_idl *idl, int step) +- printf("%03d: name=%s", step, sng->name); +- printf(" uuid="UUID_FMT"\n", UUID_ARGS(&sng->header_.uuid)); ++ struct ds msg = DS_EMPTY_INITIALIZER; ++ ds_put_format(&msg, "name=%s", sng->name); ++ ++ char *row_msg = format_idl_row(&sng->header_, step, ds_cstr(&msg)); ++ print_and_log("%s", row_msg); ++ ds_destroy(&msg); ++ free(row_msg); ++ + print_idl_row_updated_singleton(sng, step); + } + + static void + print_idl(struct ovsdb_idl *idl, int step) + { ++ const struct idltest_simple3 *s3; ++ const struct idltest_simple4 *s4; ++ const struct idltest_simple6 *s6; + const struct idltest_simple *s; + const struct idltest_link1 *l1; + const struct idltest_link2 *l2; +@@ -2020,49 +2178,65 @@ print_idl(struct ovsdb_idl *idl, int step) + print_idl_row_link2(l2, step); + n++; + } ++ IDLTEST_SIMPLE3_FOR_EACH (s3, idl) { ++ print_idl_row_simple3(s3, step); ++ n++; ++ } ++ IDLTEST_SIMPLE4_FOR_EACH (s4, idl) { ++ print_idl_row_simple4(s4, step); ++ n++; ++ } ++ IDLTEST_SIMPLE6_FOR_EACH (s6, idl) { ++ print_idl_row_simple6(s6, step); ++ n++; ++ } + IDLTEST_SINGLETON_FOR_EACH (sng, idl) { + print_idl_row_singleton(sng, step); + n++; + } + if (!n) { +- printf("%03d: empty\n", step); ++ print_and_log("%03d: empty", step); + } } static void -print_idl_track(struct ovsdb_idl *idl, int step, unsigned int seqno) +print_idl_track(struct ovsdb_idl *idl, int step) { ++ const struct idltest_simple3 *s3; ++ const struct idltest_simple4 *s4; + const struct idltest_simple6 *s6; const struct idltest_simple *s; const struct idltest_link1 *l1; @@ -86806,72 +88371,93 @@ index b1a4be36bb..31513c537f 100644 - printf("%03d: ##deleted## uuid="UUID_FMT"\n", step, UUID_ARGS(&s->header_.uuid)); - } else { - print_idl_row_simple(s, step); +- } + print_idl_row_simple(s, step); -+ if (idltest_simple_is_deleted(s)) { -+ printf("%03d: deleted row: uuid="UUID_FMT"\n", step, -+ UUID_ARGS(&s->header_.uuid)); -+ } else if (idltest_simple_is_new(s)) { -+ printf("%03d: inserted row: uuid="UUID_FMT"\n", step, -+ UUID_ARGS(&s->header_.uuid)); - } n++; } IDLTEST_LINK1_FOR_EACH_TRACKED (l1, idl) { - if (idltest_simple_row_get_seqno(s, OVSDB_IDL_CHANGE_DELETE) >= seqno) { - printf("%03d: ##deleted## uuid="UUID_FMT"\n", step, UUID_ARGS(&s->header_.uuid)); -+ if (idltest_link1_is_deleted(l1)) { -+ printf("%03d: deleted row: uuid="UUID_FMT"\n", step, -+ UUID_ARGS(&l1->header_.uuid)); - } else { - print_idl_row_link1(l1, step); -+ if (idltest_link1_is_new(l1)) { -+ printf("%03d: inserted row: uuid="UUID_FMT"\n", step, -+ UUID_ARGS(&l1->header_.uuid)); -+ } - } +- } else { +- print_idl_row_link1(l1, step); +- } ++ print_idl_row_link1(l1, step); n++; } IDLTEST_LINK2_FOR_EACH_TRACKED (l2, idl) { - if (idltest_simple_row_get_seqno(s, OVSDB_IDL_CHANGE_DELETE) >= seqno) { - printf("%03d: ##deleted## uuid="UUID_FMT"\n", step, UUID_ARGS(&s->header_.uuid)); -+ if (idltest_link2_is_deleted(l2)) { -+ printf("%03d: deleted row: uuid="UUID_FMT"\n", step, -+ UUID_ARGS(&l2->header_.uuid)); - } else { - print_idl_row_link2(l2, step); -+ if (idltest_link2_is_new(l2)) { -+ printf("%03d: inserted row: uuid="UUID_FMT"\n", step, -+ UUID_ARGS(&l2->header_.uuid)); -+ } -+ -+ } +- } else { +- print_idl_row_link2(l2, step); +- } ++ print_idl_row_link2(l2, step); + n++; + } ++ IDLTEST_SIMPLE3_FOR_EACH_TRACKED (s3, idl) { ++ print_idl_row_simple3(s3, step); ++ n++; ++ } ++ IDLTEST_SIMPLE4_FOR_EACH_TRACKED (s4, idl) { ++ print_idl_row_simple4(s4, step); + n++; + } + IDLTEST_SIMPLE6_FOR_EACH_TRACKED (s6, idl) { + print_idl_row_simple6(s6, step); -+ if (idltest_simple6_is_deleted(s6)) { -+ printf("%03d: deleted row: uuid="UUID_FMT"\n", step, -+ UUID_ARGS(&s6->header_.uuid)); -+ } else if (idltest_simple6_is_new(s6)) { -+ printf("%03d: inserted row: uuid="UUID_FMT"\n", step, -+ UUID_ARGS(&s6->header_.uuid)); - } - n++; - } ++ n++; ++ } + if (!n) { - printf("%03d: empty\n", step); +- printf("%03d: empty\n", step); ++ print_and_log("%03d: empty", step); } -@@ -2282,6 +2345,8 @@ find_table_class(const char *name) + } + +@@ -2251,7 +2425,7 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) + ovsdb_idl_check_consistency(idl); + break; + } else if (!strcmp(name, "destroy")) { +- printf("%03d: destroy\n", step); ++ print_and_log("%03d: destroy", step); + ovsdb_idl_txn_destroy(txn); + ovsdb_idl_check_consistency(idl); + return; +@@ -2262,13 +2436,17 @@ idl_set(struct ovsdb_idl *idl, char *commands, int step) + } + + status = ovsdb_idl_txn_commit_block(txn); +- printf("%03d: commit, status=%s", +- step, ovsdb_idl_txn_status_to_string(status)); ++ ++ struct ds s = DS_EMPTY_INITIALIZER; ++ ds_put_format(&s, "%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)); ++ ds_put_format(&s, ", increment=%"PRId64, ++ ovsdb_idl_txn_get_increment_new_value(txn)); + } +- putchar('\n'); ++ print_and_log("%s", ds_cstr(&s)); ++ ds_destroy(&s); ++ + ovsdb_idl_txn_destroy(txn); + ovsdb_idl_check_consistency(idl); + } +@@ -2282,6 +2460,12 @@ find_table_class(const char *name) return &idltest_table_link1; } else if (!strcmp(name, "link2")) { return &idltest_table_link2; ++ } else if (!strcmp(name, "simple3")) { ++ return &idltest_table_simple3; ++ } else if (!strcmp(name, "simple4")) { ++ return &idltest_table_simple4; + } else if (!strcmp(name, "simple6")) { + return &idltest_table_simple6; } return NULL; } -@@ -2391,6 +2456,10 @@ update_conditions(struct ovsdb_idl *idl, char *commands) +@@ -2391,6 +2575,10 @@ update_conditions(struct ovsdb_idl *idl, char *commands) if (seqno == next_seqno ) { ovs_fatal(0, "condition unchanged"); } @@ -86882,7 +88468,16 @@ index b1a4be36bb..31513c537f 100644 ovsdb_idl_condition_destroy(&cond); json_destroy(json); } -@@ -2465,7 +2534,7 @@ do_idl(struct ovs_cmdl_context *ctx) +@@ -2436,7 +2624,7 @@ do_idl(struct ovs_cmdl_context *ctx) + const char cond_s[] = "condition "; + if (ctx->argc > 2 && strstr(ctx->argv[2], cond_s)) { + update_conditions(idl, ctx->argv[2] + strlen(cond_s)); +- printf("%03d: change conditions\n", step++); ++ print_and_log("%03d: change conditions", step++); + i = 3; + } else { + i = 2; +@@ -2465,7 +2653,7 @@ do_idl(struct ovs_cmdl_context *ctx) /* Print update. */ if (track) { @@ -86891,8 +88486,79 @@ index b1a4be36bb..31513c537f 100644 ovsdb_idl_track_clear(idl); } else { print_idl(idl, step++); +@@ -2474,11 +2662,11 @@ do_idl(struct ovs_cmdl_context *ctx) + seqno = ovsdb_idl_get_seqno(idl); + + if (!strcmp(arg, "reconnect")) { +- printf("%03d: reconnect\n", step++); ++ print_and_log("%03d: reconnect", step++); + ovsdb_idl_force_reconnect(idl); + } else if (!strncmp(arg, cond_s, strlen(cond_s))) { + update_conditions(idl, arg + strlen(cond_s)); +- printf("%03d: change conditions\n", step++); ++ print_and_log("%03d: change conditions", step++); + } else if (arg[0] != '[') { + idl_set(idl, arg, step++); + } else { +@@ -2489,13 +2677,17 @@ do_idl(struct ovs_cmdl_context *ctx) + if (error || reply->error) { + ovs_fatal(error, "jsonrpc transaction failed"); + } +- printf("%03d: ", step++); + if (reply->result) { + parse_uuids(reply->result, symtab, &n_uuids); + } + json_destroy(reply->id); + reply->id = NULL; +- print_and_free_json(jsonrpc_msg_to_json(reply)); ++ ++ struct json *msg_json = jsonrpc_msg_to_json(reply); ++ char *msg_s = json_to_string(msg_json, JSSF_SORT); ++ json_destroy(msg_json); ++ print_and_log("%03d: %s", step++, msg_s); ++ free(msg_s); + } + } + ovsdb_symbol_table_destroy(symtab); +@@ -2515,7 +2707,7 @@ do_idl(struct ovs_cmdl_context *ctx) + print_idl(idl, step++); + ovsdb_idl_track_clear(idl); + ovsdb_idl_destroy(idl); +- printf("%03d: done\n", step); ++ print_and_log("%03d: done", step); + } + + static void +@@ -2625,27 +2817,6 @@ do_idl_partial_update_map_column(struct ovs_cmdl_context *ctx) + printf("%03d: End test\n", step); + } + +-static void +-print_idl_row_simple3(const struct idltest_simple3 *s, int step) +-{ +- size_t i; +- const struct ovsdb_datum *uset; +- const struct ovsdb_datum *uref; +- +- uset = idltest_simple3_get_uset(s, OVSDB_TYPE_UUID); +- printf("%03d: name=%s uset=[", +- step, s->name); +- for (i = 0; i < uset->n; i++) { +- printf("["UUID_FMT"]%s", UUID_ARGS(&(uset->keys[i].uuid)), i < uset->n-1? ",": ""); +- } +- uref = idltest_simple3_get_uref(s, OVSDB_TYPE_UUID); +- printf("] uref=["); +- for (i = 0; i < uref->n; i++) { +- printf("["UUID_FMT"]%s", UUID_ARGS(&(uref->keys[i].uuid)), i < uref->n-1? ",": ""); +- } +- printf("]\n"); +-} +- + static void + dump_simple3(struct ovsdb_idl *idl, + const struct idltest_simple3 *myRow, diff --git a/tests/test-ovsdb.py b/tests/test-ovsdb.py -index 1b94b79a07..9d3228f234 100644 +index 1b94b79a07..72a319123e 100644 --- a/tests/test-ovsdb.py +++ b/tests/test-ovsdb.py @@ -28,6 +28,7 @@ import ovs.util @@ -86903,7 +88569,7 @@ index 1b94b79a07..9d3228f234 100644 from ovs.fatal_signal import signal_alarm vlog = ovs.vlog.Vlog("test-ovsdb") -@@ -159,7 +160,10 @@ def get_simple_printable_row_string(row, columns): +@@ -159,7 +160,12 @@ def get_simple_printable_row_string(row, columns): is ovs.db.data.Atom): value = getattr(row, column) if isinstance(value, dict): @@ -86912,37 +88578,178 @@ index 1b94b79a07..9d3228f234 100644 + for k, v in value.items()) + if isinstance(value, (list, tuple)): + value = sorted((row_to_uuid(v) for v in value)) ++ elif isinstance(value, list): ++ value = sorted(row_to_uuid(v) for v in value) s += "%s=%s " % (column, value) s = s.strip() s = re.sub('""|,|u?\'', "", s) -@@ -170,9 +174,10 @@ def get_simple_printable_row_string(row, columns): +@@ -170,9 +176,10 @@ def get_simple_printable_row_string(row, columns): return s -def get_simple_table_printable_row(row): +def get_simple_table_printable_row(row, *additional_columns): simple_columns = ["i", "r", "b", "s", "u", "ia", - "ra", "ba", "sa", "ua", "uuid"] +- "ra", "ba", "sa", "ua", "uuid"] ++ "ra", "ba", "sa", "ua"] + simple_columns.extend(additional_columns) return get_simple_printable_row_string(row, simple_columns) -@@ -212,6 +217,14 @@ def print_idl(idl, step): - print(s) +@@ -182,73 +189,118 @@ def get_simple2_table_printable_row(row): + + + def get_simple3_table_printable_row(row): +- simple3_columns = ["name", "uset"] ++ simple3_columns = ["name", "uset", "uref"] + return get_simple_printable_row_string(row, simple3_columns) + + ++def get_simple4_table_printable_row(row): ++ simple4_columns = ["name"] ++ return get_simple_printable_row_string(row, simple4_columns) ++ ++ ++def get_simple5_table_printable_row(row): ++ simple5_columns = ["name", "irefmap"] ++ return get_simple_printable_row_string(row, simple5_columns) ++ ++ ++def get_simple6_table_printable_row(row): ++ simple6_columns = ["name", "weak_ref"] ++ return get_simple_printable_row_string(row, simple6_columns) ++ ++ ++def get_link1_table_printable_row(row): ++ s = ["i=%s k=" % row.i] ++ if hasattr(row, "k") and row.k: ++ s.append(str(row.k.i)) ++ if hasattr(row, "ka"): ++ s.append(" ka=[") ++ s.append(' '.join(sorted(str(ka.i) for ka in row.ka))) ++ s.append("] l2=") ++ if hasattr(row, "l2") and row.l2: ++ s.append(str(row.l2[0].i)) ++ return ''.join(s) ++ ++ ++def get_link2_table_printable_row(row): ++ s = "i=%s l1=" % row.i ++ if hasattr(row, "l1") and row.l1: ++ s += str(row.l1[0].i) ++ return s ++ ++ ++def get_singleton_table_printable_row(row): ++ return "name=%s" % row.name ++ ++ ++def print_row(table, row, step, contents): ++ s = "%03d: table %s: %s " % (step, table, contents) ++ s += get_simple_printable_row_string(row, ["uuid"]) ++ print(s) ++ ++ + def print_idl(idl, step): + n = 0 + if "simple" in idl.tables: + simple = idl.tables["simple"].rows + for row in simple.values(): +- s = "%03d: " % step +- s += get_simple_table_printable_row(row) +- print(s) ++ print_row("simple", row, step, ++ get_simple_table_printable_row(row)) + n += 1 + + if "simple2" in idl.tables: + simple2 = idl.tables["simple2"].rows + for row in simple2.values(): +- s = "%03d: " % step +- s += get_simple2_table_printable_row(row) +- print(s) ++ print_row("simple2", row, step, ++ get_simple2_table_printable_row(row)) n += 1 + if "simple3" in idl.tables: + simple3 = idl.tables["simple3"].rows + for row in simple3.values(): +- s = "%03d: " % step +- s += get_simple3_table_printable_row(row) +- print(s) ++ print_row("simple3", row, step, ++ get_simple3_table_printable_row(row)) ++ n += 1 ++ ++ if "simple4" in idl.tables: ++ simple4 = idl.tables["simple4"].rows ++ for row in simple4.values(): ++ print_row("simple4", row, step, ++ get_simple4_table_printable_row(row)) ++ n += 1 ++ + if "simple5" in idl.tables: + simple5 = idl.tables["simple5"].rows + for row in simple5.values(): -+ s = "%03d: " % step -+ s += get_simple_printable_row_string(row, ["name", "irefmap"]) -+ print(s) ++ print_row("simple5", row, step, ++ get_simple5_table_printable_row(row)) + n += 1 + ++ if "simple6" in idl.tables: ++ simple6 = idl.tables["simple6"].rows ++ for row in simple6.values(): ++ print_row("simple6", row, step, ++ get_simple6_table_printable_row(row)) + n += 1 + if "link1" in idl.tables: l1 = idl.tables["link1"].rows for row in l1.values(): -@@ -303,6 +316,11 @@ def idltest_find_simple3(idl, i): +- s = ["%03d: i=%s k=" % (step, row.i)] +- if hasattr(row, "k") and row.k: +- s.append(str(row.k.i)) +- if hasattr(row, "ka"): +- s.append(" ka=[") +- s.append(' '.join(sorted(str(ka.i) for ka in row.ka))) +- s.append("] l2=") +- if hasattr(row, "l2") and row.l2: +- s.append(str(row.l2[0].i)) +- if hasattr(row, "uuid"): +- s.append(" uuid=%s" % row.uuid) +- print(''.join(s)) ++ print_row("link1", row, step, ++ get_link1_table_printable_row(row)) + n += 1 + + if "link2" in idl.tables: + l2 = idl.tables["link2"].rows + for row in l2.values(): +- s = ["%03d:" % step] +- s.append(" i=%s l1=" % row.i) +- if hasattr(row, "l1") and row.l1: +- s.append(str(row.l1[0].i)) +- if hasattr(row, "uuid"): +- s.append(" uuid=%s" % row.uuid) +- print(''.join(s)) ++ print_row("link2", row, step, ++ get_link2_table_printable_row(row)) + n += 1 + + if "singleton" in idl.tables: + sng = idl.tables["singleton"].rows + for row in sng.values(): +- s = ["%03d:" % step] +- s.append(" name=%s" % row.name) +- if hasattr(row, "uuid"): +- s.append(" uuid=%s" % row.uuid) +- print(''.join(s)) ++ print_row("singleton", row, step, ++ get_singleton_table_printable_row(row)) + n += 1 + + if not n: +@@ -303,6 +355,11 @@ def idltest_find_simple3(idl, i): return next(idl.index_equal("simple3", "simple3_by_name", i), None) @@ -86954,7 +88761,7 @@ index 1b94b79a07..9d3228f234 100644 def idl_set(idl, commands, step): txn = ovs.db.idl.Transaction(idl) increment = False -@@ -524,6 +542,12 @@ def idl_set(idl, commands, step): +@@ -524,6 +581,12 @@ def idl_set(idl, commands, step): setattr(new_row3, 'name', 'String3') new_row3.addvalue('uset', new_row41.uuid) assert len(getattr(new_row3, 'uset', [])) == 1 @@ -86967,13 +88774,13 @@ index 1b94b79a07..9d3228f234 100644 else: sys.stderr.write("unknown command %s\n" % name) sys.exit(1) -@@ -616,7 +640,8 @@ def do_idl(schema_file, remote, *commands): +@@ -616,7 +679,8 @@ def do_idl(schema_file, remote, *commands): def mock_notify(event, row, updates=None): output = "%03d: " % step output += "event:" + str(event) + ", row={" - output += get_simple_table_printable_row(row) + "}, updates=" -+ output += get_simple_table_printable_row(row, -+ 'l2', 'l1') + "}, updates=" ++ output += get_simple_table_printable_row(row, 'l2', 'l1') + "}, " ++ output += get_simple_printable_row_string(row, ["uuid"]) + ", updates=" if updates is None: output += "None" else: @@ -87044,6 +88851,17 @@ index b7279db6aa..cc80888a7d 100644 putchar('\n'); } +diff --git a/tests/test-stream.c b/tests/test-stream.c +index 4af44200e8..68ce2c5442 100644 +--- a/tests/test-stream.c ++++ b/tests/test-stream.c +@@ -42,5 +42,6 @@ main(int argc, char *argv[]) + VLOG_ERR("stream_open_block(%s) failure: %s", + argv[1], ovs_strerror(error)); + } ++ stream_close(stream); + return (error || !stream) ? 1 : 0; + } diff --git a/tests/tunnel.at b/tests/tunnel.at index ce000a25e6..7a6b7f42c6 100644 --- a/tests/tunnel.at diff --git a/SPECS/openvswitch2.13.spec b/SPECS/openvswitch2.13.spec index 2997a24..6b55949 100644 --- a/SPECS/openvswitch2.13.spec +++ b/SPECS/openvswitch2.13.spec @@ -59,7 +59,7 @@ Summary: Open vSwitch Group: System Environment/Daemons daemon/database/utilities URL: http://www.openvswitch.org/ Version: 2.13.0 -Release: 103%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} +Release: 104%{?commit0:.%{date}git%{shortcommit0}}%{?commit1:dpdk%{shortcommit1}}%{?dist} # Nearly all of openvswitch is ASL 2.0. The bugtool is LGPLv2+, and the # lib/sflow*.[ch] files are SISSL @@ -710,6 +710,10 @@ exit 0 %endif %changelog +* Fri Apr 09 2021 Open vSwitch CI - 2.13.0-104 +- Merging upstream branch-2.13 + [1334a398c9b34857cb1e2939b3aaa56277064d46] + * Tue Apr 06 2021 Timothy Redaelli - 2.13.0-103 - Align DPDK config to 19.11.7 [62cff1abf5fda881c4e5b130df38372701d31ba4]