kopia lustrzana https://github.com/gaul/s3proxy
Allow kernel to pick S3Proxy port in tests
rodzic
2dd3dac970
commit
15e11975a2
|
@ -90,6 +90,10 @@ public final class S3Proxy {
|
|||
server.stop();
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return ((ServerConnector) server.getConnectors()[0]).getLocalPort();
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
if (args.length == 1 && args[0].equals("--version")) {
|
||||
System.err.println(
|
||||
|
|
|
@ -107,6 +107,16 @@ public final class S3ProxyTest {
|
|||
containerName = createRandomContainerName();
|
||||
blobStore.createContainerInLocation(null, containerName);
|
||||
|
||||
s3Proxy = new S3Proxy(blobStore, s3Endpoint, s3Identity, s3Credential,
|
||||
Resources.getResource(keyStorePath).toString(),
|
||||
keyStorePassword,
|
||||
"true".equalsIgnoreCase(forceMultiPartUpload), virtualHost);
|
||||
s3Proxy.start();
|
||||
// reset endpoint to handle zero port
|
||||
s3Endpoint = new URI(s3Endpoint.getScheme(), s3Endpoint.getUserInfo(),
|
||||
s3Endpoint.getHost(), s3Proxy.getPort(), s3Endpoint.getPath(),
|
||||
s3Endpoint.getQuery(), s3Endpoint.getFragment());
|
||||
|
||||
Properties s3Properties = new Properties();
|
||||
s3Properties.setProperty(Constants.PROPERTY_TRUST_ALL_CERTS, "true");
|
||||
s3Context = ContextBuilder
|
||||
|
@ -116,12 +126,6 @@ public final class S3ProxyTest {
|
|||
.overrides(s3Properties)
|
||||
.build(BlobStoreContext.class);
|
||||
s3BlobStore = s3Context.getBlobStore();
|
||||
|
||||
s3Proxy = new S3Proxy(blobStore, s3Endpoint, s3Identity, s3Credential,
|
||||
Resources.getResource(keyStorePath).toString(),
|
||||
keyStorePassword,
|
||||
"true".equalsIgnoreCase(forceMultiPartUpload), virtualHost);
|
||||
s3Proxy.start();
|
||||
}
|
||||
|
||||
@After
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
s3proxy.endpoint=https://127.0.0.1:8080
|
||||
s3proxy.endpoint=https://127.0.0.1:0
|
||||
# authorization must be aws-v2 or none
|
||||
s3proxy.authorization=aws-v2
|
||||
s3proxy.identity=local-identity
|
||||
|
|
Ładowanie…
Reference in New Issue