Skip to content

Commit dd26d4d

Browse files
Ashutosh KGirish Shilamkar
authored andcommitted
CLOUDSTACK-6780: Resolved cleanup issue in portable ip test cases
1 parent 23280a4 commit dd26d4d

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

test/integration/component/test_portable_ip.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,21 +1103,27 @@ def test_disassociate_ip_address_other_account(self):
11031103
self.fail("Failed to create portable ip: %s" % e)
11041104

11051105
try:
1106-
self.user_account = Account.create(
1106+
self.otherAccount = Account.create(
11071107
self.apiclient,
11081108
self.services["account"],
11091109
domainid=self.domain.id
11101110
)
1111+
self.cleanup.append(self.otherAccount)
11111112

1112-
self.api_client_user = self.testClient.getUserApiClient(
1113-
UserName=self.user_account.name,
1114-
DomainName=self.user_account.domain
1113+
self.apiclientOtherAccount = self.testClient.getUserApiClient(
1114+
UserName=self.otherAccount.name,
1115+
DomainName=self.otherAccount.domain
11151116
)
11161117

1118+
# Trying to disassociate portable ip using
1119+
# api client of other account than the one
1120+
# used to create portable ip
11171121
with self.assertRaises(Exception):
1118-
portableip.delete(self.api_client_user)
1119-
except Exception as e:
1122+
portableip.delete(self.apiclientOtherAccount)
1123+
1124+
# Disassociate IP using api client of account used to create it
11201125
portableip.delete(self.apiclient)
1126+
except Exception as e:
11211127
self.fail("Exception while disassociating portable ip: %s" % e)
11221128
return
11231129

0 commit comments

Comments
 (0)