mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Added additional verification steps to make sure that removing secondary ip from nic works fine
This commit is contained in:
parent
52b630fcbd
commit
2de64bcc91
@ -361,8 +361,9 @@ class TestBasicOperations(cloudstackTestCase):
|
|||||||
(virtual_machine.id, e))
|
(virtual_machine.id, e))
|
||||||
return
|
return
|
||||||
|
|
||||||
@data(ISOLATED_NETWORK, SHARED_NETWORK, VPC_NETWORK)
|
#@data(ISOLATED_NETWORK, SHARED_NETWORK, VPC_NETWORK)
|
||||||
@attr(tags=["advanced"])
|
@data(SHARED_NETWORK)
|
||||||
|
@attr(tags=["advanced", "sanj"])
|
||||||
def test_remove_ip_from_nic(self, value):
|
def test_remove_ip_from_nic(self, value):
|
||||||
""" Remove secondary IP from NIC of a VM"""
|
""" Remove secondary IP from NIC of a VM"""
|
||||||
|
|
||||||
@ -402,6 +403,27 @@ class TestBasicOperations(cloudstackTestCase):
|
|||||||
id=virtual_machine.nic[0].id)
|
id=virtual_machine.nic[0].id)
|
||||||
|
|
||||||
NIC.removeIp(self.apiclient, ipaddressid=ipaddress_1.id)
|
NIC.removeIp(self.apiclient, ipaddressid=ipaddress_1.id)
|
||||||
|
#Following block is to verify
|
||||||
|
#1.Removing nic in shared network should mark allocated state to NULL in DB
|
||||||
|
#2.To make sure that re-add the same ip address to the same nic
|
||||||
|
#3.Remove the IP from the NIC
|
||||||
|
#All the above steps should succeed
|
||||||
|
if value == SHARED_NETWORK:
|
||||||
|
qresultset = self.dbclient.execute(
|
||||||
|
"select allocated from user_ip_address where public_ip_address = '%s';"
|
||||||
|
% str(ipaddress_1.ipaddress)
|
||||||
|
)
|
||||||
|
self.assertEqual(
|
||||||
|
qresultset[0][0],
|
||||||
|
None,
|
||||||
|
"Removing IP from nic didn't release the ip address from user_ip_address table"
|
||||||
|
)
|
||||||
|
ipaddress_2 = NIC.addIp(
|
||||||
|
self.apiclient,
|
||||||
|
id=virtual_machine.nic[0].id,
|
||||||
|
ipaddress=ipaddress_1.ipaddress
|
||||||
|
)
|
||||||
|
NIC.removeIp(self.apiclient, ipaddressid=ipaddress_2.id)
|
||||||
try:
|
try:
|
||||||
NIC.removeIp(
|
NIC.removeIp(
|
||||||
self.apiclient,
|
self.apiclient,
|
||||||
@ -908,7 +930,7 @@ class TestNetworkRules(cloudstackTestCase):
|
|||||||
return
|
return
|
||||||
|
|
||||||
@data(ISOLATED_NETWORK, SHARED_NETWORK, VPC_NETWORK)
|
@data(ISOLATED_NETWORK, SHARED_NETWORK, VPC_NETWORK)
|
||||||
@attr(tags=["advanced, "dvs"])
|
@attr(tags=["advanced", "dvs"])
|
||||||
def test_disassociate_ip_mapped_to_secondary_ip_through_PF_rule(
|
def test_disassociate_ip_mapped_to_secondary_ip_through_PF_rule(
|
||||||
self,
|
self,
|
||||||
value):
|
value):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user