--platforms linux/amd64,linux/arm,linux/arm64 \
--template ${DOCKER_USERNAME}/functest-kubernetes-smoke:ARCH-kali \
--target ${DOCKER_USERNAME}/functest-kubernetes-smoke:kali
+ - stage: build functest-kubernetes-benchmarking image
+ script: bash build.sh
+ env:
+ - REPO="${DOCKER_USERNAME}"
+ - amd64_dirs="docker/benchmarking"
+ - arm_dirs=""
+ - arm64_dirs=""
+ - script: bash build.sh
+ env:
+ - REPO="${DOCKER_USERNAME}"
+ - amd64_dirs=""
+ - arm_dirs="docker/benchmarking"
+ - arm64_dirs=""
+ - script: bash build.sh
+ env:
+ - REPO="${DOCKER_USERNAME}"
+ - amd64_dirs=""
+ - arm_dirs=""
+ - arm64_dirs="docker/benchmarking"
+ - stage: publish functest-kubernetes-benchmarking manifests
+ script: >
+ manifest-tool push from-args \
+ --platforms linux/amd64,linux/arm,linux/arm64 \
+ --template \
+ ${DOCKER_USERNAME}/functest-kubernetes-benchmarking:ARCH-kali \
+ --target ${DOCKER_USERNAME}/functest-kubernetes-benchmarking:kali
- name: functest-kubernetes-core
ref_arg: BRANCH
path: docker/core
- - name: build opnfv/functest-kubernetes-healthcheck
+ - name: build containers
containers:
- name: functest-kubernetes-healthcheck
ref_arg:
- name: functest-kubernetes-security
ref_arg: BRANCH
path: docker/security
- - name: build containers
+ - name: build opnfv/functest-kubernetes-smoke
containers:
- name: functest-kubernetes-smoke
ref_arg:
path: docker/smoke
+ - name: build opnfv/functest-kubernetes-benchmarking
+ containers:
+ - name: functest-kubernetes-benchmarking
+ ref_arg:
+ path: docker/benchmarking
suites:
- container: functest-kubernetes-healthcheck
tests:
tests:
- kube_hunter
- kube_bench
+ - container: functest-kubernetes-benchmarking
+ tests:
+ - xrally_kubernetes_full
- container: functest-kubernetes-cnf
tests:
- k8s_vims
docker/healthcheck \
docker/smoke \
docker/cnf \
-docker/security"}
+docker/security \
+docker/benchmarking"}
arm_dirs=${arm_dirs-${amd64_dirs}}
arm64_dirs=${arm64_dirs-${amd64_dirs}}
build_opts=(--pull=true --no-cache --force-rm=true)
find . -name Dockerfile -exec sed -i \
-e "s|opnfv/functest-kubernetes-healthcheck:kali|\
${repo}/functest-kubernetes-healthcheck:arm64-kali|g" {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|opnfv/functest-kubernetes-smoke:kali|\
+${repo}/functest-kubernetes-smoke:arm64-kali|g" {} +
for dir in ${arm64_dirs}; do
(cd "${dir}" && docker build "${build_opts[@]}" \
-t "${repo}/functest-kubernetes-${dir##**/}:arm64-kali" .)
find . -name Dockerfile -exec sed -i \
-e "s|opnfv/functest-kubernetes-healthcheck:kali|\
${repo}/functest-kubernetes-healthcheck:arm-kali|g" {} +
+find . -name Dockerfile -exec sed -i \
+ -e "s|opnfv/functest-kubernetes-smoke:kali|\
+${repo}/functest-kubernetes-smoke:arm-kali|g" {} +
for dir in ${arm_dirs}; do
(cd "${dir}" && docker build "${build_opts[@]}" \
-t "${repo}/functest-kubernetes-${dir##**/}:arm-kali" .)
--- /dev/null
+FROM opnfv/functest-kubernetes-smoke:kali
+
+COPY testcases.yaml /usr/lib/python3.8/site-packages/xtesting/ci/testcases.yaml
+CMD ["run_tests", "-t", "all"]
--- /dev/null
+#!/bin/bash
+
+from="${DOCKER_REPO%/*}/functest-kubernetes-smoke:${DOCKER_TAG}"
+sed -i "s|^FROM.*$|FROM ${from}|" Dockerfile
+
+exit $?
--- /dev/null
+---
+tiers:
+ -
+ name: benchmarking
+ order: 1
+ description: >-
+ A set of benchmarking tests integrated from xRally for Kubernetes
+ platform.
+ testcases:
+ -
+ case_name: xrally_kubernetes_full
+ project_name: functest
+ criteria: 100
+ blocking: false
+ description: >-
+ All in one tasks for checking basic functionality of
+ Kubernetes cluster.
+ dependencies:
+ - DEPLOY_SCENARIO: 'k8-*'
+ run:
+ name: xrally_kubernetes
+ args:
+ times: 10
+ concurrency: 4
+ namespaces_count: 3
Kubernetes.list_namespaces: {}
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
- title: Run a single workload with create/read/delete namespace
scenario:
Kubernetes.create_and_delete_namespace: {}
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
- title: Run a single workload with create/read/delete pod
scenario:
image: kubernetes/pause
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/read/delete replication controller
replicas: 2
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/scale/delete replication controller
scale_replicas: 3
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/read/delete replicaset
replicas: 1
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/scale/delete replicaset
scale_replicas: 2
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title:
mount_path: /opt/check
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: >-
times: 1
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/read/delete pod with secret volume
mount_path: /opt/check
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/check/delete pod with secret volume
error_regexp: No such file
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: >-
times: 1
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title:
test
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: >-
times: 1
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/read/delete deployment
replicas: 2
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/rollout/delete deployment
value: "true"
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/read/delete statefulset
replicas: 2
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/scale/delete statefulset
scale_replicas: 2
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/read/delete job
- "SUCCESS"
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/check/delete clusterIP service
protocol: TCP
runner:
constant:
- concurrency: 1
- times: 2
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: >-
times: 1
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
- title: Run a single workload with create/check/delete NodePort service
request_timeout: 10
runner:
constant:
- concurrency: 1
- times: 1
+ concurrency: {{ concurrency }}
+ times: {{ times }}
contexts:
namespaces:
- count: 3
+ count: {{ namespaces_count }}
with_serviceaccount: true
import os
import time
+from jinja2 import Template
import pkg_resources
from rally import api
from rally import exceptions
__logger = logging.getLogger(__name__)
+ concurrency = 1
+ times = 1
+ namespaces_count = 1
+
def __init__(self, **kwargs):
super(RallyKubernetes, self).__init__(**kwargs)
self.dir_results = "/home/opnfv/functest/results"
"Cannot check env heath: %s",
result['existing@kubernetes']['message'])
return
- input_task = open(
- pkg_resources.resource_filename(
- 'functest_kubernetes', 'rally/all-in-one.yaml')).read()
- task = yaml.safe_load(input_task)
+ with open(pkg_resources.resource_filename(
+ 'functest_kubernetes', 'rally/all-in-one.yaml')) as file:
+ template = Template(file.read())
+ task = yaml.safe_load(template.render(
+ concurrency=kwargs.get("concurrency", self.concurrency),
+ times=kwargs.get("times", self.times),
+ namespaces_count=kwargs.get(
+ "namespaces_count", self.namespaces_count)))
rapi.task.validate(deployment='my-kubernetes', config=task)
task_instance = rapi.task.create(deployment='my-kubernetes')
rapi.task.start(
rally
xrally-kubernetes
kubernetes # Apache-2.0
+Jinja2 # BSD License (3 clause)
files =
.travis.yml
docker
- functest_kubernetes/rally/all-in-one.yaml
commands =
yamllint {[testenv:yamllint]files}