|
@@ -31,6 +31,8 @@ import org.apache.hadoop.fs.Path;
|
|
|
import org.apache.hadoop.fs.contract.ContractTestUtils;
|
|
|
import org.apache.hadoop.fs.s3native.S3xLoginHelper;
|
|
|
import org.apache.hadoop.test.GenericTestUtils;
|
|
|
+
|
|
|
+import org.assertj.core.api.Assertions;
|
|
|
import org.junit.Assert;
|
|
|
import org.junit.Rule;
|
|
|
import org.junit.Test;
|
|
@@ -511,6 +513,34 @@ public class ITestS3AConfiguration {
|
|
|
assertOptionEquals(updated, "fs.s3a.propagation", "propagated");
|
|
|
}
|
|
|
|
|
|
+ @Test(timeout = 10_000L)
|
|
|
+ public void testConnectTtlPropagation() throws Exception {
|
|
|
+ Configuration config = new Configuration(false);
|
|
|
+ ClientConfiguration awsConf = new ClientConfiguration();
|
|
|
+ initConnectionSettings(config, awsConf);
|
|
|
+ Assertions.assertThat(awsConf.getConnectionTTL())
|
|
|
+ .describedAs("connection ttl should be set to default value as" +
|
|
|
+ " %s is not set", CONNECTION_TTL)
|
|
|
+ .isEqualTo(DEFAULT_CONNECTION_TTL);
|
|
|
+ long connectionTtlTestVal = 1000;
|
|
|
+ config.setLong(CONNECTION_TTL, connectionTtlTestVal);
|
|
|
+ initConnectionSettings(config, awsConf);
|
|
|
+ Assertions.assertThat(awsConf.getConnectionTTL())
|
|
|
+ .describedAs("%s not propagated to aws conf", CONNECTION_TTL)
|
|
|
+ .isEqualTo(connectionTtlTestVal);
|
|
|
+
|
|
|
+ long connectionTtlTestVal1 = -1;
|
|
|
+ config.setLong(CONNECTION_TTL, connectionTtlTestVal1);
|
|
|
+ initConnectionSettings(config, awsConf);
|
|
|
+ Assertions.assertThat(awsConf.getConnectionTTL())
|
|
|
+ .describedAs("%s not propagated to aws conf", CONNECTION_TTL)
|
|
|
+ .isEqualTo(connectionTtlTestVal1);
|
|
|
+
|
|
|
+ long connectionTtlTestVal2 = -100;
|
|
|
+ config.setLong(CONNECTION_TTL, connectionTtlTestVal2);
|
|
|
+ intercept(IllegalArgumentException.class, () -> initConnectionSettings(config, awsConf));
|
|
|
+ }
|
|
|
+
|
|
|
@Test(timeout = 10_000L)
|
|
|
public void testS3SpecificSignerOverride() throws IOException {
|
|
|
ClientConfiguration clientConfiguration = null;
|