diff options
author | paulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com> | 2020-01-02 16:25:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-02 16:25:37 +0100 |
commit | 25250c8c24a3c0b32c92eee5552ad7156115f03c (patch) | |
tree | 02c178a19be0e233813600531c85ef7ad5e4c51c /tests | |
parent | 027a2fa61a6044b2e967b29195312e4d98a96078 (diff) | |
parent | a3c4b3d5444e5d79afbd823a9acc12220a91f41f (diff) | |
download | ansible-kong-app-25250c8c24a3c0b32c92eee5552ad7156115f03c.tar.gz ansible-kong-app-25250c8c24a3c0b32c92eee5552ad7156115f03c.tar.zst ansible-kong-app-25250c8c24a3c0b32c92eee5552ad7156115f03c.zip |
Merge pull request #18 from paulrbr-fl/pre-function-pluginsv0.30
config(dhall): add a pre-function lua definition for HTTPS redirects
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/kong.py | 22 | ||||
-rw-r--r-- | tests/test.yml | 13 |
2 files changed, 29 insertions, 6 deletions
diff --git a/tests/kong.py b/tests/kong.py new file mode 100755 index 0000000..32bafb2 --- /dev/null +++ b/tests/kong.py | |||
@@ -0,0 +1,22 @@ | |||
1 | #!/usr/bin/env python | ||
2 | |||
3 | from http.server import HTTPServer, CGIHTTPRequestHandler | ||
4 | |||
5 | class SimpleHTTPRequestHandler(CGIHTTPRequestHandler): | ||
6 | def do_GET(self): | ||
7 | if self.path == '/services/test': | ||
8 | self.send_response(404) | ||
9 | else: | ||
10 | self.send_response(200) | ||
11 | self.send_header('Content-Type', 'application/json') | ||
12 | self.end_headers() | ||
13 | self.wfile.write(b'{ "data": [] }') | ||
14 | |||
15 | def do_POST(self): | ||
16 | self.send_response(200) | ||
17 | self.end_headers() | ||
18 | self.wfile.write(b'Hello, world!') | ||
19 | |||
20 | |||
21 | httpd = HTTPServer(('127.0.0.1', 8000), SimpleHTTPRequestHandler) | ||
22 | httpd.serve_forever() | ||
diff --git a/tests/test.yml b/tests/test.yml index 490c967..36c81a2 100644 --- a/tests/test.yml +++ b/tests/test.yml | |||
@@ -3,9 +3,10 @@ | |||
3 | remote_user: root | 3 | remote_user: root |
4 | roles: | 4 | roles: |
5 | - role: ansible-kong-app | 5 | - role: ansible-kong-app |
6 | kong_servers: | 6 | vars: |
7 | - kong_app_admin_url: http://127.0.0.1:8000 | 7 | kong_servers: |
8 | kong_app_admin_apikey: "" | 8 | - kong_app_admin_url: http://127.0.0.1:8000 |
9 | services: | 9 | kong_app_admin_apikey: "" |
10 | - url: http://example.com | 10 | services: |
11 | name: test | 11 | - url: http://example.com |
12 | name: test | ||