From 76995a363d1cabaee26066b52a476ae28c4fd638 Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sat, 17 Sep 2016 12:12:54 -0700 Subject: [PATCH] Do not fail AWS S3 signer tests with expiry Regression from 41bdd9c5a9e02aa407e7036d3fddceb138f8b3b7. References #1008. --- .../integration/S3BlobSignerLiveTest.java | 20 +++++++++++++++---- .../integration/AWSS3BlobSignerLiveTest.java | 7 +++++++ 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3BlobSignerLiveTest.java b/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3BlobSignerLiveTest.java index 87ee17aae3..872e2d9cbe 100644 --- a/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3BlobSignerLiveTest.java +++ b/apis/s3/src/test/java/org/jclouds/s3/blobstore/integration/S3BlobSignerLiveTest.java @@ -33,11 +33,17 @@ public class S3BlobSignerLiveTest extends BaseBlobSignerLiveTest { BaseBlobStoreIntegrationTest.SANITY_CHECK_RETURNED_BUCKET_NAME = true; } + protected boolean supportsUrlWithTime() { + return false; + } + @Test public void testSignGetUrlWithTime() throws InterruptedException, IOException { try { super.testSignGetUrlWithTime(); - fail(); + if (!supportsUrlWithTime()) { + fail(); + } } catch (UnsupportedOperationException uoe) { throw new SkipException("not supported by S3 signer", uoe); } @@ -47,7 +53,9 @@ public class S3BlobSignerLiveTest extends BaseBlobSignerLiveTest { public void testSignGetUrlWithTimeExpired() throws InterruptedException, IOException { try { super.testSignGetUrlWithTimeExpired(); - fail(); + if (!supportsUrlWithTime()) { + fail(); + } } catch (UnsupportedOperationException uoe) { throw new SkipException("not supported by S3 signer", uoe); } @@ -57,7 +65,9 @@ public class S3BlobSignerLiveTest extends BaseBlobSignerLiveTest { public void testSignPutUrlWithTime() throws Exception { try { super.testSignPutUrlWithTime(); - fail(); + if (!supportsUrlWithTime()) { + fail(); + } } catch (UnsupportedOperationException uoe) { throw new SkipException("not supported by S3 signer", uoe); } @@ -67,7 +77,9 @@ public class S3BlobSignerLiveTest extends BaseBlobSignerLiveTest { public void testSignPutUrlWithTimeExpired() throws Exception { try { super.testSignPutUrlWithTimeExpired(); - fail(); + if (!supportsUrlWithTime()) { + fail(); + } } catch (UnsupportedOperationException uoe) { throw new SkipException("not supported by S3 signer", uoe); } diff --git a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3BlobSignerLiveTest.java b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3BlobSignerLiveTest.java index 769ded7339..589060dbb7 100644 --- a/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3BlobSignerLiveTest.java +++ b/providers/aws-s3/src/test/java/org/jclouds/aws/s3/blobstore/integration/AWSS3BlobSignerLiveTest.java @@ -16,9 +16,11 @@ */ package org.jclouds.aws.s3.blobstore.integration; +import java.io.IOException; import java.util.Properties; import org.jclouds.Constants; +import org.jclouds.blobstore.integration.internal.BaseBlobSignerLiveTest; import org.jclouds.s3.blobstore.integration.S3BlobSignerLiveTest; import org.testng.annotations.Test; @@ -35,4 +37,9 @@ public class AWSS3BlobSignerLiveTest extends S3BlobSignerLiveTest { overrides.setProperty(Constants.PROPERTY_SESSION_INTERVAL, "1"); return overrides; } + + @Override + protected boolean supportsUrlWithTime() { + return true; + } }