S3 tests are available in s3tests branch in git.cloud.com (This needs to be fixed, it should be on the apache repo)

Procedure to execute the tests:

  1. Deploy the cloudstack (3.0.3) or above code.
  2. Enable S3 ( in CS UI -> Global Settings, search for ‘enable.s3.api’ change the flag to 'true' and restart the management server)
  3. Register a user to access the S3 API.
      ./cloudstack-aws-api-register -u http://<s3hostip>:7080/awsapi/rest/AmazonS3 -a admin -s admin openssl_generated.mycert.pem
    
    NOTE: Please create user name and password as admin/admin. I had hardcoded them in the test files for the time being.
  4. Checkout s3tests and go to 's3tests\tests' folder
    Configure the boto S3Connection object as follows:
     calling_format= OrdinaryCallingFormat()
     connection = S3Connection(aws_access_key_id=<your api key>,
     aws_secret_access_key=<your secret key>
     is_secure=False,
     host='<cloudstack-server>',
     port=7080, //S3 service port
     calling_format=calling_format,
     path="/awsapi/rest/AmazonS3") //prefix path.
     
  5. Execute the S3 tests using the command.
       ./test.py -t s3 -v 0
     

replace last argument 0 with 0 or 1 or 2 for different level of verbosity

The functionality is tested by these tests are:

  • S3ConnectionTest
  • S3BucketTest
  • S3KeyTest
  • S3MultiPartUploadTest
  • S3VersionTest
  • ‘S3EncryptionTest’
  • S3MultiDeleteTest

currently I had disabled testing the functionality of

  • S3EncryptionTest

These are the current test results :

----------------------------------------------------------------------

Ran 27 tests in 17.080s

 

FAILED (failures=11, errors=3)
  • No labels