File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 suiteFileArray : ' ["./test/dockerized/suites/*.json"]'
4040 dockerImageName : ' local/test'
4141 taskFolder : ' ./test/dockerized/tasks'
42+
43+ - name : Build the proxy image
44+ run : docker build . -t local/test-proxy -f Dockerfile.test.proxy
45+
46+ - name : Run proxy tests
47+ uses : aws/containerized-test-runner-for-aws-lambda@511d270614f2c6b1613848db6dcf920a591c3c89 # main
48+ with :
49+ suiteFileArray : ' ["./test/dockerized/suites/proxy/*.json"]'
50+ dockerImageName : ' local/test-proxy'
51+ taskFolder : ' ./test/dockerized/tasks'
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ ADD test/dockerized/tasks /var/task
55RUN gem uninstall aws_lambda_ric --executables
66ADD pkg /tmp/pkg
77RUN gem install /tmp/pkg/aws_lambda_ric-*.gem
8- RUN rm -rf /tmp/pkg
8+ RUN rm -rf /tmp/pkg
Original file line number Diff line number Diff line change 1+ # Variant of Dockerfile.test used only for the proxy-regression suite.
2+ # Extends the standard test image with an unreachable HTTP_PROXY and an
3+ # entrypoint that binds RIE's Runtime API to the container's own
4+ # non-loopback hostname. Kept separate from Dockerfile.test so the other
5+ # suites keep running against a plain RIE-on-loopback setup.
6+ #
7+ # Requires local/test to be built first (see .github/workflows/dockerized-test.yml).
8+ FROM local/test
9+
10+ ENV HTTP_PROXY=http://127.0.0.1:1
11+ ENV http_proxy=http://127.0.0.1:1
12+
13+ COPY test/dockerized/entrypoint.sh /entrypoint.sh
14+ RUN chmod +x /entrypoint.sh
15+ ENTRYPOINT ["/entrypoint.sh"]
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ # Copyright 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+ #
4+
5+ set -eu
6+
7+ if [ " $# " -ne 1 ]; then
8+ echo " entrypoint requires the handler name as first argument" 1>&2
9+ exit 142
10+ fi
11+ export _HANDLER=" $1 "
12+
13+ # Resolve the container's own hostname to its non-loopback IPv4 (docker
14+ # writes this to /etc/hosts for us on eth0).
15+ RIC_HOST=" $( getent hosts " $HOSTNAME " | awk ' {print $1; exit}' ) "
16+ if [ -z " $RIC_HOST " ]; then
17+ echo " entrypoint could not resolve \$ HOSTNAME ($HOSTNAME )" 1>&2
18+ exit 143
19+ fi
20+
21+ exec /usr/local/bin/aws-lambda-rie \
22+ --runtime-api-address " $RIC_HOST :9001" \
23+ /var/runtime/bootstrap
Original file line number Diff line number Diff line change 1+ {
2+ "tests" : [
3+ {
4+ "name" : " test_ric_bypasses_http_proxy" ,
5+ "handler" : " proxy.check_proxy_bypass" ,
6+ "request" : {},
7+ "assertions" : [
8+ {
9+ "response" : " success"
10+ }
11+ ]
12+ }
13+ ]
14+ }
Original file line number Diff line number Diff line change 1+ # Copyright 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ #
3+ # The image (see Dockerfile.test) runs with HTTP_PROXY pointed at an
4+ # unreachable address and RIE's Runtime API bound to a non-loopback
5+ # hostname. If the proxy-bypass fix (PR #68) is in place the RIC bypasses
6+ # HTTP_PROXY for Runtime API calls and this handler runs to completion,
7+ # returning "success". Without the fix the RIC would try to reach the
8+ # unreachable proxy for next_invocation and this handler would never run.
9+
10+ def check_proxy_bypass ( event :, context :)
11+ 'success'
12+ end
You can’t perform that action at this time.
0 commit comments