summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitlab-ci.yml145
-rwxr-xr-xdeploy.sh6
-rwxr-xr-xfunctions.sh15
3 files changed, 158 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index fecf145..51291b8 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,22 +3,151 @@
# and run RC2 compliance tests on the deployed platform.
# TODO add tox jobs
+variables:
+ S3_ENDPOINT_URL: https://storage.googleapis.com
+ S3_DST_URL: s3://artifacts.opnfv.org/kuberef/${CI_COMMIT_SHORT_SHA}/${CI_JOB_NAME}-${CI_JOB_ID}
+ HTTP_DST_URL: http://artifacts.opnfv.org/kuberef/${CI_COMMIT_SHORT_SHA}/${CI_JOB_NAME}-${CI_JOB_ID}
+ TEST_DB_URL: http://testresults.opnfv.org/test/api/v1/results
+ TEST_DB_EXT_URL: http://testresults.opnfv.org/test/api/v1/results
+ NODE_NAME: ericsson-pod2
+ BUILD_TAG: ${CI_COMMIT_SHORT_SHA}
+ DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
+
stages:
+ - .pre
- deploy_platform
- - run_compliance_tests
+ - functest-kubernetes-healthcheck
+ - functest-kubernetes-smoke
+ - functest-kubernetes-security
+ - functest-kubernetes-benchmarking
+ - functest-kubernetes-cnf
+ - zip
+ - .post
deploy:
- stage: deploy_platform
tags:
- ericsson-pod2
+ stage: deploy_platform
script:
- bash deploy.sh
-runtestsuite:
- extends: deploy
- stage: run_compliance_tests
+k8s_quick:
tags:
- - ericsson-pod2
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-healthcheck
+ image: opnfv/functest-kubernetes-healthcheck:jerma
+ script:
+ - run_tests -t k8s_quick -p -r
+
+k8s_smoke:
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-healthcheck
+ image: opnfv/functest-kubernetes-healthcheck:jerma
+ script:
+ - run_tests -t k8s_smoke -p -r
+
+xrally_kubernetes:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-smoke
+ image: opnfv/functest-kubernetes-smoke:jerma
+ timeout: 3 hours 30 minutes
+ script:
+ - run_tests -t xrally_kubernetes -p -r
+
+k8s_conformance:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-smoke
+ image: opnfv/functest-kubernetes-smoke:jerma
+ timeout: 3 hours 30 minutes
+ script:
+ - run_tests -t k8s_conformance -p -r
+
+kube_hunter:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-security
+ image: opnfv/functest-kubernetes-security:jerma
+ script:
+ - run_tests -t kube_hunter -p -r
+
+kube_bench_master:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-security
+ image: opnfv/functest-kubernetes-security:jerma
+ script:
+ - run_tests -t kube_bench_master -p -r
+
+kube_bench_node:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-security
+ image: opnfv/functest-kubernetes-security:jerma
+ script:
+ - run_tests -t kube_bench_node -p -r
+
+xrally_kubernetes_full:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-benchmarking
+ image: opnfv/functest-kubernetes-benchmarking:jerma
+ script:
+ - run_tests -t xrally_kubernetes_full -p -r
+
+k8s_vims:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-cnf
+ image: opnfv/functest-kubernetes-cnf:jerma
+ script:
+ - run_tests -t k8s_vims -p -r
+
+helm_vims:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-cnf
+ image: opnfv/functest-kubernetes-cnf:jerma
+ script:
+ - run_tests -t helm_vims -p -r
+
+cnf_conformance:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: functest-kubernetes-cnf
+ image: opnfv/functest-kubernetes-cnf:jerma
+ script:
+ - run_tests -t cnf_conformance -p -r
+
+zip:
+ only:
+ - schedules
+ tags:
+ - ericsson-pod2-docker
+ stage: zip
+ variables:
+ S3_DST_URL: s3://artifacts.opnfv.org/kuberef/
+ HTTP_DST_URL: http://artifacts.opnfv.org/kuberef/
+ image: opnfv/functest-kubernetes-healthcheck:jerma
script:
- - bash run_testsuite.sh
- when: on_success
+ - zip_campaign
diff --git a/deploy.sh b/deploy.sh
index 88e746b..7b230f1 100755
--- a/deploy.sh
+++ b/deploy.sh
@@ -63,3 +63,9 @@ fi
# Provision k8s cluster (currently BMRA)
# ---------------------------------------------------------------------
provision_k8s
+
+# ---------------------------------------------------------------------
+# Copy kubeconfig to desired location
+# ---------------------------------------------------------------------
+copy_k8s_config
+
diff --git a/functions.sh b/functions.sh
index 4e06523..8d206bf 100755
--- a/functions.sh
+++ b/functions.sh
@@ -235,6 +235,21 @@ ${ansible_cmd}
EOF
}
+# Copy kubeconfig to the appropriate location needed by functest containers
+copy_k8s_config() {
+# TODO Use Kubespray variables in BMRA to simplify this
+ MASTER_IP=$(get_host_pxe_ip "nodes[0]")
+ # shellcheck disable=SC2087
+ ssh -o StrictHostKeyChecking=no -tT "$USERNAME"@"$(get_vm_ip)" << EOF
+scp -q root@$MASTER_IP:/root/.kube/config ${PROJECT_ROOT}/kubeconfig
+EOF
+
+# Copy kubeconfig from Jump VM to appropriate location in Jump Host
+# Direct scp to the specified location doesn't work due to permission/ssh-keys
+ scp "$USERNAME"@"$(get_vm_ip)":"${PROJECT_ROOT}"/kubeconfig kubeconfig
+ sudo cp kubeconfig /home/opnfv/functest-kubernetes/config
+}
+
# Executes a specific Ansible playbook
run_playbook() {
ansible_cmd="$(command -v ansible-playbook)"