slfan1989 commented on code in PR #7016:
URL: https://github.com/apache/ozone/pull/7016#discussion_r1767948287
##########
hadoop-ozone/dist/src/main/smoketest/omha/om-roles.robot:
##########
@@ -28,6 +28,9 @@ Assert Leader Present in JSON
[Arguments] ${output}
${leader} = Execute echo
'${output}' | jq '.[] | select(.[] | .serverRole == "LEADER")'
Should Not Be Equal ${leader}
${EMPTY}
+Assert Leader Present in TABLE
+ [Arguments] ${output}
+ Should Match Regexp ${output}
\|\s+om\d+\s+\|\s+LEADER\s+\|
Review Comment:
> om host is a user-defined string and does not necessarily start with om,
right ?
This regex matches strings containing "om" followed by digits, specifically
formatted with "LEADER" surrounded by pipe delimiters.

If we replace it with other characters (like "scm"), it should not match.

> NIT: string don't look aligned.
This should be fixed, and I will modify the format issue.
> I verified this RE, and it seems that any format will pass. So, this RE
looks like it needs to be changed.
You can install robot in python and execute it locally:
Sorry, I don't think there's an issue with this regex.
> Test1 regex test
The regex validation indicates that, based on the provided example, it
cannot match the regex.

I tested the regex functionality in VSCode, and everything is working fine.
I'm not sure if Robot has issues recognizing the regular expression, so I
changed it to ensure that it works properly with Robot.
```
==============================================================================
Om-Roles
==============================================================================
List om roles as TABLE without OM service ID passed | FAIL
|
'| host32 | om32 | OTHER' does not match '\|.*LEADER.*'
------------------------------------------------------------------------------
Om-Roles | FAIL
|
1 test, 0 passed, 1 failed
==============================================================================
Output:
/Users/didi/Documents/code-github/ozone/hadoop-ozone/dist/src/main/smoketest/omha/output.xml
Log:
/Users/didi/Documents/code-github/ozone/hadoop-ozone/dist/src/main/smoketest/omha/log.html
Report:
/Users/didi/Documents/code-github/ozone/hadoop-ozone/dist/src/main/smoketest/omha/report.html
```
--
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]