-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-12553. ozone admin container list should output real JSON array #8050
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ec02348
HDDS-12553. Support ozone admin container list to print list in Json …
kerneltime f189a0a
HDDS-12553. Use SequenceWriter for JSON array output in container list
kerneltime 74b2e6b
HDDS-12555. Change container list default output format to JSON array
kerneltime bbbe43c
HDDS-12555. Change container list default output format to JSON array
kerneltime f93eb1e
Deal with sequence writer closing System.out and not printing the fin…
kerneltime e34b38e
Address checkstyle and errors
kerneltime c7d086b
Fix container count robot test
kerneltime 905852a
Fix the issues caused by std error output for successful CLI runs and…
kerneltime File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,22 +44,32 @@ Create container | |
| List containers | ||
| ${output} = Execute ozone admin container list | ||
| Should contain ${output} OPEN | ||
| Should Start With ${output} [ | ||
| Should End With ${output} ] | ||
|
|
||
| List containers with explicit host | ||
| ${output} = Execute ozone admin container list --scm ${SCM} | ||
| Should contain ${output} OPEN | ||
| Should Start With ${output} [ | ||
| Should End With ${output} ] | ||
|
|
||
| List containers with container state | ||
| ${output} = Execute ozone admin container list --state=CLOSED | ||
| Should Not contain ${output} OPEN | ||
| Should Start With ${output} [ | ||
| Should End With ${output} ] | ||
|
|
||
| List containers with replication factor ONE | ||
| ${output} = Execute ozone admin container list -t RATIS -r ONE | ||
| Should Not contain ${output} THREE | ||
| Should Start With ${output} [ | ||
| Should End With ${output} ] | ||
|
|
||
| List containers with replication factor THREE | ||
| ${output} = Execute ozone admin container list -t RATIS -r THREE | ||
| Should Not contain ${output} ONE | ||
| Should Start With ${output} [ | ||
| Should End With ${output} ] | ||
|
|
||
| Container info | ||
| ${output} = Execute ozone admin container info "${CONTAINER}" | ||
|
|
@@ -87,17 +97,54 @@ Report containers as JSON | |
| List all containers | ||
| ${output} = Execute ozone admin container list --all | ||
| Should contain ${output} OPEN | ||
| Should Start With ${output} [ | ||
| Should End With ${output} ] | ||
|
|
||
| List all containers according to count (batchSize) | ||
| ${output} = Execute ozone admin container list --all --count 10 | ||
| Should contain ${output} OPEN | ||
| Should Start With ${output} [ | ||
| Should End With ${output} ] | ||
|
|
||
| List all containers from a particular container ID | ||
| ${output} = Execute ozone admin container list --all --start 1 | ||
| ${output} = Execute ozone admin container list --all --start 2 | ||
| Should contain ${output} OPEN | ||
| Should Start With ${output} [ | ||
kerneltime marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Should End With ${output} ] | ||
|
|
||
| Check JSON array parsing | ||
| ${output} = Execute ozone admin container list | ||
| Should Start With ${output} [ | ||
| Should Contain ${output} containerID | ||
| Should End With ${output} ] | ||
| ${containerIDs} = Execute echo '${output}' | jq -r '.[].containerID' | ||
| Should Not Be Empty ${containerIDs} | ||
|
|
||
| Check state filtering with JSON array format | ||
| ${output} = Execute ozone admin container list --state=OPEN | ||
| Should Start With ${output} [ | ||
| Should End With ${output} ] | ||
| ${states} = Execute echo '${output}' | jq -r '.[].state' | ||
| Should Contain ${states} OPEN | ||
| Should Not Contain ${states} CLOSED | ||
|
|
||
| Check count limit with JSON array format | ||
| ${output} = Execute ozone admin container create | ||
| Should contain ${output} is created | ||
| ${output} = Execute ozone admin container create | ||
| Should contain ${output} is created | ||
| ${output} = Execute ozone admin container create | ||
| Should contain ${output} is created | ||
| ${output} = Execute ozone admin container create | ||
| Should contain ${output} is created | ||
| ${output} = Execute ozone admin container create | ||
| Should contain ${output} is created | ||
|
Comment on lines
+132
to
+141
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to eliminate this duplication, as well as the duplicated start/end checks, in a follow-up.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes the robot tests need an over haul |
||
| ${output} = Execute And Ignore Error ozone admin container list --count 5 2> /dev/null # This logs to error that the list is incomplete | ||
| ${count} = Execute echo '${output}' | jq -r 'length' | ||
| Should Be True ${count} == 5 | ||
|
|
||
| Close container | ||
| ${container} = Execute ozone admin container list --state OPEN | jq -r 'select(.replicationConfig.replicationFactor == "THREE") | .containerID' | head -1 | ||
| ${container} = Execute ozone admin container list --state OPEN | jq -r '.[] | select(.replicationConfig.replicationFactor == "ONE") | .containerID' | head -1 | ||
| Execute ozone admin container close "${container}" | ||
| ${output} = Execute ozone admin container info "${container}" | ||
| Should contain ${output} CLOS | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Please do not format method signature like this. Whenever visibility / return type / method name / other modifiers are changed, we would have to reindent parameters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change this in a followup.