aboutsummaryrefslogtreecommitdiffstats
path: root/tests/vid/resources/simulators
diff options
context:
space:
mode:
Diffstat (limited to 'tests/vid/resources/simulators')
-rw-r--r--tests/vid/resources/simulators/Dockerfile14
-rw-r--r--tests/vid/resources/simulators/SO.py2
-rw-r--r--tests/vid/resources/simulators/test_data_assets/expected_aai_requests.json4
-rw-r--r--tests/vid/resources/simulators/test_data_assets/expected_aai_responses.json9
4 files changed, 19 insertions, 10 deletions
diff --git a/tests/vid/resources/simulators/Dockerfile b/tests/vid/resources/simulators/Dockerfile
index ace6d56d..e6586b1e 100644
--- a/tests/vid/resources/simulators/Dockerfile
+++ b/tests/vid/resources/simulators/Dockerfile
@@ -1,16 +1,12 @@
-FROM alpine:3.9
+FROM python:3-alpine3.9
-RUN apk add --no-cache python3 && \
- python3 -m ensurepip && \
- rm -r /usr/lib/python*/ensurepip && \
- pip3 install --upgrade pip setuptools && \
- if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
- if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
- rm -r /root/.cache
+# `component` should be `so` or `aai`
+ARG component
+ENV component=$component
COPY SO.py /
ADD ./test_data_assets/ /
EXPOSE 8443
-CMD [ "python", "./SO.py", "expected_so_requests.json", "expected_so_responses.json" ]
+CMD python ./SO.py expected_${component}_requests.json expected_${component}_responses.json
diff --git a/tests/vid/resources/simulators/SO.py b/tests/vid/resources/simulators/SO.py
index c1199390..fa481b38 100644
--- a/tests/vid/resources/simulators/SO.py
+++ b/tests/vid/resources/simulators/SO.py
@@ -103,7 +103,7 @@ class JsonFileToDictReader(object):
def init_so_simulator():
expected_so_requests = JsonFileToDictReader.read_expected_test_data(argv[1])
expected_so_responses = JsonFileToDictReader.read_expected_test_data(argv[2])
- logging.basicConfig(filename='output.log', level=logging.INFO)
+ logging.basicConfig(level=logging.INFO)
handler = partial(SOHandler, expected_so_requests, expected_so_responses)
handler.protocol_version = "HTTP/1.0"
httpd = HTTPServer(('', DEFAULT_PORT), handler)
diff --git a/tests/vid/resources/simulators/test_data_assets/expected_aai_requests.json b/tests/vid/resources/simulators/test_data_assets/expected_aai_requests.json
new file mode 100644
index 00000000..3d77fe59
--- /dev/null
+++ b/tests/vid/resources/simulators/test_data_assets/expected_aai_requests.json
@@ -0,0 +1,4 @@
+{
+ "get": {
+ }
+} \ No newline at end of file
diff --git a/tests/vid/resources/simulators/test_data_assets/expected_aai_responses.json b/tests/vid/resources/simulators/test_data_assets/expected_aai_responses.json
new file mode 100644
index 00000000..c809bca1
--- /dev/null
+++ b/tests/vid/resources/simulators/test_data_assets/expected_aai_responses.json
@@ -0,0 +1,9 @@
+{
+ "get": {
+ "cloud-region": [{
+ "cloud-owner": "CloudOwner",
+ "cloud-region-id": "RegionOne"
+ }
+ ]
+ }
+}