Skip to content

Commit 2d234ab

Browse files
authored
Merge pull request #96 from DMTF/Empty-UserName-Crash
Fixed crash condition where a service returns null for the UserName property of an account
2 parents 000018f + 288dbcd commit 2d234ab

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

redfish_protocol_validator/security_details.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,13 @@ def test_priv_roles_assigned_at_account_create(sut: SystemUnderTest):
965965
if response.ok:
966966
data = utils.get_response_json(response)
967967
username = data.get('UserName', '')
968-
if username.startswith('rfpv'):
968+
if username is None:
969+
msg = ('Account at URI %s contains a null value for UserName'
970+
% uri)
971+
sut.log(Result.FAIL, 'GET', response.status_code, uri,
972+
Assertion.SEC_PRIV_ROLE_ASSIGNED_AT_ACCOUNT_CREATE,
973+
msg)
974+
elif username.startswith('rfpv'):
969975
role = data.get('RoleId')
970976
if role is not None:
971977
sut.log(Result.PASS, 'GET', response.status_code, uri,

0 commit comments

Comments
 (0)