Skip to content

Commit

Permalink
improve test case
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeloffner committed Sep 4, 2023
1 parent 48e2603 commit 9ae4a3f
Showing 1 changed file with 24 additions and 26 deletions.
50 changes: 24 additions & 26 deletions tests/tickets/LDEV4635.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" {
return listFirst( s3Version, "." ) ;
};

private function copyToBucket( required credentials, required string storelocation, required string renameLocation, boolean invalid=false ){
private function copyToBucket( required credentials, required string storelocation, required string renameLocation="", boolean invalid=false ){
arguments.bucket=getTestBucketUrl(credentials);
try {
var renameBucket = "";
Expand Down Expand Up @@ -66,70 +66,70 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" {
describe( title="Test suite for LDEV-4635 ( checking s3 copy directory operations )", body=function() {

// Blackbaze
it(title="Copying dir to a new s3 bucket, valid region name [us-east-1]", skip=Util::isBackBlazeNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("BackBlaze"), "us-east-1", "" );
it(title="Blackbaze: Copying dir to a new s3 bucket, valid region name [us-east-1]", skip=Util::isBackBlazeNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("BackBlaze"), "us-east-1" );
});

it(title="Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isBackBlazeNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("BackBlaze"), "eu-west-1", "" );
it(title="Blackbaze: Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isBackBlazeNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("BackBlaze"), "eu-west-1" );
});

it(title="Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isBackBlazeNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("BackBlaze"), "eu-west-1", "" ); // fails, can't current copy between regions LDEV-4639
it(title="Blackbaze: Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isBackBlazeNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("BackBlaze"), "eu-west-1" ); // fails, can't current copy between regions LDEV-4639
});

it(title="Copying dir to a new s3 bucket, invalid region name [down-under]", skip=Util::isBackBlazeNotSupported(), body=function( currentSpec ){
it(title="Blackbaze: Copying dir to a new s3 bucket, invalid region name [down-under]", skip=Util::isBackBlazeNotSupported(), body=function( currentSpec ){
copyToBucket(getCredentials("BackBlaze"), "down-under", "", true );
});

// AWS
it(title="Copying dir to a new s3 bucket, valid region name [us-east-1]", skip=Util::isAWSNotSupported(), body=function( currentSpec ) {
it(title="AWS: Copying dir to a new s3 bucket, valid region name [us-east-1]", skip=Util::isAWSNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("AWS"), "us-east-1", "us-east-1" );
});

it(title="Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isAWSNotSupported(), body=function( currentSpec ) {
it(title="AWS: Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isAWSNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("AWS"), "eu-west-1", "eu-west-1" );
});

it(title="Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isAWSNotSupported(), body=function( currentSpec ) {
it(title="AWS: Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isAWSNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("AWS"), "eu-west-1", "eu-central-1" ); // fails, can't current copy between regions LDEV-4639
});

it(title="Copying dir to a new s3 bucket, invalid region name [down-under]", skip=Util::isAWSNotSupported(), body=function( currentSpec ){
it(title="AWS: Copying dir to a new s3 bucket, invalid region name [down-under]", skip=Util::isAWSNotSupported(), body=function( currentSpec ){
copyToBucket(getCredentials("AWS"), "down-under", "", true );
});

// Wasabi
it(title="Copying dir to a new s3 bucket, valid region name [us-east-1]", skip=Util::getWasabiCredentials(), body=function( currentSpec ) {
it(title="Wasabi: Copying dir to a new s3 bucket, valid region name [us-east-1]", skip=Util::getWasabiCredentials(), body=function( currentSpec ) {
copyToBucket(getCredentials("Wasabi"), "us-east-1", "us-east-1" );
});

it(title="Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::getWasabiCredentials(), body=function( currentSpec ) {
it(title="Wasabi: Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::getWasabiCredentials(), body=function( currentSpec ) {
copyToBucket(getCredentials("Wasabi"), "eu-west-1", "eu-west-1" );
});

it(title="Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::getWasabiCredentials(), body=function( currentSpec ) {
it(title="Wasabi: Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::getWasabiCredentials(), body=function( currentSpec ) {
copyToBucket(getCredentials("Wasabi"), "eu-west-1", "eu-central-1" ); // fails, can't current copy between regions LDEV-4639
});

it(title="Copying dir to a new s3 bucket, invalid region name [down-under]", skip=Util::getWasabiCredentials(), body=function( currentSpec ){
it(title="Wasabi: Copying dir to a new s3 bucket, invalid region name [down-under]", skip=Util::getWasabiCredentials(), body=function( currentSpec ){
copyToBucket(getCredentials("Wasabi"), "down-under", "", true );
});

// Google
it(title="Copying dir to a new s3 bucket, valid region name [us-east-1]", skip=Util::isGoogleNotSupported(), body=function( currentSpec ) {
it(title="Google: Copying dir to a new s3 bucket, valid region name [us-east-1]", skip=Util::isGoogleNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("Google"), "us-east-1", "us-east-1" );
});

it(title="Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isGoogleNotSupported(), body=function( currentSpec ) {
it(title="Google: Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isGoogleNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("Google"), "eu-west-1", "eu-west-1" );
});

it(title="Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isGoogleNotSupported(), body=function( currentSpec ) {
it(title="Google: Copying dir to a new s3 bucket, valid region name [eu-west-1]", skip=Util::isGoogleNotSupported(), body=function( currentSpec ) {
copyToBucket(getCredentials("Google"), "eu-west-1", "eu-central-1" ); // fails, can't current copy between regions LDEV-4639
});

it(title="Copying dir to a new s3 bucket, invalid region name [down-under]", skip=Util::isGoogleNotSupported(), body=function( currentSpec ){
it(title="Google: Copying dir to a new s3 bucket, invalid region name [down-under]", skip=Util::isGoogleNotSupported(), body=function( currentSpec ){
copyToBucket(getCredentials("Google"), "down-under", "", true );
});

Expand All @@ -144,12 +144,10 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="s3" {
}

private function getCredentials(required string provider) localmode=true {
if("BackBlaze"==arguments.provider) local.credentials = Util::getBackBlazeCredentials();
else if("AWS"==arguments.provider) local.credentials = Util::getAWSCredentials();
else if("Wasabi"==arguments.provider) local.credentials = Util::getWasabiCredentials();
else if("Google"==arguments.provider) local.credentials = Util::getGoogleCredentials();
local.credentials.provider=arguments.provider;
return local.credentials;
if("BackBlaze"==arguments.provider) return Util::getBackBlazeCredentials();
else if("AWS"==arguments.provider) return Util::getAWSCredentials();
else if("Wasabi"==arguments.provider) return Util::getWasabiCredentials();
else if("Google"==arguments.provider) return Util::getGoogleCredentials();
}

}
Expand Down

0 comments on commit 9ae4a3f

Please sign in to comment.