From e9d76d6a00131ee0b1e445074f19a30ab0a330e4 Mon Sep 17 00:00:00 2001 From: Michal Jagiello Date: Thu, 11 May 2023 14:32:52 +0000 Subject: [INFRA] Add integration script to run onap-k8s test Next to Orange use ONAP script to run that test Refactor docker image build to not clone that repo Issue-ID: INT-2226 Signed-off-by: Michal Jagiello Change-Id: If321945c3ce3bca0f66256ba2d05243759817493 --- infra-healthcheck/.dockerignore | 3 +++ infra-healthcheck/docker/Dockerfile | 10 ++++++---- infra-healthcheck/docker/testcases.yaml | 12 ++++++++++++ infra-healthcheck/requirements.txt | 1 - infra-healthcheck/setup.cfg | 15 --------------- infra-healthcheck/setup.py | 20 ++++++++++++++------ infra-healthcheck/upper-constraints.txt | 1 - 7 files changed, 35 insertions(+), 27 deletions(-) create mode 100644 infra-healthcheck/.dockerignore delete mode 100644 infra-healthcheck/setup.cfg diff --git a/infra-healthcheck/.dockerignore b/infra-healthcheck/.dockerignore new file mode 100644 index 0000000..a05272f --- /dev/null +++ b/infra-healthcheck/.dockerignore @@ -0,0 +1,3 @@ +README.md +tox.ini +docker/Dockerfile \ No newline at end of file diff --git a/infra-healthcheck/docker/Dockerfile b/infra-healthcheck/docker/Dockerfile index 24fa61d..9cab01d 100644 --- a/infra-healthcheck/docker/Dockerfile +++ b/infra-healthcheck/docker/Dockerfile @@ -14,7 +14,8 @@ ENV CRYPTOGRAPHY_DONT_BUILD_RUST=1 ADD https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl /usr/local/bin/kubectl -COPY upper-constraints.txt . +# COPY upper-constraints.txt . +COPY . . RUN set -x && \ apk --no-cache add --update curl ca-certificates && \ @@ -29,11 +30,12 @@ RUN set -x && \ chmod +x /usr/local/bin/helm3 && \ rm -rf /usr/lib/python3.8/site-packages/PyYAML* && \ pip3 install --upgrade pip && \ - pip3 install --no-cache-dir -r upper-constraints.txt && \ - pip3 install --no-cache-dir \ - git+https://git.onap.org/integration/xtesting.git@$ONAP_TESTS_TAG#subdirectory=infra-healthcheck && \ + pip3 install --no-cache-dir -r requirements.txt -c upper-constraints.txt && \ + pip3 install --no-cache-dir -e . && \ pip3 install --no-cache-dir \ git+https://git.onap.org/integration.git@$ONAP_TESTS_TAG#subdirectory=test/security/check_certificates && \ + pip3 install --ignore-installed --no-cache-dir \ + git+https://git.onap.org/testsuite/pythonsdk-tests.git@$ONAP_TESTS_TAG && \ apk del .build-deps COPY docker/testcases.yaml /usr/lib/python3.8/site-packages/xtesting/ci/testcases.yaml diff --git a/infra-healthcheck/docker/testcases.yaml b/infra-healthcheck/docker/testcases.yaml index 0cd8fe8..010bc95 100644 --- a/infra-healthcheck/docker/testcases.yaml +++ b/infra-healthcheck/docker/testcases.yaml @@ -17,6 +17,18 @@ tiers: and shows the pods, deployments, svc and events run: name: 'onap_k8s' + - + case_name: status + 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. + New version of onap-k8s test (which is deprecated and will + be removed) + run: + name: 'status' - case_name: onap-helm project_name: integration diff --git a/infra-healthcheck/requirements.txt b/infra-healthcheck/requirements.txt index 1918e10..58171bc 100644 --- a/infra-healthcheck/requirements.txt +++ b/infra-healthcheck/requirements.txt @@ -11,6 +11,5 @@ bashate # Apache-2.0 xtesting kubernetes # Apache-2.0 colorama # BSD -kubernetes_status helm_onap_status chart_status \ No newline at end of file diff --git a/infra-healthcheck/setup.cfg b/infra-healthcheck/setup.cfg deleted file mode 100644 index 4eb4770..0000000 --- a/infra-healthcheck/setup.cfg +++ /dev/null @@ -1,15 +0,0 @@ -[metadata] -name = infra_healthcheck -version = 1 - -[files] -packages = infra_healthcheck - -[entry_points] -xtesting.testcase = - onap_k8s = kubernetes_status.status:Status - onap_helm = helm_onap_status.status:Status - onap_chart = chart_status.status:Status - nodeport_ingress = infra_healthcheck.k8stest:OnapSecurityNodePortsIngress - nodeport_check_certs = infra_healthcheck.k8stest:OnapSecurityNodePortsCerts - internal_check_certs = infra_healthcheck.k8stest:OnapSecurityInternalPortsCerts diff --git a/infra-healthcheck/setup.py b/infra-healthcheck/setup.py index 566d844..ee1ecad 100644 --- a/infra-healthcheck/setup.py +++ b/infra-healthcheck/setup.py @@ -19,11 +19,19 @@ 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) + name="infra_healthcheck", + version="1", + packages=["infra_healthcheck"], + entry_points={ + "xtesting.testcase": [ + 'onap_helm = helm_onap_status.status:Status', + 'onap_chart = chart_status.status:Status', + 'nodeport_ingress = infra_healthcheck.k8stest:OnapSecurityNodePortsIngress', + 'nodeport_check_certs = infra_healthcheck.k8stest:OnapSecurityNodePortsCerts', + 'internal_check_certs = infra_healthcheck.k8stest:OnapSecurityInternalPortsCerts' + ] + } +) diff --git a/infra-healthcheck/upper-constraints.txt b/infra-healthcheck/upper-constraints.txt index 62176f9..20fdc2e 100644 --- a/infra-healthcheck/upper-constraints.txt +++ b/infra-healthcheck/upper-constraints.txt @@ -1,3 +1,2 @@ -git+https://gitlab.com/Orange-OpenSource/lfn/tools/kubernetes-status.git#egg=kubernetes_status git+https://gitlab.com/Orange-OpenSource/lfn/tools/helm-onap-status.git#egg=helm_onap_status git+https://gitlab.com/Orange-OpenSource/lfn/tools/chart-status.git#egg=chart_status -- cgit 1.2.3-korg