Skip to content

Commit 7c7d6c4

Browse files
nate-scribano-ibmpadamstx
authored andcommitted
test(IAM Access Groups): Restored integration tests that were temporarily disabled due to intermittent failure issues
1 parent 4c11e72 commit 7c7d6c4

File tree

1 file changed

+56
-59
lines changed

1 file changed

+56
-59
lines changed

test/integration/test_iam_access_groups_v2.py

Lines changed: 56 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ def test_01_create_access_group(self):
121121

122122
def test_02_get_access_group(self):
123123
assert self.testGroupId
124+
print("Group ID: ", self.testGroupId)
124125

125126
response = self.service.get_access_group(access_group_id=self.testGroupId)
126127
assert response is not None
@@ -141,6 +142,7 @@ def test_02_get_access_group(self):
141142
def test_03_update_access_group(self):
142143
assert self.testGroupId
143144
assert self.testGroupETag
145+
print("Group ID: ", self.testGroupId)
144146

145147
response = self.service.update_access_group(
146148
access_group_id=self.testGroupId, if_match=self.testGroupETag, description=self.testGroupDescription)
@@ -158,6 +160,8 @@ def test_03_update_access_group(self):
158160
assert result.description == self.testGroupDescription
159161

160162
def test_04_list_access_groups(self):
163+
print("Group ID: ", self.testGroupId)
164+
161165
response = self.service.list_access_groups(
162166
account_id=self.testAccountId,hide_public_access=True)
163167
assert response is not None
@@ -179,6 +183,8 @@ def test_04_list_access_groups(self):
179183

180184
def test_05_add_members_to_access_group(self):
181185
assert self.testGroupId
186+
print("Group ID: ", self.testGroupId)
187+
print("User ID: ", self.testUserId)
182188

183189
members = [AddGroupMembersRequestMembersItem(
184190
iam_id=self.testUserId, type=self.testUserType)]
@@ -204,6 +210,8 @@ def test_05_add_members_to_access_group(self):
204210

205211
def test_06_add_member_to_multiple_access_groups(self):
206212
assert self.testGroupId
213+
print("Group ID: ", self.testGroupId)
214+
print("User ID: ", self.testUserId)
207215

208216
members = [AddGroupMembersRequestMembersItem(
209217
iam_id=self.testUserId, type=self.testUserType)]
@@ -228,81 +236,59 @@ def test_06_add_member_to_multiple_access_groups(self):
228236
assert foundTestGroup
229237

230238
def test_07_check_group_membership(self):
231-
# This test is temporarily disabled/changed
232-
# (because it fails intermittently in parallel)
233-
234-
# assert self.testGroupId
235-
236-
# response = self.service.is_member_of_access_group(
237-
# access_group_id=self.testGroupId, iam_id=self.testUserId)
238-
# assert response is not None
239-
# assert response.get_status_code() == 204
239+
assert self.testGroupId
240+
print("Group ID: ", self.testGroupId)
241+
print("User ID: ", self.testUserId)
240242

241-
# result_dict = response.get_result()
242-
# assert result_dict is None
243+
response = self.service.is_member_of_access_group(
244+
access_group_id=self.testGroupId, iam_id=self.testUserId)
245+
assert response is not None
246+
assert response.get_status_code() == 204
243247

244-
try:
245-
response = self.service.is_member_of_access_group(
246-
access_group_id=self.testGroupId, iam_id=self.testUserId)
247-
except ApiException as e:
248-
print(e)
248+
result_dict = response.get_result()
249+
assert result_dict is None
249250

250251
def test_08_list_group_members(self):
251-
# This test is temporarily disabled/changed
252-
# (because it fails intermittently in parallel)
253-
254-
# assert self.testGroupId
255-
256-
# response = self.service.list_access_group_members(
257-
# access_group_id=self.testGroupId)
258-
# assert response is not None
259-
# assert response.get_status_code() == 200
252+
assert self.testGroupId
253+
print("Group ID: ", self.testGroupId)
254+
print("User ID: ", self.testUserId)
260255

261-
# result_dict = response.get_result()
262-
# assert result_dict is not None
256+
response = self.service.list_access_group_members(
257+
access_group_id=self.testGroupId)
258+
assert response is not None
259+
assert response.get_status_code() == 200
263260

264-
# result = GroupMembersList.from_dict(result_dict)
265-
# assert result is not None
261+
result_dict = response.get_result()
262+
assert result_dict is not None
266263

