jobs:
build:
docker:
- - image: circleci/python:3.8
+ - image: circleci/python:3.9
steps:
- checkout
- run:
- repo: _
dport:
container: alpine
- tag: 3.13
+ tag: 3.14
steps:
- name: build opnfv/functest-kubernetes-core
containers:
[ ! -z "${amd64_dirs}" ] &&
(docker rmi \
"${repo}/functest-kubernetes-core:amd64-latest" \
- alpine:3.13 || true)
+ alpine:3.14 || true)
find . -name Dockerfile -exec git checkout {} +
find . -name Dockerfile -exec sed -i \
- -e "s|alpine:3.13|arm64v8/alpine:3.13|g" {} +
+ -e "s|alpine:3.14|arm64v8/alpine:3.14|g" {} +
find . -name Dockerfile -exec sed -i \
-e "s|opnfv/functest-kubernetes-core|\
${repo}/functest-kubernetes-core:arm64-latest|g" {} +
done
[ ! -z "${arm64_dirs}" ] &&
(docker rmi "${repo}/functest-kubernetes-core:arm64-latest" \
- arm64v8/alpine:3.13 || true)
+ arm64v8/alpine:3.14 || true)
find . -name Dockerfile -exec git checkout {} +
find . -name Dockerfile -exec sed -i \
- -e "s|alpine:3.13|arm32v7/alpine:3.13|g" {} +
+ -e "s|alpine:3.14|arm32v7/alpine:3.14|g" {} +
find . -name Dockerfile -exec sed -i \
-e "s|opnfv/functest-kubernetes-core|\
${repo}/functest-kubernetes-core:arm-latest|g" {} +
done
[ ! -z "${arm_dirs}" ] &&
(docker rmi "${repo}/functest-kubernetes-core:arm-latest" \
- arm32v7/alpine:3.13 || true)
+ arm32v7/alpine:3.14 || true)
find . -name Dockerfile -exec git checkout {} +
exit $?
mv plotperf.py plotperf && chmod a+x plotperf) && \
rm -rf perf-tests /tmp/plotperf.py.patch && \
apk del .build-deps
-COPY testcases.yaml /usr/lib/python3.8/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.9/site-packages/xtesting/ci/testcases.yaml
CMD ["run_tests", "-t", "all"]
ln -s /src/cnf-testsuite/points-all.yml /src/cnf-testsuite/points.yml && \
helm repo add stable https://cncf.gitlab.io/stable && \
rm -rf /src/cnf-testsuite-$CNF_TESTSUITE_TAG.tar.gz /src/cnf-testsuite/.git ;; esac
-COPY testcases.yaml /usr/lib/python3.8/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.9/site-packages/xtesting/ci/testcases.yaml
CMD ["run_tests", "-t", "all"]
-FROM alpine:3.13
+FROM alpine:3.14
ARG BRANCH=master
ARG OPENSTACK_TAG=master
apk add --no-cache py3-pynacl ;; esac && \
sed -i -E /^six=/d /src/requirements/upper-constraints.txt && \
sed -i -E /^distlib=/d /src/requirements/upper-constraints.txt && \
+ sed -i -E /^packaging=/d /src/requirements/upper-constraints.txt && \
apk --no-cache add --update py3-distlib\>=0.3.1 \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/main && \
git init /src/functest-kubernetes && \
mkdir -p /var/lib/rally/database && rally db create && \
rm -r /src/requirements/.git /tmp/Try-a-quick-fix-vs-asynchronuous-issues.patch && \
apk del .build-deps
-COPY logging.ini /usr/lib/python3.8/site-packages/xtesting/ci/logging.ini
-COPY logging.debug.ini /usr/lib/python3.8/site-packages/xtesting/ci/logging.debug.ini
+COPY logging.ini /usr/lib/python3.9/site-packages/xtesting/ci/logging.ini
+COPY logging.debug.ini /usr/lib/python3.9/site-packages/xtesting/ci/logging.debug.ini
CMD ["run_tests", "-t", "all"]
mv /src/kubernetes/test/bin/e2e.test /src/kubernetes/test/bin/ginkgo /usr/local/bin/ && \
chmod +x /usr/local/bin/kubectl /usr/local/bin/e2e.test /usr/local/bin/ginkgo && \
rm -r /src/kubernetes /src/kubernetes-test-linux-$arch.tar.gz
-COPY testcases.yaml /usr/lib/python3.8/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.9/site-packages/xtesting/ci/testcases.yaml
CMD ["run_tests", "-t", "all"]
FROM opnfv/functest-kubernetes-core
-COPY testcases.yaml /usr/lib/python3.8/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.9/site-packages/xtesting/ci/testcases.yaml
FROM opnfv/functest-kubernetes-healthcheck
-COPY testcases.yaml /usr/lib/python3.8/site-packages/xtesting/ci/testcases.yaml
+COPY testcases.yaml /usr/lib/python3.9/site-packages/xtesting/ci/testcases.yaml
CMD ["run_tests", "-t", "all"]
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
- super(CNFConformance, self).__init__(**kwargs)
+ super().__init__(**kwargs)
self.output_log_name = 'functest-kubernetes.log'
self.output_debug_log_name = 'functest-kubernetes.debug.log'
import abc
import logging
import os
-import time
-import subprocess
import re
+import subprocess
+import time
import yaml
from jinja2 import Template
from kubernetes import config
from kubernetes import watch
import pkg_resources
-
from xtesting.core import testcase
"homestead", "homestead-prov", "ralf", "sprout"]
def __init__(self, **kwargs):
- super(Vims, self).__init__(**kwargs)
+ super().__init__(**kwargs)
config.load_kube_config()
self.corev1 = client.CoreV1Api()
self.appsv1 = client.AppsV1Api()
"delete_namespaced_service: %s", api_response)
except client.rest.ApiException:
pass
- super(K8sVims, self).clean()
+ super().clean()
class HelmVims(Vims):
cmd = ["helm", "uninstall", "clearwater", "-n", self.namespace]
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT)
self.__logger.debug(output.decode("utf-8"))
- super(HelmVims, self).clean()
+ super().clean()
k8s_gcr_repo = os.getenv("MIRROR_REPO", "k8s.gcr.io")
def __init__(self, **kwargs):
- super(E2ETesting, self).__init__(**kwargs)
+ super().__init__(**kwargs)
self.cmd = []
self.dir_results = "/home/opnfv/functest/results"
self.res_dir = os.path.join(self.dir_results, self.case_name)
self.__logger.info("Starting k8s test: '%s'.", cmd_line)
env = os.environ.copy()
env["KUBE_TEST_REPO_LIST"] = "{}/repositories.yml".format(self.res_dir)
- process = subprocess.Popen(cmd_line, stdout=subprocess.PIPE,
- stderr=subprocess.STDOUT, env=env)
- boutput = process.stdout.read()
+ with subprocess.Popen(
+ cmd_line, stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT, env=env) as process:
+ boutput = process.stdout.read()
with open(os.path.join(self.res_dir, 'e2e.log'), 'wb') as foutput:
foutput.write(boutput)
grp = re.search(
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
- super(Netperf, self).__init__(**kwargs)
+ super().__init__(**kwargs)
self.output_log_name = 'functest-kubernetes.log'
self.output_debug_log_name = 'functest-kubernetes.debug.log'
k8s_gcr_repo = os.getenv("MIRROR_REPO", "k8s.gcr.io")
def __init__(self, **kwargs):
- super(RallyKubernetes, self).__init__(**kwargs)
+ super().__init__(**kwargs)
self.dir_results = "/home/opnfv/functest/results"
self.res_dir = os.path.join(self.dir_results, self.case_name)
self.output_log_name = 'functest-kubernetes.log'
from kubernetes import watch
import pkg_resources
import prettytable
+
from xtesting.core import testcase
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
- super(SecurityTesting, self).__init__(**kwargs)
+ super().__init__(**kwargs)
config.load_kube_config()
self.corev1 = client.CoreV1Api()
self.batchv1 = client.BatchV1Api()
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
- super(KubeHunter, self).__init__(**kwargs)
+ super().__init__(**kwargs)
self.job_name = "kube-hunter"
self.ns_generate_name = "kube-hunter-"
self.__logger.info("\n\n%s\n", msg.get_string())
def run(self, **kwargs):
- super(KubeHunter, self).run(**kwargs)
+ super().run(**kwargs)
try:
self.process_results(**kwargs)
except Exception: # pylint: disable=broad-except
__logger = logging.getLogger(__name__)
def __init__(self, **kwargs):
- super(KubeBench, self).__init__(**kwargs)
+ super().__init__(**kwargs)
self.job_name = "kube-bench"
self.ns_generate_name = "kube-bench-"
def run(self, **kwargs):
self.job_name = "kube-bench-{}".format(kwargs.get("target", "node"))
- super(KubeBench, self).run(**kwargs)
+ super().run(**kwargs)
self.details["report"] = ast.literal_eval(self.pod_log)
msg = prettytable.PrettyTable(
header_style='upper', padding_width=5,
[tox]
-envlist = pep8,pylint,yamllint,ansiblelint,bashate,py38,bandit,perm
+envlist = pep8,pylint,yamllint,ansiblelint,bashate,py39,bandit,perm
[testenv]
pip_version = pip==20.2.4
functest_kubernetes
[testenv:pep8]
-basepython = python3.8
+basepython = python3.9
commands = flake8
[testenv:pylint]
-basepython = python3.8
+basepython = python3.9
commands = pylint \
--ignore-imports=y --min-similarity-lines=10 \
- --disable=locally-disabled --reports=n functest_kubernetes
+ --disable=locally-disabled,wrong-import-order --reports=n functest_kubernetes
[testenv:yamllint]
-basepython = python3.8
+basepython = python3.9
files =
.travis.yml
docker
yamllint {[testenv:yamllint]files}
[testenv:ansiblelint]
-basepython = python3.8
+basepython = python3.9
commands = ansible-lint -x303 ansible/site.yml
[testenv:bandit]
-basepython = python3.8
+basepython = python3.9
commands = bandit -r functest_kubernetes -x tests -n 5 -ll
[testenv:py37]
commands = nosetests functest_kubernetes
[testenv:bashate]
-basepython = python3.8
+basepython = python3.9
files =
build.sh
functest_kubernetes/ci/download_images.sh
commands = bashate -e E005,E006,E042,E043 {[testenv:bashate]files}
[testenv:perm]
-basepython = python3.8
+basepython = python3.9
whitelist_externals = bash
path=. -not -path './.tox/*' -not -path './.git/*' -not -path './doc/pres/reveal.js/*'
commands =