|
26 | 26 | import org.junit.Test; |
27 | 27 | import org.junit.experimental.runners.Enclosed; |
28 | 28 | import org.junit.runner.RunWith; |
29 | | -import org.testcontainers.DockerClientFactory; |
30 | 29 | import org.testcontainers.containers.Container; |
31 | 30 | import org.testcontainers.containers.GenericContainer; |
32 | 31 | import org.testcontainers.containers.Network; |
@@ -153,12 +152,7 @@ public void sqsTestOverBridgeNetwork() { |
153 | 152 | String fooQueueUrl = queueResult.getQueueUrl(); |
154 | 153 | assertThat(fooQueueUrl) |
155 | 154 | .as("Created queue has external hostname URL") |
156 | | - .contains( |
157 | | - "http://" + |
158 | | - DockerClientFactory.instance().dockerHostIpAddress() + |
159 | | - ":" + |
160 | | - localstack.getMappedPort(LocalStackContainer.PORT) |
161 | | - ); |
| 155 | + .contains("http://" + localstack.getHost() + ":" + localstack.getMappedPort(LocalStackContainer.PORT)); |
162 | 156 |
|
163 | 157 | sqs.sendMessage(fooQueueUrl, "test"); |
164 | 158 | final long messageCount = sqs |
@@ -265,14 +259,17 @@ public static class WithNetwork { |
265 | 259 | LocalstackTestImages.AWS_CLI_IMAGE |
266 | 260 | ) |
267 | 261 | .withNetwork(network) |
268 | | - .withCreateContainerCmdModifier(cmd -> cmd.withEntrypoint("top")) |
| 262 | + .withCreateContainerCmdModifier(cmd -> cmd.withEntrypoint("tail")) |
| 263 | + .withCommand(" -f /dev/null") |
269 | 264 | .withEnv("AWS_ACCESS_KEY_ID", "accesskey") |
270 | 265 | .withEnv("AWS_SECRET_ACCESS_KEY", "secretkey") |
271 | 266 | .withEnv("AWS_REGION", "eu-west-1"); |
272 | 267 |
|
273 | 268 | @Test |
274 | 269 | public void s3TestOverDockerNetwork() throws Exception { |
275 | | - runAwsCliAgainstDockerNetworkContainer("s3api create-bucket --bucket foo"); |
| 270 | + runAwsCliAgainstDockerNetworkContainer( |
| 271 | + "s3api create-bucket --bucket foo --create-bucket-configuration LocationConstraint=eu-west-1" |
| 272 | + ); |
276 | 273 | runAwsCliAgainstDockerNetworkContainer("s3api list-buckets"); |
277 | 274 | runAwsCliAgainstDockerNetworkContainer("s3 ls s3://foo"); |
278 | 275 | } |
@@ -313,7 +310,7 @@ public void cloudWatchLogsTestOverDockerNetwork() throws Exception { |
313 | 310 | private String runAwsCliAgainstDockerNetworkContainer(String command) throws Exception { |
314 | 311 | final String[] commandParts = String |
315 | 312 | .format( |
316 | | - "/usr/bin/aws --region eu-west-1 %s --endpoint-url http://localstack:%d --no-verify-ssl", |
| 313 | + "/usr/local/bin/aws --region eu-west-1 %s --endpoint-url http://localstack:%d --no-verify-ssl", |
317 | 314 | command, |
318 | 315 | LocalStackContainer.PORT |
319 | 316 | ) |
|
0 commit comments