summaryrefslogtreecommitdiff
path: root/tests/test-ovn.c
diff options
context:
space:
mode:
authorGurucharan Shetty <guru@ovn.org>2016-07-03 05:31:37 -0700
committerGurucharan Shetty <guru@ovn.org>2016-07-03 15:52:51 -0700
commit467085fd7e316bb88cca83932f854e59fb01e9b5 (patch)
treea8b97bbbf33a61948b1de59fa4fc9fd321f5c056 /tests/test-ovn.c
parent52c0fc3921489c13a4bab87e36cd37bbd747e41b (diff)
downloadopenvswitch-467085fd7e316bb88cca83932f854e59fb01e9b5.tar.gz
ovn-controller: Add support for load balancing.
ovn-controller now supports 2 new logical actions. 1. ct_lb; Sends the packet through the conntrack zone to NAT packets. Packets that are part of established connection will automatically get NATed based on the NAT arguments supplied to conntrack when the first packet was committed. 2. ct_lb(192.168.1.2, 192.168.1.3); ct_lb(192.168.1.2:80, 192.168.1.3:80); Creates an OpenFlow group with multiple buckets and equal weights that changes the destination IP address (and port number) of the packet statefully to one of the options provided inside the parenthesis. Signed-off-by: Gurucharan Shetty <guru@ovn.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'tests/test-ovn.c')
-rw-r--r--tests/test-ovn.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test-ovn.c b/tests/test-ovn.c
index 87251ee5f..1291d0419 100644
--- a/tests/test-ovn.c
+++ b/tests/test-ovn.c
@@ -1281,6 +1281,13 @@ test_parse_actions(struct ovs_cmdl_context *ctx OVS_UNUSED)
create_symtab(&symtab);
create_dhcp_opts(&dhcp_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);
+
simap_init(&ports);
simap_put(&ports, "eth0", 5);
simap_put(&ports, "eth1", 6);
@@ -1301,6 +1308,7 @@ test_parse_actions(struct ovs_cmdl_context *ctx OVS_UNUSED)
.lookup_port = lookup_port_cb,
.aux = &ports,
.ct_zones = &ct_zones,
+ .group_table = &group_table,
.n_tables = 16,
.first_ptable = 16,