Skip to content

Commit e7faab2

Browse files
committed
test: add Principal removal test
1 parent 0464d2b commit e7faab2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

test/e2e/tests/test_vpc_endpoint_service_configuration.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,21 @@ def test_vpc_endpoint_service_configuration_create_delete(self, ec2_client, simp
111111
allowed_principals = ec2_validator.get_vpc_endpoint_service_permissions(resource_id)
112112
assert allowed_principals[0]["Principal"] == "arn:aws:iam::111111111111:root"
113113

114+
# Payload used to remove the Principal
115+
update_allowed_principals_payload = {
116+
"spec": {
117+
"allowedPrincipals": []
118+
}
119+
}
120+
121+
# Patch the VPCPeeringConnection with the payload
122+
k8s.patch_custom_resource(ref, update_allowed_principals_payload)
123+
time.sleep(MODIFY_WAIT_AFTER_SECONDS)
124+
125+
# Check that the allowedPrincipal is properly set
126+
allowed_principals = ec2_validator.get_vpc_endpoint_service_permissions(resource_id)
127+
assert len(allowed_principals) == 0
128+
114129
# Delete k8s resource
115130
_, deleted = k8s.delete_custom_resource(ref)
116131
assert deleted is True

0 commit comments

Comments
 (0)