diff --git a/src/vnsw/agent/oper/test/test_intf.cc b/src/vnsw/agent/oper/test/test_intf.cc index 7fecca2e107..00a3ee3cb5d 100644 --- a/src/vnsw/agent/oper/test/test_intf.cc +++ b/src/vnsw/agent/oper/test/test_intf.cc @@ -3519,6 +3519,40 @@ TEST_F(IntfTest, FatFlowDel) { DelNode("virtual-machine-interface", "vnet1"); client->WaitForIdle(); EXPECT_TRUE(intf->fat_flow_list().list_.size() == 0); + DeleteVmportEnv(input, 1, true); + client->WaitForIdle(); + EXPECT_FALSE(VmPortFind(1)); + client->Reset(); +} + +TEST_F(IntfTest, IntfAddDel) { + struct PortInfo input[] = { + {"vnet1", 1, "1.1.1.1", "00:00:00:00:00:01", 1, 1}, + }; + + CreateVmportEnv(input, 1); + client->WaitForIdle(); + EXPECT_TRUE(VmPortFind(1)); + + InterfaceRef intf = static_cast(VmPortGet(1)); + EXPECT_TRUE(RouteFind("vrf1", "1.1.1.1", 32)); + + DelLink("virtual-network", "vn1", "virtual-machine-interface", + "vnet1"); + client->WaitForIdle(); + + NovaDel(1); + client->WaitForIdle(); + + AddLink("virtual-network", "vn1", "virtual-machine-interface", + "vnet1"); + client->WaitForIdle(); + + NovaIntfAdd(1, "vnet1", "1.1.1.1", "00:00:00:00:00:01"); + AddNode("virtual-machine-interface", "vnet1", 1); + client->WaitForIdle(); + + EXPECT_TRUE(RouteFind("vrf1", "1.1.1.1", 32)); DeleteVmportEnv(input, 1, true); client->WaitForIdle(); diff --git a/src/vnsw/agent/oper/vm_interface.cc b/src/vnsw/agent/oper/vm_interface.cc index 8685f59704c..3f5c73ce4dd 100644 --- a/src/vnsw/agent/oper/vm_interface.cc +++ b/src/vnsw/agent/oper/vm_interface.cc @@ -3344,6 +3344,7 @@ void VmInterface::InstanceIpList::Update(const InstanceIp *lhs, if (lhs->ecmp_ != rhs->ecmp_) { lhs->ecmp_ = rhs->ecmp_; } + lhs->set_del_pending(false); } void VmInterface::InstanceIpList::Remove(InstanceIpSet::iterator &it) { @@ -3562,6 +3563,7 @@ void VmInterface::FloatingIpList::Update(const FloatingIp *lhs, lhs->force_l3_update_ = true; lhs->force_l2_update_ = true; } + lhs->set_del_pending(false); } void VmInterface::FloatingIpList::Remove(FloatingIpSet::iterator &it) { @@ -3670,6 +3672,7 @@ void VmInterface::StaticRouteList::Insert(const StaticRoute *rhs) { void VmInterface::StaticRouteList::Update(const StaticRoute *lhs, const StaticRoute *rhs) { + lhs->set_del_pending(false); } void VmInterface::StaticRouteList::Remove(StaticRouteSet::iterator &it) { @@ -3867,6 +3870,7 @@ void VmInterface::AllowedAddressPairList::Insert(const AllowedAddressPair *rhs) void VmInterface::AllowedAddressPairList::Update(const AllowedAddressPair *lhs, const AllowedAddressPair *rhs) { + lhs->set_del_pending(false); } void VmInterface::AllowedAddressPairList::Remove(AllowedAddressPairSet::iterator &it) { @@ -4051,6 +4055,7 @@ void VmInterface::ServiceVlanList::Insert(const ServiceVlan *rhs) { void VmInterface::ServiceVlanList::Update(const ServiceVlan *lhs, const ServiceVlan *rhs) { + lhs->set_del_pending(false); } void VmInterface::ServiceVlanList::Remove(ServiceVlanSet::iterator &it) { @@ -4226,6 +4231,7 @@ void VmInterface::VrfAssignRuleList::Insert(const VrfAssignRule *rhs) { void VmInterface::VrfAssignRuleList::Update(const VrfAssignRule *lhs, const VrfAssignRule *rhs) { + lhs->set_del_pending(false); } void VmInterface::VrfAssignRuleList::Remove(VrfAssignRuleSet::iterator &it) {