This is an automated email from the ASF dual-hosted git repository.

adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new 7062e174cf HDDS-11192. Increase SPNEGO URL test coverage (#6956)
7062e174cf is described below

commit 7062e174cff4f05f5ed18a70a6bcab398bce3d8d
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Jul 17 17:17:08 2024 +0200

    HDDS-11192. Increase SPNEGO URL test coverage (#6956)
---
 .../dist/src/main/smoketest/spnego/web.robot       | 83 +++++++++++-----------
 1 file changed, 40 insertions(+), 43 deletions(-)

diff --git a/hadoop-ozone/dist/src/main/smoketest/spnego/web.robot 
b/hadoop-ozone/dist/src/main/smoketest/spnego/web.robot
index 17e3447115..654f8aef67 100644
--- a/hadoop-ozone/dist/src/main/smoketest/spnego/web.robot
+++ b/hadoop-ozone/dist/src/main/smoketest/spnego/web.robot
@@ -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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to