Move integration xtesting Dockerfile to ONAP 85/99385/3
authormrichomme <morgan.richomme@orange.com>
Tue, 10 Dec 2019 07:47:28 +0000 (08:47 +0100)
committermrichomme <morgan.richomme@orange.com>
Wed, 11 Dec 2019 11:00:31 +0000 (12:00 +0100)
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>
41 files changed:
LICENSE [new file with mode: 0644]
README.md [new file with mode: 0644]
benchmarking/README.md [new file with mode: 0644]
benchmarking/docker/Dockerfile [new file with mode: 0644]
benchmarking/docker/testcases.yaml [new file with mode: 0644]
benchmarking/requirements.txt [new file with mode: 0644]
benchmarking/scripts/cmd.sh [new file with mode: 0755]
candidate-usecases/README.md [new file with mode: 0644]
candidate-usecases/docker/Dockerfile [new file with mode: 0644]
candidate-usecases/docker/testcases.yaml [new file with mode: 0644]
healthcheck/README.md [new file with mode: 0644]
healthcheck/docker/Dockerfile [new file with mode: 0644]
healthcheck/docker/testcases.yaml [new file with mode: 0644]
healthcheck/jobs/healthcheck-job-template.yaml [new file with mode: 0644]
healthcheck/requirements.txt [new file with mode: 0644]
healthcheck/scripts/cmd.sh [new file with mode: 0755]
infra-healthcheck/README.md [new file with mode: 0644]
infra-healthcheck/docker/Dockerfile [new file with mode: 0644]
infra-healthcheck/docker/testcases.yaml [new file with mode: 0644]
infra-healthcheck/infra_healthcheck/__init__.py [new file with mode: 0644]
infra-healthcheck/infra_healthcheck/k8stest.py [new file with mode: 0644]
infra-healthcheck/infra_healthcheck/test_k8stest.py [new file with mode: 0644]
infra-healthcheck/requirements.txt [new file with mode: 0644]
infra-healthcheck/scripts/check_onap_helm.sh [new file with mode: 0644]
infra-healthcheck/scripts/check_onap_k8s.sh [new file with mode: 0644]
infra-healthcheck/setup.cfg [new file with mode: 0644]
infra-healthcheck/setup.py [new file with mode: 0644]
infra-healthcheck/tox.ini [new file with mode: 0644]
security/README.md [new file with mode: 0644]
security/docker/Dockerfile [new file with mode: 0644]
security/docker/testcases.yaml [new file with mode: 0644]
security/requirements.txt [new file with mode: 0644]
smoke-usecases-pythonsdk/README.md [new file with mode: 0644]
smoke-usecases-pythonsdk/docker/Dockerfile [new file with mode: 0644]
smoke-usecases-pythonsdk/docker/testcases.yaml [new file with mode: 0644]
smoke-usecases-pythonsdk/requirements.txt [new file with mode: 0644]
smoke-usecases-robot/README.md [new file with mode: 0644]
smoke-usecases-robot/docker/Dockerfile [new file with mode: 0644]
smoke-usecases-robot/docker/testcases.yaml [new file with mode: 0644]
smoke-usecases-robot/requirements.txt [new file with mode: 0644]
smoke-usecases-robot/scripts/cmd.sh [new file with mode: 0755]

