diff options
author | 2019-03-27 18:21:29 +0200 | |
---|---|---|
committer | 2019-03-27 19:06:28 +0200 | |
commit | f8af5bf9990febf114573b4672cae78a50005efb (patch) | |
tree | 511de6a4e3ba74972bf0ffe3ef52e6f91cd6d735 | |
parent | 26ed3a83159b3de2d495b0b41495a826d7e8fd8a (diff) |
Update VID in docker-compose to 4.0-STAGING-latest
Added AAI simulator for new enrichCloudConfigurationWithCloudOwner
feature:
- Add AAI response
- Update Dockerfile with FROM python, and parametrized config
- Add aai-simulator to docker-compose file
BTW, modified SO.py to log to stdio. This enable running `docker logs
so-simulator` to see the rolling output.
Issue-ID: VID-453
Change-Id: Icd1ee2dd51d404261c3e0484b22a4d32b8e4aad8
Signed-off-by: Ittay Stern <ittay.stern@att.com>
-rw-r--r-- | plans/vid/healthCheck/setup.sh | 2 | ||||
-rw-r--r-- | plans/vid/healthCheck/teardown.sh | 1 | ||||
-rw-r--r-- | scripts/vid/kill_containers_and_remove_dataFolders.sh | 5 | ||||
-rw-r--r-- | tests/vid/resources/docker-compose.yml | 18 | ||||
-rw-r--r-- | tests/vid/resources/simulators/Dockerfile | 14 | ||||
-rw-r--r-- | tests/vid/resources/simulators/SO.py | 2 | ||||
-rw-r--r-- | tests/vid/resources/simulators/test_data_assets/expected_aai_requests.json | 4 | ||||
-rw-r--r-- | tests/vid/resources/simulators/test_data_assets/expected_aai_responses.json | 9 |
8 files changed, 39 insertions, 16 deletions
diff --git a/plans/vid/healthCheck/setup.sh b/plans/vid/healthCheck/setup.sh index 584a640a..50a28b6b 100644 --- a/plans/vid/healthCheck/setup.sh +++ b/plans/vid/healthCheck/setup.sh @@ -25,7 +25,7 @@ source ${SCRIPTS}/common_functions.sh source ${WORKSPACE}/scripts/vid/clone_and_setup_vid_data.sh source ${WORKSPACE}/scripts/vid/start_vid_containers.sh -echo `Obtaining ip of VID server...` +echo "Obtaining ip of VID server..." VID_IP=`get-instance-ip.sh vid-server` SO_SIMULATOR_IP=`get-instance-ip.sh so-simulator` diff --git a/plans/vid/healthCheck/teardown.sh b/plans/vid/healthCheck/teardown.sh index 8f168679..e5e5140a 100644 --- a/plans/vid/healthCheck/teardown.sh +++ b/plans/vid/healthCheck/teardown.sh @@ -18,6 +18,5 @@ # source ${WORKSPACE}/scripts/vid/kill_containers_and_remove_dataFolders.sh -docker kill so-simulator # $WORKSPACE/archives/clamp-clone deleted with archives folder when tests starts so we keep it at the end for debugging diff --git a/scripts/vid/kill_containers_and_remove_dataFolders.sh b/scripts/vid/kill_containers_and_remove_dataFolders.sh index 9e72a42f..d7e05533 100644 --- a/scripts/vid/kill_containers_and_remove_dataFolders.sh +++ b/scripts/vid/kill_containers_and_remove_dataFolders.sh @@ -20,8 +20,9 @@ echo "This is ${WORKSPACE}/scripts/vid/kill_and_remove_dataFolder.sh" #kill and remove all vid dockers -docker stop $(docker ps -a -q --filter="name=vid") -docker rm $(docker ps -a -q --filter="name=vid") +cd ${WORKSPACE}/tests/vid/resources +docker-compose down +docker-compose rm -f #delete data folder diff --git a/tests/vid/resources/docker-compose.yml b/tests/vid/resources/docker-compose.yml index 5f2c0fec..01fa92b3 100644 --- a/tests/vid/resources/docker-compose.yml +++ b/tests/vid/resources/docker-compose.yml @@ -1,11 +1,12 @@ version: '3' services: vid-server: - image: nexus3.onap.org:10001/onap/vid:3.0-STAGING-latest + image: nexus3.onap.org:10001/onap/vid:4.0-STAGING-latest environment: - VID_MYSQL_DBNAME=vid_openecomp_epsdk - VID_MYSQL_PASS=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U - VID_MSO_SERVER_URL=https://so-simulator:8443 + - VID_AAI_URL=http://aai-simulator:8443 ports: - "8080:8080" - "8443:8443" @@ -29,6 +30,19 @@ services: build: context: simulators dockerfile: Dockerfile + args: + component: so ports: - "8444:8443" - container_name: so-simulator
\ No newline at end of file + container_name: so-simulator + + aai-simulator: + build: + context: simulators + dockerfile: Dockerfile + args: + component: aai + ports: + - "8445:8443" + container_name: aai-simulator + 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" + } + ] + } +} |