forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from scanlonp/mikewr-ec2-test
Add integ.vpc-dual-stack-ec2 test, wire up allowAllIpv6Outbound field…
- Loading branch information
Showing
15 changed files
with
3,611 additions
and
12 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
...k-testing/framework-integ/test/aws-ec2/test/integ.vpc-dual-stack-ec2.assets/web-server.py
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,47 @@ | ||
from http.server import SimpleHTTPRequestHandler | ||
import urllib.request | ||
import json | ||
|
||
class MyRequestHandler(SimpleHTTPRequestHandler): | ||
def do_GET(self): | ||
if self.path == '/': | ||
self.send_response(200) | ||
self.send_header('Content-type', 'application/json') | ||
self.end_headers() | ||
|
||
try: | ||
# IPv4 request | ||
response = urllib.request.urlopen('http://www.google.com') | ||
status_code = response.getcode() | ||
if (status_code != 200): | ||
raise Exception(f"Received a non-successful status code: {status_code}") | ||
# self.wfile.write(bytes(f"Status code from www.google.com: {status_code}\n\n", 'utf-8')) | ||
|
||
# IPv6 request | ||
response = urllib.request.urlopen('http://ipv6.google.com') | ||
status_code = response.getcode() | ||
if (status_code != 200): | ||
raise Exception(f"Received a non-successful status code: {status_code}") | ||
# self.wfile.write(bytes(f"Status code from ipv6.google.com: {status_code}\n\n", 'utf-8')) | ||
|
||
json_response = { | ||
"status": 200, | ||
"body": "OK", | ||
"Data": { | ||
"OK": "OK", | ||
"status": 200, | ||
} | ||
} | ||
|
||
self.wfile.write(json.dumps(json_response).encode('utf-8')) | ||
except Exception as e: | ||
self.wfile.write(bytes(f"Error: {str(e)}", 'utf-8')) | ||
return | ||
else: | ||
super().do_GET() | ||
|
||
if __name__ == '__main__': | ||
from http.server import HTTPServer | ||
server = HTTPServer(('localhost', 8000), MyRequestHandler) | ||
print('Server started on http://localhost:8000') | ||
server.serve_forever() |
147 changes: 147 additions & 0 deletions
147
.../asset.4554b47be6f57b68c6c7a7391dcc73894866d2377fe174883351e7639097f292/__entrypoint__.js
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
....snapshot/asset.4554b47be6f57b68c6c7a7391dcc73894866d2377fe174883351e7639097f292/index.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
...set.95ed4fecda5f23bb923df9bad3b95f22174c9023f6141f667c3bd2f3e674e456.assets/web-server.py
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...dk-testing/framework-integ/test/aws-ec2/test/integ.vpc-dual-stack-ec2.js.snapshot/cdk.out
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
...testing/framework-integ/test/aws-ec2/test/integ.vpc-dual-stack-ec2.js.snapshot/integ.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.