Skip to content

Commit 67a8a16

Browse files
Adding support of HTTPBasicAuth Property in AccountService Schema AccountService.v1_15_0. Signed-off-by: Sachin Gupta <[email protected]>
1 parent 9577137 commit 67a8a16

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

redfish_protocol_validator/service_responses.py

+24
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,33 @@ def test_odata_version_header(sut: SystemUnderTest):
294294
test_header_value(sut, header, '4.0', uri, method, response,
295295
Assertion.RESP_HEADERS_ODATA_VERSION)
296296

297+
def test_www_authenticate_requirement(sut: SystemUnderTest):
298+
"""Check for HTTPBasicAuth Property"""
299+
response = sut.get_response('GET', sut.account_service_uri)
300+
301+
if (response is not None and response.ok):
302+
data = response.json()
303+
key = 'HTTPBasicAuth'
304+
if key in data:
305+
if data[key] != "Enabled":
306+
# could be either Disabled or Unadvertised
307+
return False
308+
else:
309+
return True
310+
# Any Failure will be considered as HTTPBasicAuth not present
311+
return True
312+
297313

298314
def test_www_authenticate_header(sut: SystemUnderTest):
299315
"""Perform tests for Assertion.RESP_HEADERS_WWW_AUTHENTICATE."""
316+
317+
if(False == test_www_authenticate_requirement(sut)):
318+
msg = ('The WWW-Authenticate header is not tested because value of HTTPBasicAuth '
319+
'is either Disabled or Unadvertised ')
320+
sut.log(Result.NOT_TESTED, '', '', '',
321+
Assertion.RESP_HEADERS_WWW_AUTHENTICATE, msg)
322+
return
323+
300324
# a selection of URis to test
301325
uris = [sut.sessions_uri, sut.mgr_net_proto_uri, sut.systems_uri,
302326
sut.accounts_uri, sut.account_service_uri,

0 commit comments

Comments
 (0)