-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add network container tests #11583
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
Add network container tests #11583
Changes from all commits
Commits
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
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,26 @@ | ||
FROM httpd:2.4-alpine | ||
|
||
RUN apk add --no-cache git git-daemon openssl | ||
|
||
COPY bar /repos/bar | ||
WORKDIR /repos/bar | ||
RUN git config --global user.email "[email protected]" &&\ | ||
git config --global user.name "Test User" &&\ | ||
git init -b master . &&\ | ||
git add Cargo.toml src &&\ | ||
git commit -m "Initial commit" &&\ | ||
mv .git ../bar.git &&\ | ||
cd ../bar.git &&\ | ||
git config --bool core.bare true &&\ | ||
rm -rf ../bar | ||
WORKDIR / | ||
|
||
EXPOSE 443 | ||
|
||
WORKDIR /usr/local/apache2/conf | ||
COPY httpd-cargo.conf . | ||
RUN cat httpd-cargo.conf >> httpd.conf | ||
RUN openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \ | ||
-keyout server.key -out server.crt \ | ||
-subj "/[email protected]/C=US/ST=California/L=San Francisco/O=Rust/OU=Cargo/CN=127.0.0.1" | ||
WORKDIR / |
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,4 @@ | ||
[package] | ||
name = "bar" | ||
version = "1.0.0" | ||
edition = "2021" |
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 @@ | ||
// Intentionally blank. |
12 changes: 12 additions & 0 deletions
12
crates/cargo-test-support/containers/apache/httpd-cargo.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,12 @@ | ||
SetEnv GIT_PROJECT_ROOT /repos | ||
SetEnv GIT_HTTP_EXPORT_ALL | ||
ScriptAlias /repos /usr/libexec/git-core/git-http-backend/ | ||
LoadModule cgid_module modules/mod_cgid.so | ||
|
||
<Files "git-http-backend"> | ||
Require all granted | ||
</Files> | ||
|
||
Include conf/extra/httpd-ssl.conf | ||
LoadModule ssl_module modules/mod_ssl.so | ||
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so |
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,29 @@ | ||
FROM alpine:3.17 | ||
|
||
RUN apk add --no-cache openssh git | ||
RUN ssh-keygen -A | ||
|
||
RUN addgroup -S testuser && adduser -S testuser -G testuser -s /bin/ash | ||
# NOTE: Ideally the password should be set to *, but I am uncertain how to do | ||
# that in alpine. It shouldn't matter since PermitEmptyPasswords is "no". | ||
RUN passwd -u testuser | ||
|
||
RUN mkdir /repos && chown testuser /repos | ||
COPY --chown=testuser:testuser bar /repos/bar | ||
USER testuser | ||
WORKDIR /repos/bar | ||
RUN git config --global user.email "[email protected]" &&\ | ||
git config --global user.name "Test User" &&\ | ||
git init -b master . &&\ | ||
git add Cargo.toml src &&\ | ||
git commit -m "Initial commit" &&\ | ||
mv .git ../bar.git &&\ | ||
cd ../bar.git &&\ | ||
git config --bool core.bare true &&\ | ||
rm -rf ../bar | ||
WORKDIR / | ||
USER root | ||
|
||
EXPOSE 22 | ||
|
||
ENTRYPOINT ["/usr/sbin/sshd", "-D", "-E", "/var/log/auth.log"] |
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,4 @@ | ||
[package] | ||
name = "bar" | ||
version = "1.0.0" | ||
edition = "2021" |
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 @@ | ||
// Intentionally blank. |
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.