aboutsummaryrefslogtreecommitdiffstats
path: root/healthcheck
diff options
context:
space:
mode:
authormrichomme <morgan.richomme@orange.com>2019-12-10 08:47:28 +0100
committermrichomme <morgan.richomme@orange.com>2019-12-11 12:00:31 +0100
commit1f997a66f658ff11809f44f4630fc678eb091b83 (patch)
treed29e08adfc2a5d193310d9dfc640175b0cf76fc6 /healthcheck
parent78b4cdd2c5aa084ee6b8cc0f768187be907ae68c (diff)
Move integration xtesting Dockerfile to ONAP
All the Dockerfiles and xtesting configurations were hosted in gitlab.com [1] The goal of this patch is to host these assets in ONAP A jenkins jjb shall be created to generated the docker and push them on the nexus (today the built-in registry of ONAP was used) These xtesting dockers are referencing integration categories [2] and integration use cases [3] These xtesting dockers shall also simplify the way to integrate new use cases in any CI chain (jenkins or gitlab-ci based) [1]: https://gitlab.com/Orange-OpenSource/lfn/onap/integration/xtesting [2]: https://wiki.onap.org/pages/viewpage.action?pageId=71835330 [3]: http://testresults.opnfv.org/onap/api/v1/projects/integration/cases Issue-ID: INT-1366 Signed-off-by: mrichomme <morgan.richomme@orange.com> Change-Id: Iba0fc0b0415731a7a81ba0225a70ae16391dd129 Signed-off-by: mrichomme <morgan.richomme@orange.com>
Diffstat (limited to 'healthcheck')
-rw-r--r--healthcheck/README.md77
-rw-r--r--healthcheck/docker/Dockerfile39
-rw-r--r--healthcheck/docker/testcases.yaml119
-rw-r--r--healthcheck/jobs/healthcheck-job-template.yaml52
-rw-r--r--healthcheck/requirements.txt16
-rwxr-xr-xhealthcheck/scripts/cmd.sh3
6 files changed, 306 insertions, 0 deletions
diff --git a/healthcheck/README.md b/healthcheck/README.md
new file mode 100644
index 0000000..455bcdf
--- /dev/null
+++ b/healthcheck/README.md
@@ -0,0 +1,77 @@
+# Healthcheck
+
+## Goal
+
+This healthcheck docker includes the test suites checking ONAP components.
+
+It includes 4 tests:
+
+* core: robot basic healthcheck of the components AAI, dmaap, portal, SDC, SDNC,
+ SO
+* small: robot basic healthcheck of the components AAI, dmaap, portal, SDC, SDNC,
+ SO, AAF, APPC, CLI, LOG, MSB, Mulicloud, VID
+* medium: robot basic healthcheck of the components AAI, dmaap, portal, SDC, SDNC,
+ SO, AAF, APPC, CLI, LOG, MSB, Mulicloud, VID, CDS, CLAMP, Dcaegen2, OOF,
+ Policy, UUI
+* full: all the components
+* healthdist: test the onboarding and the distribution of the vFW
+
+## Usage
+
+### Configuration
+
+Mandatory:
+
+* The Robot configuration file: this file is setup at ONAP installation in the
+ configmap onap-robot-robot-eteshare-configmap. It includes lots of variables,
+ end points, urls, passwords, logins, needed by the robot scripts.
+ By default most of these data are set at ONAP installation.
+ Please note that some use cases may require additional data. A overide.yaml
+ file shall be created to provide these extra data.
+ As an example the keystone url is set in this config map by default to
+ <http://1.2.3.4:5000>. This can be modified at installation and adapted
+ according to your cloud configuration.
+
+Optional:
+
+* The local result directory path: to store the results in your local
+ environement. It shall corresponds to the internal result docker path
+ /var/lib/xtesting/results
+
+### Command
+
+For the robot use cases, it is recommended to create a kubernetes jobs and run
+the image as a jobs within onap namespace.
+An example of job is provided in the job subdirectory. You need to setup the
+following variables:
+
+* Mandatory:
+ * run_type: the name of the use case: core, small, medium, full, healthdist
+ * onap_namespace: onap name space (usually set to onap)
+* Optional:
+ * deployment_name: parameter for the results pushed into the database (e.g.
+ daily-master)
+ * deploy_scenario: parameter for the results pushed into the database (e.g.
+ rke_istio_baremetal)
+ * node_name: parameter for the results pushed into the database. This
+ parameter must match the pod declaration in the database otherwise the
+ results will not be accepted
+ * test_result_url: the url of the test database
+ * build_tag: parameter for the results pushed into the database. It is used to
+ identify the CI run. It can be used indirectly to retrieve the version
+ * res_local_path: the path where you want to save the result logs on your
+ local machine
+
+By default (in scripts/cmd.sh), the -r option is enabled in the job template.
+It means that xtesting will try to push the results to the DB.
+If the parameters are not set, an error will be displayed (DB not reachable)
+
+### Output
+
+```
++-------------------+------------------+------------------+----------------+
+| TEST CASE | PROJECT | DURATION | RESULT |
++-------------------+------------------+------------------+----------------+
+| core | functest | 00:09 | PASS |
++-------------------+------------------+------------------+----------------+
+```
diff --git a/healthcheck/docker/Dockerfile b/healthcheck/docker/Dockerfile
new file mode 100644
index 0000000..d631129
--- /dev/null
+++ b/healthcheck/docker/Dockerfile
@@ -0,0 +1,39 @@
+FROM opnfv/xtesting
+
+ARG OPENSTACK_TAG=master
+ARG OPNFV_TAG=master
+ARG ONAP_TAG=master
+ARG PIP_TAG=18.0
+
+ENV PYTHONPATH $PYTHONPATH:/src/testing-utils/robotframework-onap/eteutils
+ENV TAG all
+
+COPY requirements.txt requirements.txt
+RUN apk --no-cache add --update openssl && \
+ apk --no-cache add --virtual .build-deps --update \
+ python3-dev build-base linux-headers libffi-dev \
+ openssl-dev libjpeg-turbo-dev && \
+ pip3 install --upgrade pip && \
+ pip3 install --no-cache-dir \
+ git+https://git.onap.org/testsuite/heatbridge.git@$ONAP_TAG#egg=heatbridge\&subdirectory=heatbridge \
+ git+https://git.onap.org/testsuite/python-testing-utils.git@$ONAP_TAG#egg=robotframework-onap\&subdirectory=robotframework-onap && \
+ git clone --depth 1 https://git.onap.org/testsuite -b $ONAP_TAG /var/opt/ONAP && \
+ git clone --depth 1 https://git.onap.org/demo -b $ONAP_TAG /src/demo && \
+ pip install \
+ -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG \
+ pip==$PIP_TAG && \
+ pip install \
+ -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$OPNFV_TAG \
+ -rrequirements.txt && \
+ mkdir -p /var/opt/ONAP/demo/heat && cp -Rf /src/demo/heat/vFW /var/opt/ONAP/demo/heat/ && \
+ mkdir -p /demo/service_mapping && cp -Rf /src/demo/service_mapping /demo/ && \
+ mkdir -p /var/opt/ONAP/demo/preload_data && cp -Rf /src/demo/preload_data /var/opt/ONAP/demo/ && \
+ ln -s /usr/lib/python3.7/site-packages/vcpeutils /usr/lib/python3.7/site-packages/SoUtils && \
+ ln -s /usr/lib/python3.7/site-packages/heatbridge /usr/lib/python3.7/site-packages/HeatBridge && \
+ rm -r requirements.txt /var/opt/ONAP/.git /src/demo && \
+ cd / && ln -s /var/opt/ONAP/robot/ /robot && \
+ apk del .build-deps
+
+COPY docker/testcases.yaml /usr/lib/python3.7/site-packages/xtesting/ci/testcases.yaml
+COPY scripts/cmd.sh /
+CMD ["/cmd.sh"]
diff --git a/healthcheck/docker/testcases.yaml b/healthcheck/docker/testcases.yaml
new file mode 100644
index 0000000..d85cace
--- /dev/null
+++ b/healthcheck/docker/testcases.yaml
@@ -0,0 +1,119 @@
+---
+tiers:
+ -
+ name: healthcheck
+ order: 1
+ ci_loop: '(daily)|(weekly)!(gating)'
+ description: >-
+ Set of basic Functional tests to validate the ONAP installation.
+ testcases:
+ -
+ case_name: core
+ project_name: integration
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case verifies the API of core ONAP components
+ aai, dmap, portal, sdc, sdnc, so, robot
+ run:
+ name: 'robotframework'
+ args:
+ suites:
+ - /var/opt/ONAP/robot/testsuites/health-check.robot
+ include:
+ - core
+ variablefile:
+ - '/share/config/robot_properties.py'
+ -
+ case_name: small
+ project_name: integration
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case verifies the API of the components
+ aai, dmap, portal, sdc, sdnc, so, robot,
+ AAF, APPC, CLI, COnsul, ESR, Log, MSB, Multicloud, NBI, VID
+ run:
+ name: 'robotframework'
+ args:
+ suites:
+ - /var/opt/ONAP/robot/testsuites/health-check.robot
+ include:
+ - core
+ - small
+ variablefile:
+ - '/share/config/robot_properties.py'
+ -
+ case_name: medium
+ project_name: integration
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case verifies the API of the components
+ aai, dmap, portal, sdc, sdnc, so, robot,
+ AAF, APPC, CLI, COnsul, ESR, Log, MSB, Multicloud, NBI, VID,
+ CLAMP, DCAE, OOF, POLICY, UUI, SNIRO
+ run:
+ name: 'robotframework'
+ args:
+ suites:
+ - /var/opt/ONAP/robot/testsuites/health-check.robot
+ include:
+ - core
+ - small
+ - medium
+ variablefile:
+ - '/share/config/robot_properties.py'
+ -
+ case_name: full
+ project_name: integration
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case verifies all the healthcheck Robot tests
+ based on the default robot tests
+ run:
+ name: 'robotframework'
+ args:
+ suites:
+ - /var/opt/ONAP/robot/testsuites/health-check.robot
+ include:
+ - health
+ variablefile:
+ - '/share/config/robot_properties.py'
+ -
+ case_name: postinstall
+ project_name: integration
+ criteria: 100
+ blocking: false
+ description: >-
+ This test runs a set of test to verify some components at
+ the end of the installation: DMAAP Message Router ACL
+ Update Test and AAI Service Design Models Size Test
+ run:
+ name: 'robotframework'
+ args:
+ suites:
+ - /var/opt/ONAP/robot/testsuites/post-install-tests.robot
+ include:
+ - postinstall
+ variablefile:
+ - '/share/config/robot_properties.py'
+ -
+ case_name: healthdist
+ project_name: integration
+ criteria: 100
+ blocking: false
+ description: >-
+ This test case verifies that the vFW model is properly
+ distributed. At the end the csar file shall be downloaded
+ from the sdc
+ run:
+ name: 'robotframework'
+ args:
+ suites:
+ - /var/opt/ONAP/robot/testsuites/health-check.robot
+ include:
+ - healthdist
+ variablefile:
+ - '/share/config/robot_properties.py'
diff --git a/healthcheck/jobs/healthcheck-job-template.yaml b/healthcheck/jobs/healthcheck-job-template.yaml
new file mode 100644
index 0000000..049ec22
--- /dev/null
+++ b/healthcheck/jobs/healthcheck-job-template.yaml
@@ -0,0 +1,52 @@
+---
+tests:
+ - core
+
+healthcheck_deployment:
+ apiVersion: batch/v1
+ kind: Job
+ metadata:
+ name: "functest-onap-{{ run_type }}"
+ namespace: "{{ onap_namespace }}"
+ spec:
+ template:
+ spec:
+ restartPolicy: Never
+ containers:
+ - name: functest-onap
+ image: registry.gitlab.com/orange-opensource/lfn/onap/integration/xtesting/health
+ imagePullPolicy: Always
+ env:
+ - name: INSTALLER_TYPE
+ value: "{{ deployment_name }}"
+ - name: DEPLOY_SCENARIO
+ value: "{{ deploy_scenario }}"
+ - name: NODE_NAME
+ value: "{{ node_name }}"
+ - name: TEST_DB_URL
+ value:
+ "{{ test_result_url }}"
+ - name: BUILD_TAG
+ value: "{{ build_tag }}"
+ - name: TAG
+ value: "{{ run_type }}"
+ volumeMounts:
+ - name: localtime
+ mountPath: /etc/localtime
+ readOnly: true
+ - name: robot-eteshare
+ mountPath: /share/config
+ - name: robot-save-results
+ mountPath:
+ /var/lib/xtesting/results/
+ volumes:
+ - name: localtime
+ hostPath:
+ path: /etc/localtime
+ - name: robot-eteshare
+ configMap:
+ name: "{{ onap_namespace }}-robot-robot-eteshare-configmap"
+ defaultMode: 0755
+ - name: robot-save-results
+ hostPath:
+ path: "{{ res_local_path }}/{{ run_type }}"
diff --git a/healthcheck/requirements.txt b/healthcheck/requirements.txt
new file mode 100644
index 0000000..6c98295
--- /dev/null
+++ b/healthcheck/requirements.txt
@@ -0,0 +1,16 @@
+selenium
+robotframework-seleniumlibrary
+robotframework-archivelibrary
+robotframework-sshlibrary
+robotframework-httplibrary
+robotframework-ftplibrary
+requests>=2.20.0
+robotframework-selenium2library
+robotframework-databaselibrary
+robotframework-extendedselenium2library
+robotframework-requests
+deepdiff
+dnspython
+pyyaml>=4.2b1
+json5
+pytz
diff --git a/healthcheck/scripts/cmd.sh b/healthcheck/scripts/cmd.sh
new file mode 100755
index 0000000..aeeffde
--- /dev/null
+++ b/healthcheck/scripts/cmd.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run_tests -t ${TAG} -r || true