-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fix internal port check when other ports are opened as well on the target container #2363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b6c1b7f
Remove redundant execCreateCmd call
codablock 1c7aeee
Allow leading zeros in /proc/net/tcp* when doing internal port listen…
codablock 0ace0eb
Surround grep parameter with '
codablock d22fa3e
Refactor/Rewrite InternalCommandPortListeningCheckTest to test all po…
codablock ee4e92c
Add test for low+high ports
codablock 365a9b0
Check for bash existence instead of only mentioning it in a comment
codablock 885df86
Rename nginx_on_8080.conf to nginx.conf
codablock 4df12fc
Make container a @Rule again by moving initialization into contructor
codablock df6c38a
Wait a few seconds for InternalCommandPortListeningCheck to pass
codablock File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
core/src/test/resources/internal-port-check-dockerfile/Dockerfile-bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| FROM nginx:1.17-alpine | ||
|
|
||
| RUN apk add bash | ||
|
|
||
| # Make sure the /proc/net/tcp* check fails in this container | ||
| RUN rm /usr/bin/awk | ||
|
|
||
| # Make sure the nc check fails in this container | ||
| RUN rm /usr/bin/nc | ||
|
|
||
| ADD nginx.conf /etc/nginx/conf.d/default.conf |
9 changes: 9 additions & 0 deletions
9
core/src/test/resources/internal-port-check-dockerfile/Dockerfile-nc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| FROM nginx:1.17-alpine | ||
|
|
||
| # If this fails, you ended up using a base image with bash installed. Consider removing /bin/bash in this case | ||
| RUN if bash -c true &> /dev/null; then exit 1; fi | ||
|
|
||
| # Make sure the /proc/net/tcp* check fails in this container | ||
| RUN rm /usr/bin/awk | ||
|
|
||
| ADD nginx.conf /etc/nginx/conf.d/default.conf |
9 changes: 9 additions & 0 deletions
9
core/src/test/resources/internal-port-check-dockerfile/Dockerfile-tcp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| FROM nginx:1.17-alpine | ||
|
|
||
| # If this fails, you ended up using a base image with bash installed. Consider removing /bin/bash in this case | ||
| RUN if bash -c true &> /dev/null; then exit 1; fi | ||
|
|
||
| # Make sure the nc check fails in this container | ||
| RUN rm /usr/bin/nc | ||
|
|
||
| ADD nginx.conf /etc/nginx/conf.d/default.conf |
8 changes: 8 additions & 0 deletions
8
core/src/test/resources/internal-port-check-dockerfile/nginx.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # This configuration makes Nginx listen on port port 8080 | ||
|
|
||
| server { | ||
| # Port 8080 is necessary to prove that the command formatting in the /proc/net/tcp* check uses the correct casing for hexadecimal numbers (i.e. 1F90 and not 1f90) | ||
| listen 8080; | ||
| # Port 100 is necessary to ensure that the /proc/net/tcp* check also succeeds with trailing zeros in the hexadecimal port | ||
| listen 100; | ||
| } |
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.