Skip to content

Commit

Permalink
Correct the metadata string of fip-pool to vn
Browse files Browse the repository at this point in the history
The metadata mentioned in xsd for the link between floating-ip-pool to
VN is "virtual-network-floating-ip-pool" and Agent is adding a rule
in dependency manager for VMI as "floating-ip-pool-virtual-network".
This is resulting in no InterestedEvent in dependency tracker if the
link added between VN-FIP is the last link in that VMI.

As a fix, metadata is corrected in Agent.

Change-Id: I484099d8c843493cfcdb618a3165819f9eab5d08
closes-bug: #1544788
  • Loading branch information
divakardhar committed Feb 17, 2016
1 parent c3698cc commit 528906c
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/vnsw/agent/oper/ifmap_dependency_manager.cc
Expand Up @@ -654,7 +654,7 @@ void IFMapDependencyManager::InitializeDependencyRules(Agent *agent) {
"floating-ip", true,
"floating-ip-pool-floating-ip",
"floating-ip-pool", false,
"floating-ip-pool-virtual-network",
"virtual-network-floating-ip-pool",
"virtual-network", true));
AddDependencyPath("virtual-machine-interface",
MakePath("instance-ip-virtual-machine-interface",
Expand Down
49 changes: 39 additions & 10 deletions src/vnsw/agent/pkt/test/test_pkt_fip.cc
Expand Up @@ -253,32 +253,61 @@ static void Setup() {
ret = false;
}

// Configure Floating-IP
AddFloatingIpPool("fip-pool1", 1);
// Configure Floating-IP-1
AddInstanceIp("instance_fixed_ip", 8, "1.1.1.10");
client->WaitForIdle();

AddLink("virtual-machine-interface", "vnet1", "instance-ip",
"instance_fixed_ip");
client->WaitForIdle();

AddLink("virtual-machine-interface", "vnet1", "floating-ip", "fip1");
client->WaitForIdle();

AddFloatingIp("fip1", 1, "2.1.1.100");
client->WaitForIdle();

AddFloatingIpPool("fip-pool1", 1);
client->WaitForIdle();

AddLink("floating-ip", "fip1", "floating-ip-pool", "fip-pool1");
AddFloatingIp("fip_2", 2, "2.1.1.99");
AddLink("floating-ip", "fip_2", "floating-ip-pool", "fip-pool1");
client->WaitForIdle();

AddLink("floating-ip-pool", "fip-pool1", "virtual-network",
"default-project:vn2");
AddLink("virtual-machine-interface", "vnet1", "floating-ip", "fip1");
client->WaitForIdle();

// Configure Floating-IP-2
AddLink("virtual-machine-interface", "vnet1", "floating-ip",
"fip_fixed_ip");
client->WaitForIdle();

AddFloatingIp("fip_2", 2, "2.1.1.99");
client->WaitForIdle();

AddFloatingIpPool("fip-pool2", 2);
client->WaitForIdle();

AddLink("floating-ip", "fip_2", "floating-ip-pool", "fip-pool1");
client->WaitForIdle();

AddFloatingIp("fip_3", 3, "3.1.1.100");
client->WaitForIdle();

AddLink("floating-ip", "fip_3", "floating-ip-pool", "fip-pool2");
client->WaitForIdle();

AddLink("floating-ip-pool", "fip-pool2", "virtual-network",
"default-project:vn3");
client->WaitForIdle();


AddInstanceIp("instance_fixed_ip", 8, "1.1.1.10");
AddLink("virtual-machine-interface", "vnet1", "instance-ip",
"instance_fixed_ip");
client->WaitForIdle();
AddFloatingIp("fip_fixed_ip", 4, "2.1.1.101", "1.1.1.10");
AddLink("floating-ip", "fip_fixed_ip", "floating-ip-pool", "fip-pool1");
AddLink("floating-ip-pool", "fip-pool1", "virtual-network",
"default-project:vn2");
AddLink("virtual-machine-interface", "vnet1", "floating-ip",
"fip_fixed_ip");
client->WaitForIdle();

EXPECT_TRUE(vnet[1]->HasFloatingIp(Address::INET));
if (vnet[1]->HasFloatingIp(Address::INET) == false) {
Expand Down

0 comments on commit 528906c

Please sign in to comment.