267-
# # Confirm the test user is present
268-
# foundTestUser = False
269-
# for member in result.members:
270-
# if member.iam_id == self.testUserId:
271-
# foundTestUser = True
272-
# break
273-
# assert foundTestUser
264+
result = GroupMembersList.from_dict(result_dict)
265+
assert result is not None
274266

275-
try:
276-
response = self.service.list_access_group_members(
277-
access_group_id=self.testGroupId)
278-
except ApiException as e:
279-
print(e)
267+
# Confirm the test user is present
268+
foundTestUser = False
269+
for member in result.members:
270+
if member.iam_id == self.testUserId:
271+
foundTestUser = True
272+
break
273+
assert foundTestUser
280274

281275
def test_09_delete_group_membership(self):
282-
# This test is temporarily disabled/changed
283-
# (because it fails intermittently in parallel)
284-
285-
# assert self.testGroupId
286-
287-
# response = self.service.remove_member_from_access_group(
288-
# access_group_id=self.testGroupId, iam_id=self.testUserId)
289-
# assert response is not None
290-
# assert response.get_status_code() == 204
291-
292-
# result_dict = response.get_result()
293-
# assert result_dict is None
294-
276+
assert self.testGroupId
295277
print("Group ID: ", self.testGroupId)
296278
print("User ID: ", self.testUserId)
297279

298-
try:
299-
response = self.service.remove_member_from_access_group(
300-
access_group_id=self.testGroupId, iam_id=self.testUserId)
301-
except ApiException as e:
302-
print(e)
280+
response = self.service.remove_member_from_access_group(
281+
access_group_id=self.testGroupId, iam_id=self.testUserId)
282+
assert response is not None
283+
assert response.get_status_code() == 204
284+
285+
result_dict = response.get_result()
286+
assert result_dict is None
303287

304288
def test_10_delete_member_from_all_groups(self):
305289
assert self.testGroupId
290+
print("Group ID: ", self.testGroupId)
291+
print("User ID: ", self.testUserId)
306292

307293
try:
308294
response = self.service.remove_member_from_all_access_groups(
@@ -314,6 +300,8 @@ def test_10_delete_member_from_all_groups(self):
314300

315301
def test_11_delete_bulk_members_from_access_group(self):
316302
assert self.testGroupId
303+
print("Group ID: ", self.testGroupId)
304+
print("User ID: ", self.testUserId)
317305

318306
try:
319307
response = self.service.remove_members_from_access_group(
@@ -325,6 +313,7 @@ def test_11_delete_bulk_members_from_access_group(self):
325313

326314
def test_12_create_access_group_rule(self):
327315
assert self.testGroupId
316+
print("Group ID: ", self.testGroupId)
328317

329318
testExpiration = 24
330319

@@ -351,6 +340,8 @@ def test_12_create_access_group_rule(self):
351340
def test_13_get_access_group_rule(self):
352341
assert self.testGroupId
353342
assert self.testClaimRuleId
343+
print("Group ID: ", self.testGroupId)
344+
print("Rule ID: ", self.testClaimRuleId)
354345

355346
response = self.service.get_access_group_rule(
356347
access_group_id=self.testGroupId, rule_id=self.testClaimRuleId)
@@ -370,6 +361,8 @@ def test_13_get_access_group_rule(self):
370361

371362
def test_14_list_access_group_rules(self):
372363
assert self.testGroupId
364+
print("Group ID: ", self.testGroupId)
365+
print("Rule ID: ", self.testClaimRuleId)
373366

374367
response = self.service.list_access_group_rules(access_group_id=self.testGroupId)
375368
assert response is not None
@@ -392,6 +385,8 @@ def test_14_list_access_group_rules(self):
392385
def test_15_update_access_group_rule(self):
393386
assert self.testGroupId
394387
assert self.testClaimRuleId
388+
print("Group ID: ", self.testGroupId)
389+
print("Rule ID: ", self.testClaimRuleId)
395390

396391
testExpiration = 24
397392

@@ -418,6 +413,8 @@ def test_15_update_access_group_rule(self):
418413
def test_16_delete_access_group_rule(self):
419414
assert self.testGroupId
420415
assert self.testClaimRuleId
416+
print("Group ID: ", self.testGroupId)
417+
print("Rule ID: ", self.testClaimRuleId)
421418

422419
response = self.service.remove_access_group_rule(
423420
access_group_id=self.testGroupId, rule_id=self.testClaimRuleId)

0 commit comments

Comments
 (0)