Skip to content

Commit 23e9718

Browse files
perlunrnorth
authored andcommitted
Fix /proc/net/tcp* check in InternalCommandPortListeningCheck t… (#2195)
1 parent 4671f3a commit 23e9718

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/main/java/org/testcontainers/containers/wait/internal/InternalCommandPortListeningCheck.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public Boolean call() {
2929
for (int internalPort : internalPorts) {
3030
command += " && ";
3131
command += " (";
32-
command += format("cat /proc/net/tcp{,6} | awk '{print $2}' | grep -i :%x", internalPort);
32+
command += format("cat /proc/net/tcp* | awk '{print $2}' | grep -i :%x", internalPort);
3333
command += " || ";
3434
command += format("nc -vz -w 1 localhost %d", internalPort);
3535
command += " || ";

core/src/test/java/org/testcontainers/containers/wait/internal/InternalCommandPortListeningCheckTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
public class InternalCommandPortListeningCheckTest {
1313

14-
// Linking a custom configuration into the container so that nginx is listening on port 8080. This is necessary to proof
15-
// that the command formatting uses the correct casing for hexadecimal numberd (i.e. 1F90 and not 1f90).
14+
// Linking a custom configuration into the container so that nginx is listening on port 8080. This is necessary to prove
15+
// that the command formatting uses the correct casing for hexadecimal numbers (i.e. 1F90 and not 1f90).
1616
@Rule
1717
public GenericContainer nginx = new GenericContainer<>("nginx:1.9.4")
1818
.withClasspathResourceMapping("nginx_on_8080.conf", "/etc/nginx/conf.d/default.conf", BindMode.READ_ONLY);

0 commit comments

Comments
 (0)