Do not run ACL tests when backend lacks support

pull/124/head
Andrew Gaul 2016-01-30 18:45:45 -08:00
rodzic cea4a42922
commit 65fd80036f
3 zmienionych plików z 67 dodań i 1 usunięć

Wyświetl plik

@ -25,6 +25,7 @@ import com.google.common.util.concurrent.Uninterruptibles;
import org.jclouds.Constants;
import org.jclouds.blobstore.BlobStoreContext;
import org.jclouds.s3.blobstore.integration.S3BlobIntegrationLiveTest;
import org.testng.SkipException;
import org.testng.annotations.AfterClass;
import org.testng.annotations.Test;
@ -38,6 +39,7 @@ public final class JcloudsS3BlobIntegrationLiveTest
"0"));
private S3Proxy s3Proxy;
private BlobStoreContext context;
private String blobStoreType;
@AfterClass
public void tearDown() throws Exception {
@ -58,6 +60,7 @@ public final class JcloudsS3BlobIntegrationLiveTest
info = TestUtils.startS3Proxy();
s3Proxy = info.getS3Proxy();
context = info.getBlobStore().getContext();
blobStoreType = context.unwrap().getProviderMetadata().getId();
} catch (Exception e) {
throw Throwables.propagate(e);
}
@ -70,4 +73,28 @@ public final class JcloudsS3BlobIntegrationLiveTest
props.setProperty(Constants.PROPERTY_STRIP_EXPECT_HEADER, "true");
return props;
}
@Override
public void testSetBlobAccess() throws Exception {
if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
throw new SkipException("blob access control not supported");
}
super.testSetBlobAccess();
}
@Override
public void testPutBlobAccess() throws Exception {
if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
throw new SkipException("blob access control not supported");
}
super.testPutBlobAccess();
}
@Override
public void testPutBlobAccessMultipart() throws Exception {
if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
throw new SkipException("blob access control not supported");
}
super.testPutBlobAccessMultipart();
}
}

Wyświetl plik

@ -47,6 +47,7 @@ public final class JcloudsS3ClientLiveTest extends S3ClientLiveTest {
"0"));
private S3Proxy s3Proxy;
private BlobStoreContext context;
private String blobStoreType;
@AfterClass
public void tearDown() throws Exception {
@ -67,6 +68,7 @@ public final class JcloudsS3ClientLiveTest extends S3ClientLiveTest {
info = TestUtils.startS3Proxy();
s3Proxy = info.getS3Proxy();
context = info.getBlobStore().getContext();
blobStoreType = context.unwrap().getProviderMetadata().getId();
} catch (Exception e) {
throw Throwables.propagate(e);
}
@ -166,4 +168,38 @@ public final class JcloudsS3ClientLiveTest extends S3ClientLiveTest {
return new URL(String.format("%s/%s/%s", URI.create(endpoint),
containerName, key));
}
@Override
public void testPutCannedAccessPolicyPublic() throws Exception {
if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
throw new SkipException("blob access control not supported");
}
super.testPutCannedAccessPolicyPublic();
}
@Override
public void testCopyCannedAccessPolicyPublic() throws Exception {
if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
throw new SkipException("blob access control not supported");
}
super.testCopyCannedAccessPolicyPublic();
}
@Override
public void testPublicReadOnObject()
throws InterruptedException, ExecutionException, TimeoutException,
IOException {
if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
throw new SkipException("blob access control not supported");
}
super.testPublicReadOnObject();
}
@Override
public void testUpdateObjectCannedACL() throws Exception {
if (Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType)) {
throw new SkipException("blob access control not supported");
}
super.testUpdateObjectCannedACL();
}
}

Wyświetl plik

@ -17,6 +17,7 @@
package org.gaul.s3proxy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.Assume.assumeTrue;
import java.io.InputStream;
import java.net.URI;
@ -91,6 +92,7 @@ public final class S3AwsSdkTest {
private URI s3Endpoint;
private S3Proxy s3Proxy;
private BlobStoreContext context;
private String blobStoreType;
private String containerName;
private BasicAWSCredentials awsCreds;
private AmazonS3 client;
@ -110,7 +112,7 @@ public final class S3AwsSdkTest {
containerName = createRandomContainerName();
info.getBlobStore().createContainerInLocation(null, containerName);
String blobStoreType = context.unwrap().getProviderMetadata().getId();
blobStoreType = context.unwrap().getProviderMetadata().getId();
if (Quirks.OPAQUE_ETAG.contains(blobStoreType)) {
// AWK SDK checks that ETag matches Content-MD5 during PUT
System.setProperty(
@ -382,6 +384,7 @@ public final class S3AwsSdkTest {
@Test
public void testUpdateBlobXmlAcls() throws Exception {
assumeTrue(!Quirks.NO_BLOB_ACCESS_CONTROL.contains(blobStoreType));
String blobName = "testUpdateBlobXmlAcls-blob";
ObjectMetadata metadata = new ObjectMetadata();
metadata.setContentLength(BYTE_SOURCE.size());