Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-11192. Increase SPNEGO URL test coverage #6956

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 40 additions & 43 deletions hadoop-ozone/dist/src/main/smoketest/spnego/web.robot
Original file line number Diff line number Diff line change
Expand Up @@ -23,54 +23,51 @@ Resource ../commonlib.robot
Test Timeout 5 minutes

*** Variables ***
${OM_URL} http://om:9874
${OM_DB_CHECKPOINT_URL} ${OM_URL}/dbCheckpoint
${OM_SERVICE_LIST_URL} ${OM_URL}/serviceList

${SCM} scm
${SCM_URL} http://${SCM}:9876

${OM_URL} http://om:9874
${RECON_URL} http://recon:9888
${S3G_URL} http://s3g:9878
${SCM_URL} http://${SCM}:9876

${SCM_CONF_URL} http://${SCM}:9876/conf
${SCM_JMX_URL} http://${SCM}:9876/jmx
${SCM_STACKS_URL} http://${SCM}:9876/stacks
@{BASE_URLS} ${OM_URL} ${RECON_URL} ${S3G_URL} ${SCM_URL}
@{COMMON_PATHS} conf jmx logLevel logs/ prom stacks
@{CUSTOM_ENDPOINTS} ${OM_URL}/dbCheckpoint ${OM_URL}/serviceList ${SCM_URL}/dbCheckpoint


*** Keywords ***
Verify SPNEGO enabled URL
[arguments] ${url}
Run Keyword if '${SECURITY_ENABLED}' == 'true' Execute kdestroy
${result} = Execute curl --negotiate -u : -v -s -I ${url}
Should contain ${result} 401 Authentication required

Run Keyword if '${SECURITY_ENABLED}' == 'true' Kinit test user testuser testuser.keytab
${result} = Execute curl --negotiate -u : -v -s -I ${url}
Should contain ${result} 200 OK


Verify SPNEGO URL
[arguments] ${url} ${expected_response}
${result} = Execute curl --negotiate -u : --silent -o /dev/null -w '\%{http_code}' '${url}'
IF '${result}' != '${expected_response}'
# repeat with verbose mode for debug
Execute curl --negotiate -u : -vvv -o /dev/null '${url}'
Should Be Equal '${result}' '${expected_response}'
END

*** Test Cases ***
Test OM portal
Verify SPNEGO enabled URL ${OM_URL}

Test OM DB Checkpoint
Verify SPNEGO enabled URL ${OM_DB_CHECKPOINT_URL}

Test OM Service List
Verify SPNEGO enabled URL ${OM_SERVICE_LIST_URL}

Test SCM portal
Verify SPNEGO enabled URL ${SCM_URL}

Test SCM conf
Verify SPNEGO enabled URL ${SCM_CONF_URL}

Test SCM jmx
Verify SPNEGO enabled URL ${SCM_JMX_URL}

Test SCM stacks
Verify SPNEGO enabled URL ${SCM_STACKS_URL}

Test Recon portal
Verify SPNEGO enabled URL ${RECON_URL}

Verify SPNEGO URLs without auth
[setup] Execute kdestroy
[template] Verify SPNEGO URL

FOR ${BASE_URL} IN @{BASE_URLS}
FOR ${PATH} IN @{COMMON_PATHS}
${BASE_URL}/${PATH} 401
END
END
FOR ${URL} IN @{CUSTOM_ENDPOINTS}
${URL} 401
END

Verify SPNEGO URLs with auth
[setup] Kinit test user testuser testuser.keytab
[template] Verify SPNEGO URL

FOR ${BASE_URL} IN @{BASE_URLS}
FOR ${PATH} IN @{COMMON_PATHS}
${BASE_URL}/${PATH} 200
END
END
FOR ${URL} IN @{CUSTOM_ENDPOINTS}
${URL} 200
END