-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8c44f9d
commit 28dd685
Showing
4 changed files
with
88 additions
and
131 deletions.
There are no files selected for viewing
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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 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,58 @@ | ||
# Tests related to running the Proxy | ||
|
||
exec docker build -qt proxy-updater . | ||
exec docker build -qt dummy-proxy -f Dockerfile.proxy . | ||
|
||
dependabot update go_modules dependabot/cli --updater-image proxy-updater --proxy-image dummy-proxy | ||
stderr 'proxy \| Proxy is running' | ||
stderr 'updater \| Updater is running' | ||
! stderr 'proxy \| custom-ca-cert\.crt' | ||
|
||
dependabot update go_modules dependabot/cli --proxy-cert my-cert --updater-image proxy-updater --proxy-image dummy-proxy | ||
stderr 'proxy \| custom-ca-cert\.crt' | ||
stderr 'proxy \| I am a certificate' | ||
|
||
# Test that the CLI exits with non-zero if the proxy does too. | ||
! dependabot update go_modules dependabot/cli --proxy-cert crash --updater-image proxy-updater --proxy-image dummy-proxy --proxy-username user --proxy-password pass | ||
|
||
exec docker rmi -f proxy-updater dummy-proxy | ||
|
||
-- crash -- | ||
crash | ||
|
||
-- my-cert -- | ||
I am a certificate | ||
|
||
-- Dockerfile.proxy -- | ||
FROM ubuntu:22.04 | ||
|
||
COPY --chmod=755 update-ca-certificates /usr/bin/update-ca-certificates | ||
COPY --chmod=755 update-job-proxy /update-job-proxy | ||
|
||
-- update-job-proxy -- | ||
#!/usr/bin/env bash | ||
|
||
echo "Proxy is running" | ||
echo "$(</config.json)" | ||
|
||
-- Dockerfile -- | ||
FROM ubuntu:22.04 | ||
|
||
RUN useradd dependabot | ||
|
||
COPY --chown=dependabot --chmod=755 update-ca-certificates /usr/bin/update-ca-certificates | ||
COPY --chown=dependabot --chmod=755 run bin/run | ||
|
||
-- update-ca-certificates -- | ||
#!/usr/bin/env bash | ||
|
||
ls /usr/local/share/ca-certificates || true | ||
cat /usr/local/share/ca-certificates/custom-ca-cert.crt || true | ||
|
||
# signal to cause the proxy to exit with a non-zero code | ||
grep crash /usr/local/share/ca-certificates/custom-ca-cert.crt && exit 1 || true | ||
|
||
-- run -- | ||
#!/usr/bin/env bash | ||
|
||
echo "Updater is running" |