diff options
-rw-r--r-- | ovsdb/ovsdb.c | 3 | ||||
-rw-r--r-- | tests/ovsdb-server.at | 18 |
2 files changed, 21 insertions, 0 deletions
diff --git a/ovsdb/ovsdb.c b/ovsdb/ovsdb.c index 11786f376..afec96264 100644 --- a/ovsdb/ovsdb.c +++ b/ovsdb/ovsdb.c @@ -715,5 +715,8 @@ ovsdb_replace(struct ovsdb *dst, struct ovsdb *src) dst->rbac_role = ovsdb_get_table(dst, "RBAC_Role"); + /* Get statistics from the new database. */ + dst->n_atoms = src->n_atoms; + ovsdb_destroy(src); } diff --git a/tests/ovsdb-server.at b/tests/ovsdb-server.at index 0828e6d04..bf539b6e5 100644 --- a/tests/ovsdb-server.at +++ b/tests/ovsdb-server.at @@ -1308,6 +1308,24 @@ dnl After removing all the bridges, the number of atoms in the database dnl should return to its initial value. AT_CHECK([test $(get_memory_value atoms) -eq $initial_db_atoms]) +dnl Add a few more resources. +for i in $(seq 1 10); do + cmd=$(add_ports $i $(($i / 4 + 1))) + AT_CHECK([ovs-vsctl --no-wait add-br br$i $cmd]) +done +check_atoms + +db_atoms_before_conversion=$(get_memory_value atoms) + +dnl Trigger online conversion. +AT_CHECK([ovsdb-client convert $abs_top_srcdir/vswitchd/vswitch.ovsschema], + [0], [ignore], [ignore]) + +dnl Check that conversion didn't change the number of atoms and the history +dnl still has a reasonable size. +check_atoms +AT_CHECK([test $(get_memory_value atoms) -eq $db_atoms_before_conversion]) + OVS_APP_EXIT_AND_WAIT([ovsdb-server]) AT_CLEANUP |