adoroszlai commented on code in PR #8632:
URL: https://github.com/apache/ozone/pull/8632#discussion_r2151323315


##########
hadoop-ozone/dist/src/main/smoketest/admincli/cert.robot:
##########
@@ -24,11 +24,13 @@ Setup Test
 
 *** Test Cases ***
 List certificates
+    ${SECURITY_ENABLED} =   Get Security Enabled From Config

Review Comment:
   Having to add this to each test case where `${SECURITY_ENABLED}` is used is 
easy to forget and too verbose.
   
   I hope to find a way to do this with some Robot Framework feature (e.g. 
suite setup).  Will share if I find something.
   
   https://robotframework.org/robotframework/6.1.1/RobotFrameworkUserGuide.html



##########
hadoop-ozone/dist/src/main/smoketest/commonlib.robot:
##########
@@ -31,6 +31,16 @@ Get test user principal
     ${instance} =       Execute                    hostname | sed 
's/scm[0-9].org/scm/;s/scm[0-9]/scm/;s/om[0-9]/om/'
     [return]            ${user}/${instance}@EXAMPLE.COM
 
+Get Security Enabled From Config
+    ${conf_dir} =    Get Environment Variable    OZONE_CONF_DIR
+    ${file} =     Set Variable    ${conf_dir}/ozone-site.xml
+    ${value} =    Execute    sed -n 
"/<name>ozone.security.enabled<\\/name>/,/<\\/property>/s|.*<value>\\(.*\\)</value>.*|\\1|p"
 ${file} | head -n1 | xargs

Review Comment:
   Can be simplified:
   
   ```suggestion
       ${value} =    Execute    ozone getconf confKey ozone.security.enabled
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to