summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGuoshuai Li <ligs@dtdream.com>2018-01-24 20:39:08 +0800
committerBen Pfaff <blp@ovn.org>2018-01-24 12:28:14 -0800
commitad35c0c58ed8108b6bf1e2caf96d0d0142f47d69 (patch)
tree4fa89d772e56e437c3d73201c6d6b810c3c6c02b /tests
parentf789661794f418c844cb21bef86a9251b2491fc5 (diff)
downloadopenvswitch-ad35c0c58ed8108b6bf1e2caf96d0d0142f47d69.tar.gz
ovn-controller: Add extend_table instead of group_table to expand meter.
The structure and function of the group table and meter table are similar, refactoring code is used to extend for add the meter table. The following function as lib: table init/destroy/clear/lookup/remove, assign id for contents, Move the contents of desired to existing. Signed-off-by: Guoshuai Li <ligs@dtdream.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/test-ovn.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/tests/test-ovn.c b/tests/test-ovn.c
index f9a5085f7..4f65ee9d1 100644
--- a/tests/test-ovn.c
+++ b/tests/test-ovn.c
@@ -33,6 +33,7 @@
#include "ovn/lex.h"
#include "ovn/lib/logical-fields.h"
#include "ovn/lib/ovn-l7.h"
+#include "ovn/lib/extend-table.h"
#include "ovs-thread.h"
#include "ovstest.h"
#include "openvswitch/shash.h"
@@ -1207,11 +1208,8 @@ test_parse_actions(struct ovs_cmdl_context *ctx OVS_UNUSED)
create_gen_opts(&dhcp_opts, &dhcpv6_opts, &nd_ra_opts);
/* Initialize group ids. */
- struct group_table group_table;
- group_table.group_ids = bitmap_allocate(MAX_OVN_GROUPS);
- bitmap_set1(group_table.group_ids, 0); /* Group id 0 is invalid. */
- hmap_init(&group_table.desired_groups);
- hmap_init(&group_table.existing_groups);
+ struct ovn_extend_table group_table;
+ ovn_extend_table_init(&group_table);
simap_init(&ports);
simap_put(&ports, "eth0", 5);