fapifta commented on a change in pull request #2609: URL: https://github.com/apache/ozone/pull/2609#discussion_r703691962
########## File path: hadoop-ozone/dist/src/main/smoketest/httpfs/operations_tests.robot ########## @@ -0,0 +1,103 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +*** Settings *** +Documentation HttpFS gateway test with curl commands +Library Process +Library String +Library BuiltIn +Resource operations.robot + +*** Variables *** +${URL} http://httpfs:14000/webhdfs/v1/ +${USERNAME} hdfs + +*** Test Cases *** +Create volume + ${volume} = Execute curl command vol1 MKDIRS -X PUT + Should contain ${volume} true + +Create first bucket + ${bucket} = Execute curl command vol1/buck1 MKDIRS -X PUT + Should contain ${bucket} true + +Create second bucket + ${bucket} = Execute curl command vol1/buck2 MKDIRS -X PUT + Should contain ${bucket} true + +Create local testfile + Create file testfile + +Create testfile + ${file} = Execute create file command vol1/buck1/testfile testfile + Should contain ${file} http://httpfs:14000/webhdfs/v1/vol1/buck1/testfile + +Read file + ${file} = Execute curl command vol1/buck1/testfile OPEN -L + Should contain ${file} Hello world! + +Delete bucket + ${bucket} = Execute curl command vol1/buck2 DELETE -X DELETE + Should contain ${bucket} true + +Get status of bucket + ${status} = Execute curl command vol1/buck1 GETFILESTATUS ${EMPTY} + Should contain ${status} FileStatus DIRECTORY + +Get status of file + ${status} = Execute curl command vol1/buck1/testfile GETFILESTATUS ${EMPTY} + Should contain ${status} FileStatus FILE 13 + +List bucket + ${list} = Execute curl command vol1/buck1 LISTSTATUS ${EMPTY} + Should contain ${list} FileStatus testfile FILE 13 + +List file + ${list} = Execute curl command vol1/buck1/testfile LISTSTATUS ${EMPTY} + Should contain ${list} FileStatus FILE 13 + +List directory iteratively + ${list} = Execute curl command vol1 LISTSTATUS_BATCH&startAfter=buck1 ${EMPTY} + Should contain ${list} DirectoryListing buck1 + Should not contain ${list} buck2 + +Get content summary of directory + ${summary} = Execute curl command vol1 GETCONTENTSUMMARY ${EMPTY} + Should contain ${summary} ContentSummary "directoryCount":2 "fileCount":1 + +Get quota usage of directory + ${usage} = Execute curl command vol1 GETQUOTAUSAGE ${EMPTY} + Should contain ${usage} QuotaUsage "fileAndDirectoryCount":3 + +Get home directory + ${home} = Execute curl command ${EMPTY} GETHOMEDIRECTORY ${EMPTY} + Should contain ${home} "Path":"\\/user\\/hdfs" + +Get trash root + ${trash} = Execute curl command vol1/buck1/testfile GETTRASHROOT ${EMPTY} + Should contain ${trash} "Path":"\\/vol1\\/buck1\\/.Trash\\/hdfs" + +Set permission of bucket + Execute curl command vol1/buck1 SETPERMISSION&permission=7 -X PUT + +Set replication factor of bucket + ${cmd} = Execute curl command vol1/buck1 SETREPLICATION&replication=2 -X PUT Review comment: replication factor of 2 is unknown for Ozone, so we might expect a false here. If the code as it is returns true, which I would guess means a success, then that is wrong so at least we should note this here as a TODO comment to fix it later on. Also we should be careful about what to expect here and check how the CLI handles this, then expect the changes to be the same, and document any incorrect/unimplemented behaviour with the expectation formulated as a subsequent test to check the result of this call. -- 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]