diff --git a/LICENSE b/LICENSE
new file mode 100644 (file)
index 0000000..395c3d1
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,207 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+---
+
+All Documentation content that resides under the doc/ directory of this
+repository is licensed under Creative Commons: CC BY-SA 4.0.
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..3d6ddb4
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+# Integration Xtesting
+
+Project used to build ONAP integration xtesting dockers
+This project contains the definition of the integration dockers, their
+associated testcases.
diff --git a/benchmarking/README.md b/benchmarking/README.md
new file mode 100644 (file)
index 0000000..3defbf8
--- /dev/null
@@ -0,0 +1,11 @@
+# Security
+
+## Goal
+
+## Usage
+
+### Configuration
+
+### Command
+
+### Output
diff --git a/benchmarking/docker/Dockerfile b/benchmarking/docker/Dockerfile
new file mode 100644 (file)
index 0000000..1f2d1cf
--- /dev/null
@@ -0,0 +1,33 @@
+FROM opnfv/xtesting
+ARG OPENSTACK_TAG=master
+ARG OPNFV_TAG=master
+ARG ONAP_TAG=master
+ARG PIP_TAG=19.3
+
+ENV PYTHONPATH $PYTHONPATH:/src/testing-utils/robotframework-onap/eteutils
+ENV TAG all
+
+COPY requirements.txt requirements.txt
+RUN apk --no-cache add --virtual .build-deps --update \
+        python3-dev build-base linux-headers libffi-dev \
+        openssl-dev libjpeg-turbo-dev && \
+    git clone --depth 1 https://git.onap.org/testsuite -b $ONAP_TAG /var/opt/ONAP && \
+    git clone --depth 1 https://git.onap.org/testsuite/python-testing-utils -b $ONAP_TAG /src/testing-utils && \
+    git clone --depth 1 https://git.onap.org/demo -b $ONAP_TAG /src/demo && \
+    pip3 install \
+        -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG \
+        pip==$PIP_TAG && \
+    pip3 install \
+        -chttps://git.opnfv.org/functest/plain/upper-constraints.txt?h=$OPNFV_TAG \
+        -rrequirements.txt \
+        -e /src/testing-utils/robotframework-onap && \
+    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/ && \
+    rm -r requirements.txt /src/testing-utils/.git /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.6/site-packages/xtesting/ci/testcases.yaml
+COPY scripts/cmd.sh /
+CMD ["/cmd.sh"]
diff --git a/benchmarking/docker/testcases.yaml b/benchmarking/docker/testcases.yaml
new file mode 100644 (file)
index 0000000..df165e8
--- /dev/null
@@ -0,0 +1,26 @@
+---
+tiers:
+    -
+        name: benchmarking
+        order: 1
+        ci_loop: 'weekly'
+        description: >-
+            Set of basic Functional benchmarking tests.
+        testcases:
+            -
+                case_name: stability72hr
+                project_name: integration
+                criteria: 100
+                blocking: false
+                description: >-
+                    run stability 72h test.
+                run:
+                    name: 'robotframework'
+                    args:
+                        suites:
+                            - /var/opt/ONAP/robot/testsuites/vnf-orchestration.robot
+                        include:
+                            - stability72hr
+                        variablefile:
+                            - '/share/config/robot_properties.py'
+                            - '/share/config/integration_preload_parameters.py'
diff --git a/benchmarking/requirements.txt b/benchmarking/requirements.txt
new file mode 100644 (file)
index 0000000..434e5e3
--- /dev/null
@@ -0,0 +1,14 @@
+selenium
+requests>=2.20.0
+robotframework-selenium2library
+robotframework-databaselibrary
+robotframework-extendedselenium2library
+robotframework-requests
+robotframework-sshlibrary
+robotframework-ftplibrary
+deepdiff
+dnspython
+robotframework-httplibrary
+robotframework-archivelibrary
+pyyaml>=4.2b1
+json5
diff --git a/benchmarking/scripts/cmd.sh b/benchmarking/scripts/cmd.sh
new file mode 100755 (executable)
index 0000000..aeeffde
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run_tests -t ${TAG} -r || true
diff --git a/candidate-usecases/README.md b/candidate-usecases/README.md
new file mode 100644 (file)
index 0000000..7f9e0b7
--- /dev/null
@@ -0,0 +1,26 @@
+# Smoke use cases
+
+## Goal
+
+The goal of this docker is to run End to End use cases on ONAP in order to
+check the solution. The testcases defined in this docker MUST be PASS to
+validate the release.
+The test cases can be run using Robot framework or onap-test (ONAP python SDK).
+Bash, python and unit test drivers also exist. Additionnal drivers can be added
+but the Dockerfile must be adapted accordingly.
+
+The tests are:
+
+* basic_vm: it onboard/distribute/deploy a single Ubuntu VM in ONAP using
+  VNF-API. The components used are SDC, SO, AA&I, SDNC.
+* freeradius_nbi: based on basic_vm, the instantiation part is done through the
+  ONAP external API (NBI) module.
+* clearwater_ims: it consists in a full deployment of an clearwater vIMS in ONAP.
+
+## Usage
+
+### Configuration
+
+### Command
+
+### Output
diff --git a/candidate-usecases/docker/Dockerfile b/candidate-usecases/docker/Dockerfile
new file mode 100644 (file)
index 0000000..ec7acf0
--- /dev/null
@@ -0,0 +1,16 @@
+FROM opnfv/xtesting
+
+MAINTAINER Morgan Richomme <morgan.richomme@orange.com>
+
+ARG ONAP_TESTS_TAG=master
+
+RUN apk add --no-cache python3 git bash && \
+    apk add --no-cache --virtual .build-deps libffi-dev python3-dev \
+        gcc openssl-dev linux-headers musl-dev && \
+    pip3 install --upgrade pip && \
+    pip3 install --no-cache-dir \
+        git+https://gitlab.com/Orange-OpenSource/onap-tests.git@$ONAP_TESTS_TAG#egg=onap_tests && \
+    apk del .build-deps
+
+COPY docker/testcases.yaml /usr/lib/python3.7/site-packages/xtesting/ci/testcases.yaml
+CMD ["run_tests", "-t", "all"]
diff --git a/candidate-usecases/docker/testcases.yaml b/candidate-usecases/docker/testcases.yaml
new file mode 100644 (file)
index 0000000..ee1dcfd
--- /dev/null
@@ -0,0 +1,19 @@
+---
+tiers:
+    -
+        name: candidate-usecases
+        order: 1
+        description: >-
+            ONAP E2E tests
+        testcases:
+            -
+                case_name: 5g_son
+                project_name: integration
+                enabled: true
+                criteria: 100
+                blocking: false
+                description: >-
+                    Test 5G SON use case
+                dependencies:
+                run:
+                    name: 5g_son
diff --git a/healthcheck/README.md b/healthcheck/README.md
new file mode 100644 (file)
index 0000000..455bcdf
--- /dev/null
@@ -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 (file)
index 0000000..d631129
--- /dev/null
@@ -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 (file)
index 0000000..d85cace
--- /dev/null
@@ -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 (file)
index 0000000..049ec22
--- /dev/null
@@ -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 (file)
index 0000000..6c98295
--- /dev/null
@@ -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 (executable)
index 0000000..aeeffde
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run_tests -t ${TAG} -r || true
diff --git a/infra-healthcheck/README.md b/infra-healthcheck/README.md
new file mode 100644 (file)
index 0000000..ba873af
--- /dev/null
@@ -0,0 +1,79 @@
+# infra-healthcheck
+
+## Goal
+
+This infra-healthcheck docker includes the test suites checking kubernetes and
+healm charts of an ONAP deployment.
+
+It includes 2 tests:
+
+* onap-k8s: list pods, deployments, events, cm, ... For any faulty pod, it
+  collects the logs and the describe. The success criteria is 100% of the pods
+  are up&running
+* onap-helm: list the helm charts. The success criteria is all the helm charts
+  are completed.
+
+## Usage
+
+### Configuration
+
+Mandatory:
+
+* The kubernetes configuration: usually hosted on the.kube/config of your
+  jumphost. It corresponds the kubernetes credentials and are needed to perform
+  the different operations. This file shall be copied in /config/.kube/config in
+  the docker.
+
+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
+
+You can run this docker by typing:
+
+```
+docker run -v <the kube config>:/config/.kube/config -v
+<result directory>:/var/lib/xtesting/results
+registry.gitlab.com/orange-opensource/lfn/onap/integration/xtesting:latest
+```
+
+Options:
+
+* -r: by default the reporting to the Database is not enabled. You need to
+  specify the -r option in the command line. Please note that in this case, you
+  must precise some env variables.
+
+environement variables:
+
+* Mandatory:
+  * TEST_DB_URL: the url of the target Database with the env variable .
+  * NODE_NAME: the name of your test environement. It must be declared in the
+    test database (e.g. windriver-SB00)
+* Optionnal
+  * INSTALLER_TYPE: precise how your ONAP has been installed (e.g. kubespray-oom,
+  rke-oom)
+  * BUILD_TAG: a unique tag of your CI system. It can be usefull to get all the
+    tests of one CI run. It uses the regex (dai|week)ly-(.+?)-[0-9]* to find the
+    version (e.g. daily-elalto-123456789).
+
+The command becomes:
+
+```
+docker run -v <the kube config>:/config/.kube/config -v
+<result directory>:/var/lib/xtesting/results registry.gitlab.com/orange-opensour
+ce/lfn/onap/integration/xtesting:latest /bin/bash -c "run_tests -r -t all
+```
+
+### Output
+
+```
++------------+-------------+-------------------+----------+--------+
+| TEST CASE  | PROJECT     | TIER              | DURATION | RESULT |
++------------+-------------+-------------------+----------+--------+
+| onap-k8s   | integration | infra-healthcheck | 00:06    | PASS   |
+| onap-helm  | integration | infra-healthcheck | 00:01    | PASS   |
++------------+-------------+-------------------+----------+--------+
+```
diff --git a/infra-healthcheck/docker/Dockerfile b/infra-healthcheck/docker/Dockerfile
new file mode 100644 (file)
index 0000000..de19a2a
--- /dev/null
@@ -0,0 +1,31 @@
+FROM opnfv/xtesting
+
+ARG KUBERNETES_VERSION="v1.15.2"
+ARG HELM_VERSION="v2.14.1"
+ARG ONAP_TESTS_TAG=master
+
+# Install kubectl
+# Note: Latest version may be found on:
+# https://aur.archlinux.org/packages/kubectl-bin/
+
+ADD https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl /usr/local/bin/kubectl
+
+COPY scripts/check_onap_k8s.sh /check_onap_k8s.sh
+COPY scripts/check_onap_helm.sh /check_onap_helm.sh
+
+RUN set -x && \
+    apk --no-cache add --update curl ca-certificates && \
+    apk --no-cache add --virtual .build-deps --update \
+        gcc python3-dev musl-dev && \
+    chmod +x /usr/local/bin/kubectl && \
+    adduser kubectl -Du 2342 -h /config && \
+    wget https://storage.googleapis.com/kubernetes-helm/helm-${HELM_VERSION}-linux-amd64.tar.gz -O - | tar -xzO linux-amd64/helm > /usr/local/bin/helm && \
+    chmod +x /usr/local/bin/helm && \
+    chmod +x /check_onap_*.sh && \
+    pip3 install --upgrade pip && \
+    pip3 install --no-cache-dir \
+        git+https://gitlab.com/Orange-OpenSource/lfn/onap/integration/xtesting.git@$ONAP_TESTS_TAG#subdirectory=infra-healthcheck && \
+    apk del .build-deps
+
+COPY docker/testcases.yaml /usr/lib/python3.7/site-packages/xtesting/ci/testcases.yaml
+CMD ["run_tests", "-t", "all"]
diff --git a/infra-healthcheck/docker/testcases.yaml b/infra-healthcheck/docker/testcases.yaml
new file mode 100644 (file)
index 0000000..fb30c85
--- /dev/null
@@ -0,0 +1,29 @@
+---
+tiers:
+    -
+        name: infra-healthcheck
+        order: 1
+        ci_loop: '(daily)|(weekly)!(gating)'
+        description: >-
+            Set of basic k8s Functional tests to validate the ONAP installation.
+        testcases:
+            -
+                case_name: onap-k8s
+                project_name: integration
+                criteria: 100
+                blocking: false
+                description: >-
+                    This test case verifies that the ONAP pods are all Running
+                    and shows the pods, deployments, svc and events
+                run:
+                    name: 'onap_k8s'
+            -
+                case_name: onap-helm
+                project_name: integration
+                criteria: 100
+                blocking: false
+                description: >-
+                    This test case verifies that the ONAP charts are in
+                    DEPLOYED status
+                run:
+                    name: 'onap_helm'
diff --git a/infra-healthcheck/infra_healthcheck/__init__.py b/infra-healthcheck/infra_healthcheck/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/infra-healthcheck/infra_healthcheck/k8stest.py b/infra-healthcheck/infra_healthcheck/k8stest.py
new file mode 100644 (file)
index 0000000..8bb7dde
--- /dev/null
@@ -0,0 +1,121 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2018 All rights reserved
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+"""
+Define the parent for Kubernetes testing.
+"""
+
+from __future__ import division
+
+import logging
+import subprocess
+import time
+
+from xtesting.core import testcase
+
+
+class K8sTesting(testcase.TestCase):
+    """Kubernetes test runner"""
+
+    __logger = logging.getLogger(__name__)
+
+    def __init__(self, **kwargs):
+        super(K8sTesting, self).__init__(**kwargs)
+        self.cmd = []
+        self.result = 0
+        self.details = {}
+        self.start_time = 0
+        self.stop_time = 0
+        self.criteria_string = ""
+
+    def run_kubetest(self):  # pylint: disable=too-many-branches
+        """Run the test suites"""
+        cmd_line = self.cmd
+        self.__logger.info("Starting k8s test: '%s'.", cmd_line)
+
+        process = subprocess.Popen(cmd_line, stdout=subprocess.PIPE,
+                                   stderr=subprocess.STDOUT)
+        output = process.stdout.read().decode("utf-8")
+        if ('Error loading client' in output or
+                'Unexpected error' in output):
+            raise Exception(output)
+
+        # create a log file
+        file_name = "/var/lib/xtesting/results/" + self.case_name + ".log"
+        log_file = open(file_name, "w")
+        log_file.write(output)
+        log_file.close()
+
+        remarks = []
+        details = {}
+        lines = output.split('\n')
+        success = False
+
+        for log in lines:
+            if log.startswith(">>>"):
+                remarks.append(log.replace('>', ''))
+        for remark in remarks:
+            if ':' in remark:
+                # 2 possible Results
+                # * numeric nb pods, failed, duration
+                # * list of pods, charts,...
+                if '[' in remark:
+                    # it is a list
+                    str1 = remark.split(":", 1)[1].strip().replace(
+                        ']', '').replace('[', '')
+                    details[remark.split(":", 1)[0].strip()] = str1.split(",")
+                else:
+                    details[remark.split(":", 1)[0].strip()] = int(
+                        remark.split(":", 1)[1].strip())
+
+        # if 1 pod/helm chart if Failed, the testcase is failed
+        if int(details[self.criteria_string]) < 1:
+            success = True
+
+        self.details = details
+        self.__logger.info("details: %s", details)
+
+        if success:
+            self.result = 100
+        else:
+            self.result = 0
+
+    def run(self, **kwargs):
+
+        self.start_time = time.time()
+        try:
+            self.run_kubetest()
+            res = self.EX_OK
+        except Exception:  # pylint: disable=broad-except
+            self.__logger.exception("Error with running kubetest:")
+            res = self.EX_RUN_ERROR
+
+        self.stop_time = time.time()
+        return res
+
+
+class OnapK8sTest(K8sTesting):
+    """Kubernetes smoke test suite"""
+    def __init__(self, **kwargs):
+        if "case_name" not in kwargs:
+            kwargs.get("case_name", 'onap-k8s')
+        super(OnapK8sTest, self).__init__(**kwargs)
+        self.cmd = ['/check_onap_k8s.sh']
+        self.criteria_string = "Nb Failed Pods"
+
+
+class OnapHelmTest(K8sTesting):
+    """Kubernetes conformance test suite"""
+    def __init__(self, **kwargs):
+        if "case_name" not in kwargs:
+            kwargs.get("case_name", 'onap-helm')
+        super(OnapHelmTest, self).__init__(**kwargs)
+        self.cmd = ['/check_onap_helm.sh']
+        self.criteria_string = "Nb Failed Helm Charts"
diff --git a/infra-healthcheck/infra_healthcheck/test_k8stest.py b/infra-healthcheck/infra_healthcheck/test_k8stest.py
new file mode 100644 (file)
index 0000000..4e91279
--- /dev/null
@@ -0,0 +1,41 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2018 All rights reserved
+# This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+
+"""Define the classes required to fully cover k8s."""
+
+import logging
+import os
+import unittest
+
+
+from infra_healthcheck import k8stest
+
+
+class K8sTests(unittest.TestCase):
+
+    # pylint: disable=missing-docstring
+
+    def setUp(self):
+        os.environ["DEPLOY_SCENARIO"] = "k8-test"
+        os.environ["KUBE_MASTER_IP"] = "127.0.0.1"
+        os.environ["KUBE_MASTER_URL"] = "https://127.0.0.1:6443"
+        os.environ["KUBERNETES_PROVIDER"] = "local"
+
+        self.k8stesting = k8stest.K8sTesting()
+
+    def test_run_kubetest_cmd_none(self):
+        self.k8stesting.cmd = None
+        with self.assertRaises(TypeError):
+            self.k8stesting.run_kubetest()
+
+
+if __name__ == "__main__":
+    logging.disable(logging.CRITICAL)
+    unittest.main(verbosity=2)
diff --git a/infra-healthcheck/requirements.txt b/infra-healthcheck/requirements.txt
new file mode 100644 (file)
index 0000000..aed40a6
--- /dev/null
@@ -0,0 +1,11 @@
+# The order of packages is significant, because pip processes them in the order
+# of appearance. Changing the order has an impact on the overall integration
+# process, which may cause wedges in the gate later.
+coverage!=4.4 # Apache-2.0
+mock # BSD
+nose # LGPL
+flake8>=2.5.4 # MIT
+pylint>=2.1 # GPLv2
+yamllint
+bashate # Apache-2.0
+xtesting
diff --git a/infra-healthcheck/scripts/check_onap_helm.sh b/infra-healthcheck/scripts/check_onap_helm.sh
new file mode 100644 (file)
index 0000000..27f8094
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+echo "------------------------------------------------------------------------"
+echo "-------------------  ONAP Check helm charts ----------------------------"
+echo "------------------------------------------------------------------------"
+code=0
+nb_charts=$(helm ls |awk {'print $1'}|grep -v NAME |wc -l)
+nb_failed_charts=0
+list_failed_charts="[$(helm ls |grep -v DEPLOYED |grep -v NAME |awk '{print $1}')]"
+nice_list=$(echo $list_failed_charts |sed  -e "s/ /,/g")
+
+# List Helm chart and get their status
+for i in $(helm ls |awk {'print $1'}|grep -v NAME);do
+    echo "Chart $i"
+    status=$(helm status $i |grep STATUS:)
+    echo ${status}
+    if [ "${status}" != "STATUS: DEPLOYED" ]; then
+        echo "Chart problem"
+        helm status $i -o yaml
+        code=1
+        let "nb_failed_charts++"
+    fi
+    echo "--------------------------------------------------------------------"
+done
+
+echo "------------------------------------------------"
+echo "------- ONAP Helm tests ------------------------"
+echo "------------------------------------------------"
+echo ">>> Nb Helm Charts: ${nb_charts}"
+echo ">>> Nb Failed Helm Charts: ${nb_failed_charts}"
+echo ">>> List of Failed Helm Charts: ${nice_list}"
+echo "------------------------------------------------"
+echo "------------------------------------------------"
+echo "------------------------------------------------"
+
+exit $code
diff --git a/infra-healthcheck/scripts/check_onap_k8s.sh b/infra-healthcheck/scripts/check_onap_k8s.sh
new file mode 100644 (file)
index 0000000..2dffd7e
--- /dev/null
@@ -0,0 +1,108 @@
+#!/bin/bash
+
+echo "------------------------------------------------------------------------"
+echo "--------------------  ONAP Check kubernetes ----------------------------"
+echo "------------------------------------------------------------------------"
+
+code=0
+
+# get the pod list
+echo "List of ONAP pods"
+echo "*****************"
+kubectl get pods -n onap
+
+# show deployments
+echo "Show ONAP kubernetes deployments"
+echo "********************************"
+kubectl get deployments -n onap
+echo "------------------------------------------------------------------------"
+
+# show SVC
+echo "Show ONAP kubernetes SVC"
+echo "************************"
+kubectl get svc -n onap
+echo "------------------------------------------------------------------------"
+
+# show ONAP events
+echo "Show ONAP kubernetes events"
+echo "***************************"
+kubectl get events -n onap
+echo "------------------------------------------------------------------------"
+
+# show ONAP config maps
+echo "Show ONAP kubernetes config maps"
+echo "***************************"
+kubectl get cm -n onap
+echo "------------------------------------------------------------------------"
+
+# show ONAP jobs
+echo "Show ONAP kubernetes jobs"
+echo "***************************"
+kubectl get jobs -n onap
+echo "------------------------------------------------------------------------"
+
+# show ONAP statefulsets
+echo "Show ONAP kubernetes statefulset"
+echo "***************************"
+kubectl get sts -n onap
+echo "------------------------------------------------------------------------"
+
+# if all pods in RUNNING state exit 0, else exit 1
+nb_pods=$((`kubectl get pods -n onap | grep Running | grep -v functest | wc -l` -1))
+list_failed_pods=$(kubectl get pods -n onap |grep -v Running |grep -v functest |grep -v NAME | grep -v Completed | awk '{print $1}')
+list_filtered_failed_pods=()
+
+for i in $list_failed_pods;do
+    status=$(kubectl get pods -n onap $i | grep -v NAME | awk '{print $3'})
+         # in case of Error or Init:Error
+    # we check that another instance is not already Completed or Running
+    if [ $status = "Error" ]  || [ $status = "Init:Error" ];then
+        echo "$i in Status Error or Init Error found for the pods, is is really true...."
+        # By default pod naming is similar, keep only the root to check
+        root_name=${i::-6}
+        kubectl get pods -n onap | grep $root_name | grep Completed
+        if [ $? ];then
+            echo "Instance Completed found."
+        else
+            echo "No Completed instance found."
+            list_filtered_failed_pods+=$i,
+        fi
+    else
+        # Other status are not running/not completed pods
+        list_filtered_failed_pods+=$i,
+    fi
+done
+
+nice_list=${list_filtered_failed_pods::-1}
+
+IFS=,
+nb_pods_not_running=$(echo "$list_filtered_failed_pods" | tr -cd , | wc -c)
+
+if [ $nb_pods_not_running -ne 0 ]; then
+echo "$nb_pods_not_running pods (on $nb_pods) are not in Running state"
+echo "---------------------------------------------------------------------"
+    kubectl get pods -n onap | grep -v Running | grep -v functest | grep -v Completed
+    echo "--------------------------------------------------------------------"
+    echo "Describe non running pods"
+    echo "*************************"
+    for i in $nice_list;do
+        echo "****************************************************************"
+        kubectl describe pod $i -n onap
+        kubectl logs --all-containers=true -n onap $i
+    done
+    code=1
+else
+    echo "all pods ($nb_pods) are running well"
+fi
+
+echo "------------------------------------------------"
+echo "------- ONAP kubernetes tests ------------------"
+echo "------------------------------------------------"
+echo ">>> Nb Pods: $nb_pods"
+echo ">>> Nb Failed Pods: $nb_pods_not_running"
+echo ">>> List of Failed Pods: [$nice_list]"
+echo "------------------------------------------------"
+echo "------------------------------------------------"
+echo "------------------------------------------------"
+
+exit $code
diff --git a/infra-healthcheck/setup.cfg b/infra-healthcheck/setup.cfg
new file mode 100644 (file)
index 0000000..2cccb82
--- /dev/null
@@ -0,0 +1,11 @@
+[metadata]
+name = infra_healthcheck
+version = 1
+
+[files]
+packages = infra_healthcheck
+
+[entry_points]
+xtesting.testcase =
+    onap_k8s = infra_healthcheck.k8stest:OnapK8sTest
+    onap_helm = infra_healthcheck.k8stest:OnapHelmTest
diff --git a/infra-healthcheck/setup.py b/infra-healthcheck/setup.py
new file mode 100644 (file)
index 0000000..566d844
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
+import setuptools
+
+# In python < 2.7.4, a lazy loading of package `pbr` will break
+# setuptools if some other modules registered functions in `atexit`.
+# solution from: http://bugs.python.org/issue15881#msg170215
+try:
+    import multiprocessing  # noqa
+except ImportError:
+    pass
+
+setuptools.setup(
+    setup_requires=['pbr>=2.0.0'],
+    pbr=True)
diff --git a/infra-healthcheck/tox.ini b/infra-healthcheck/tox.ini
new file mode 100644 (file)
index 0000000..0bd2e5a
--- /dev/null
@@ -0,0 +1,49 @@
+[tox]
+envlist = pylint,yamllint,bashate,py3
+
+[testenv]
+usedevelop = True
+deps =
+  -chttps://git.opnfv.org/functest/plain/upper-constraints.txt
+  -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=master}
+  -r{toxinidir}/requirements.txt
+install_command = pip install {opts} {packages}
+
+[testenv:pep8]
+basepython = python3
+commands = flake8
+
+[testenv:pylint]
+basepython = python3
+whitelist_externals = pylint
+modules =
+  infra_healthcheck
+commands =
+  pylint --disable=locally-disabled --reports=n {[testenv:pylint]modules}
+
+[testenv:yamllint]
+whitelist_externals = yamllint
+basepython = python3
+files =
+  docker
+commands =
+  yamllint {[testenv:yamllint]files}
+
+[testenv:py3]
+whitelist_externals = nosetests
+basepython = python3
+commands = nosetests --with-xunit \
+  --with-coverage \
+  --cover-tests \
+  --cover-package=infra_healthcheck \
+  --cover-xml \
+  --cover-html \
+  infra_healthcheck
+
+[testenv:bashate]
+whitelist_externals = bashate
+basepython = python3
+files =
+  scripts/check_onap_k8s.sh
+  scripts/check_onap_helm.sh
+commands = bashate {[testenv:bashate]files} -i E006
diff --git a/security/README.md b/security/README.md
new file mode 100644 (file)
index 0000000..3defbf8
--- /dev/null
@@ -0,0 +1,11 @@
+# Security
+
+## Goal
+
+## Usage
+
+### Configuration
+
+### Command
+
+### Output
diff --git a/security/docker/Dockerfile b/security/docker/Dockerfile
new file mode 100644 (file)
index 0000000..fe7997b
--- /dev/null
@@ -0,0 +1,12 @@
+FROM opnfv/xtesting
+
+ARG ONAP_TAG=master
+ARG PIP_TAG=18.0
+
+COPY requirements.txt requirements.txt
+RUN apk --no-cache add --virtual .build-deps --update \
+        openssl-dev libjpeg-turbo-dev && \
+    apk del .build-deps
+
+COPY docker/testcases.yaml /usr/lib/python3.7/site-packages/xtesting/ci/testcases.yaml
+CMD ["run_test -t all -r"]
diff --git a/security/docker/testcases.yaml b/security/docker/testcases.yaml
new file mode 100644 (file)
index 0000000..ed281f2
--- /dev/null
@@ -0,0 +1,18 @@
+---
+tiers:
+    -
+        name: security
+        order: 1
+        ci_loop: '(daily)|(weekly)'
+        description: >-
+            Set of basic Functional security tests.
+        testcases:
+            -
+                case_name: osji
+                project_name: integration
+                criteria: 100
+                blocking: false
+                description: >-
+                    run osji scan.
+                run:
+                    name: 'onap_osji'
diff --git a/security/requirements.txt b/security/requirements.txt
new file mode 100644 (file)
index 0000000..b2c729c
--- /dev/null
@@ -0,0 +1 @@
+yamllint
diff --git a/smoke-usecases-pythonsdk/README.md b/smoke-usecases-pythonsdk/README.md
new file mode 100644 (file)
index 0000000..7f9e0b7
--- /dev/null
@@ -0,0 +1,26 @@
+# Smoke use cases
+
+## Goal
+
+The goal of this docker is to run End to End use cases on ONAP in order to
+check the solution. The testcases defined in this docker MUST be PASS to
+validate the release.
+The test cases can be run using Robot framework or onap-test (ONAP python SDK).
+Bash, python and unit test drivers also exist. Additionnal drivers can be added
+but the Dockerfile must be adapted accordingly.
+
+The tests are:
+
+* basic_vm: it onboard/distribute/deploy a single Ubuntu VM in ONAP using
+  VNF-API. The components used are SDC, SO, AA&I, SDNC.
+* freeradius_nbi: based on basic_vm, the instantiation part is done through the
+  ONAP external API (NBI) module.
+* clearwater_ims: it consists in a full deployment of an clearwater vIMS in ONAP.
+
+## Usage
+
+### Configuration
+
+### Command
+
+### Output
diff --git a/smoke-usecases-pythonsdk/docker/Dockerfile b/smoke-usecases-pythonsdk/docker/Dockerfile
new file mode 100644 (file)
index 0000000..ec7acf0
--- /dev/null
@@ -0,0 +1,16 @@
+FROM opnfv/xtesting
+
+MAINTAINER Morgan Richomme <morgan.richomme@orange.com>
+
+ARG ONAP_TESTS_TAG=master
+
+RUN apk add --no-cache python3 git bash && \
+    apk add --no-cache --virtual .build-deps libffi-dev python3-dev \
+        gcc openssl-dev linux-headers musl-dev && \
+    pip3 install --upgrade pip && \
+    pip3 install --no-cache-dir \
+        git+https://gitlab.com/Orange-OpenSource/onap-tests.git@$ONAP_TESTS_TAG#egg=onap_tests && \
+    apk del .build-deps
+
+COPY docker/testcases.yaml /usr/lib/python3.7/site-packages/xtesting/ci/testcases.yaml
+CMD ["run_tests", "-t", "all"]
diff --git a/smoke-usecases-pythonsdk/docker/testcases.yaml b/smoke-usecases-pythonsdk/docker/testcases.yaml
new file mode 100644 (file)
index 0000000..d492c53
--- /dev/null
@@ -0,0 +1,42 @@
+---
+tiers:
+    -
+        name: smoke-usecases
+        order: 1
+        description: >-
+            ONAP E2E tests
+        testcases:
+            -
+                case_name: basic_vm
+                project_name: integration
+                enabled: true
+                criteria: 100
+                blocking: false
+                description: >-
+                    Onboard and instantiate a simple ubuntu16.04 VM VNF
+                dependencies:
+                run:
+                    name: basic_vm
+            -
+                case_name: freeradius_nbi
+                project_name: integration
+                enabled: true
+                criteria: 100
+                blocking: true
+                description: >-
+                    Onboard and instantiate a simple freeradius VM VNF
+                    through NBI
+                dependencies:
+                run:
+                    name: freeradius_nbi
+            -
+                case_name: clearwater_ims
+                project_name: integration
+                enabled: true
+                criteria: 100
+                blocking: false
+                description: >-
+                    Onboard and instantiate a clearwater IMS VNF
+                dependencies:
+                run:
+                    name: clearwater_ims
diff --git a/smoke-usecases-pythonsdk/requirements.txt b/smoke-usecases-pythonsdk/requirements.txt
new file mode 100644 (file)
index 0000000..c14cf0d
--- /dev/null
@@ -0,0 +1,10 @@
+# The order of packages is significant, because pip processes them in the order
+# of appearance. Changing the order has an impact on the overall integration
+# process, which may cause wedges in the gate later.
+requests[socks]
+urllib3<=1.24.1
+pyyaml
+xtesting
+oyaml
+openstacksdk
+simplejson
diff --git a/smoke-usecases-robot/README.md b/smoke-usecases-robot/README.md
new file mode 100644 (file)
index 0000000..9578084
--- /dev/null
@@ -0,0 +1,16 @@
+# Smoke use cases
+
+## Goal
+
+The tests are:
+
+* pnf_registrate
+* vfw_cl
+
+## Usage
+
+### Configuration
+
+### Command
+
+### Output
diff --git a/smoke-usecases-robot/docker/Dockerfile b/smoke-usecases-robot/docker/Dockerfile
new file mode 100644 (file)
index 0000000..d470cf1
--- /dev/null
@@ -0,0 +1,39 @@
+FROM opnfv/xtesting
+
+MAINTAINER Morgan Richomme <morgan.richomme@orange.com>
+
+ARG OPENSTACK_TAG=master
+ARG OPNFV_TAG=master
+ARG ONAP_TAG=master
+ARG PIP_TAG=19.3
+
+ENV TAG all
+
+COPY requirements.txt requirements.txt
+RUN 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/smoke-usecases-robot/docker/testcases.yaml b/smoke-usecases-robot/docker/testcases.yaml
new file mode 100644 (file)
index 0000000..969c9b7
--- /dev/null
@@ -0,0 +1,44 @@
+---
+tiers:
+    -
+        name: smoke-usecases
+        order: 1
+        description: >-
+            ONAP E2E tests
+        testcases:
+            -
+                case_name: pnf-registrate
+                project_name: integration
+                enabled: true
+                criteria: 100
+                blocking: true
+                description: >-
+                    Registrate PNF
+                dependencies:
+                run:
+                    name: 'robotframework'
+                    args:
+                        suites:
+                            - /var/opt/ONAP/robot/testsuites/pnf-registration.robot
+                        include:
+                            - pnf_registrate
+                        variablefile:
+                            - '/share/config/robot_properties.py'
+            -
+                case_name: vfw-cl
+                project_name: integration
+                enabled: true
+                criteria: 100
+                blocking: true
+                description: >-
+                    vFW closed loop use case
+                dependencies:
+                run:
+                    name: 'robotframework'
+                    args:
+                        suites:
+                            - /var/opt/ONAP/robot/testsuites/vfwcl.robot
+                        include:
+                            - vfwc
+                        variablefile:
+                            - '/share/config/robot_properties.py'
diff --git a/smoke-usecases-robot/requirements.txt b/smoke-usecases-robot/requirements.txt
new file mode 100644 (file)
index 0000000..34e61d8
--- /dev/null
@@ -0,0 +1,15 @@
+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
diff --git a/smoke-usecases-robot/scripts/cmd.sh b/smoke-usecases-robot/scripts/cmd.sh
new file mode 100755 (executable)
index 0000000..aeeffde
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+run_tests -t ${TAG} -r || true