whbing commented on code in PR #7016:
URL: https://github.com/apache/ozone/pull/7016#discussion_r1766372575
##########
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:
1. `om host` is a user-defined string and does not necessarily start with
`om`, right ?
2. NIT: string don't look aligned.
3. 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:
`om-roles-test.robot` :
```shell
*** Settings ***
Documentation Smoke test for listing om roles.
Library OperatingSystem
Test Timeout 5 minutes
*** Keywords ***
Assert Leader Present in TABLE
[Arguments] ${output}
Should Match Regexp ${output}
\|\s+om\d+\s+\|\s+LEADER\s+\|
*** Test Cases ***
List om roles as TABLE without OM service ID passed
${result}= Set Variable | host32 | om32 | OTHER
Should Be Equal ${result} | host32 | om32 | OTHER
Assert Leader Present in TABLE ${result}
```
run: `robot om-roles-test.robot`
```
==============================================================================
Om-Roles-Test :: Smoke test for listing om roles.
==============================================================================
List om roles as TABLE without OM service ID passed | PASS
|
------------------------------------------------------------------------------
Om-Roles-Test :: Smoke test for listing om roles. | PASS
|
1 test, 1 passed, 0 failed
==============================================================================
```
##########
hadoop-ozone/dist/src/main/smoketest/admincli/scmrole.robot:
##########
@@ -30,4 +30,8 @@ Run scm roles
List scm roles as JSON
${output} = Execute ozone admin scm roles --json
${leader} = Execute echo '${output}' | jq -r '.[] |
select(.raftPeerRole == "LEADER")'
- Should Not Be Equal ${leader} ${EMPTY}
\ No newline at end of file
+ Should Not Be Equal ${leader} ${EMPTY}
+
+List scm roles as TABLE
+ ${output} = Execute ozone admin scm roles --table
+ Should contain ${output} LEADER
Review Comment:
Maybe we could add `|` to show that it is a table, like `Should contain
${output} | LEADER |`
--
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]