Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/recon/recon-api.robot
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ ${API_ENDPOINT_URL} ${ENDPOINT_URL}/api/v1
${ADMIN_API_ENDPOINT_URL} ${API_ENDPOINT_URL}/containers
${UNHEALTHY_ENDPOINT_URL} ${API_ENDPOINT_URL}/containers/unhealthy
${NON_ADMIN_API_ENDPOINT_URL} ${API_ENDPOINT_URL}/clusterState
${VOLUME} vol1
${BUCKET} bucket1

*** Keywords ***
Check if Recon picks up container from OM
Expand Down Expand Up @@ -57,6 +59,21 @@ Check http return code
Should contain ${result} 200
END

Check if the listKeys api responds OK
[Arguments] ${volume} ${bucket}
${result} = Curl "${API_ENDPOINT_URL}/keys/listKeys?startPrefix=/${volume}/${bucket}&limit=1000"
Should contain ${result} "OK"
Should contain ${result} "keys"
Should contain ${result} "${volume}"
Should contain ${result} "${bucket}"

Curl
[Arguments] ${url}
${curl_command} = Set Variable curl -LSs ${url}
Run Keyword if '${SECURITY_ENABLED}' == 'true' Set Variable ${curl_command} curl --negotiate -u : -LSs ${url}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set Variable returns the value, does not modify its first argument.

This can be fixed by using Set Variable If:

Suggested change
${curl_command} = Set Variable curl -LSs ${url}
Run Keyword if '${SECURITY_ENABLED}' == 'true' Set Variable ${curl_command} curl --negotiate -u : -LSs ${url}
${curl_command} = Set Variable If '${SECURITY_ENABLED}' == 'true' curl --negotiate -u : -LSs ${url} curl -LSs ${url}

But other test cases use curl --negotiate -u : unconditionally, so maybe we don't need the conditional logic at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added code to kinit and to use curl directly without any conditions. It should hopefully pass now; I checked out a separate branch with the same code and ran CI successfully on my fork (just for testing): https://github.com/siddhantsangwan/ozone/actions/runs/12157989638

${result} = Execute ${curl_command}
[Return] ${result}

*** Test Cases ***
Check if Recon picks up OM data
Execute ozone sh volume create recon
Expand All @@ -67,6 +84,7 @@ Check if Recon picks up OM data
Execute ozone sh bucket create recon/api --layout=LEGACY
Freon OCKG n=10 args=-s 1025 -v recon -b api
Wait Until Keyword Succeeds 90sec 10sec Check if Recon picks up container from OM
Wait Until Keyword Succeeds 90sec 10sec Check if the listKeys api responds OK recon api

Check if Recon picks up DN heartbeats
${result} = Execute curl --negotiate -u : -LSs ${API_ENDPOINT_URL}/datanodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public long getModificationTime() {
}

@JsonProperty("isKey")
public boolean isKey() {
public boolean getIsKey() {
return keyInfoProto.getIsFile();
}

Expand Down
Loading