diff --git a/cluster-up/cluster/kind-1.19-sriov/conformance.json b/cluster-up/cluster/kind-1.19-sriov/conformance.json new file mode 100644 index 0000000000..fafaaf854f --- /dev/null +++ b/cluster-up/cluster/kind-1.19-sriov/conformance.json @@ -0,0 +1,88 @@ +{ + "Description": "DEFAULT", + "UUID": "057cfeb1-e982-417a-a1ba-c2088d8ba96d", + "Version": "v0.52.0", + "ResultsDir": "/tmp/sonobuoy", + "Resources": [ + "apiservices", + "certificatesigningrequests", + "clusterrolebindings", + "clusterroles", + "componentstatuses", + "configmaps", + "controllerrevisions", + "cronjobs", + "customresourcedefinitions", + "daemonsets", + "deployments", + "endpoints", + "ingresses", + "jobs", + "leases", + "limitranges", + "mutatingwebhookconfigurations", + "namespaces", + "networkpolicies", + "nodes", + "persistentvolumeclaims", + "persistentvolumes", + "poddisruptionbudgets", + "pods", + "podlogs", + "podsecuritypolicies", + "podtemplates", + "priorityclasses", + "replicasets", + "replicationcontrollers", + "resourcequotas", + "rolebindings", + "roles", + "servergroups", + "serverversion", + "serviceaccounts", + "services", + "statefulsets", + "storageclasses", + "validatingwebhookconfigurations", + "volumeattachments" + ], + "Filters": { + "Namespaces": ".*", + "LabelSelector": "" + }, + "Limits": { + "PodLogs": { + "Namespaces": "", + "SonobuoyNamespace": true, + "FieldSelectors": [], + "LabelSelector": "", + "Previous": false, + "SinceSeconds": null, + "SinceTime": null, + "Timestamps": false, + "TailLines": null, + "LimitBytes": null, + "LimitSize": "", + "LimitTime": "" + } + }, + "QPS": 30, + "Burst": 50, + "Server": { + "bindaddress": "0.0.0.0", + "bindport": 8080, + "advertiseaddress": "", + "timeoutseconds": 21600 + }, + "Plugins": null, + "PluginSearchPath": [ + "./plugins.d", + "/etc/sonobuoy/plugins.d", + "~/sonobuoy/plugins.d" + ], + "Namespace": "sonobuoy", + "WorkerImage": "projects.registry.vmware.com/sonobuoy/sonobuoy:v0.52.0", + "ImagePullPolicy": "IfNotPresent", + "ImagePullSecrets": "", + "ProgressUpdatesPort": "8099" +} \ No newline at end of file diff --git a/cluster-up/cluster/kind/check-cluster-up.sh b/cluster-up/cluster/kind/check-cluster-up.sh new file mode 100755 index 0000000000..a227e936fa --- /dev/null +++ b/cluster-up/cluster/kind/check-cluster-up.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# +# This file is part of the KubeVirt project +# +# 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. +# +# Copyright 2021 Red Hat, Inc. + +set -exuo pipefail + +SCRIPT_PATH=$(dirname "$(realpath "$0")") + +kubevirtci_path="$(realpath "${SCRIPT_PATH}/../../..")/" +PROVIDER_PATH="${kubevirtci_path}/cluster-up/cluster/${KUBEVIRT_PROVIDER}" + +RUN_KUBEVIRT_CONFORMANCE=${RUN_KUBEVIRT_CONFORMANCE:-"false"} + +( + cd $kubevirtci_path + kubectl="./cluster-up/kubectl.sh" + + echo "Wait for pods to be ready.." + timeout 5m bash -c "until ${kubectl} wait --for=condition=Ready pod --timeout=30s --all -A; do sleep 1; done" + timeout 5m bash -c "until ${kubectl} wait --for=condition=Ready pod --timeout=30s -n kube-system --all; do sleep 1; done" + ${kubectl} get nodes + ${kubectl} get pods -A + echo "" + + nodes=$(${kubectl} get no --no-headers | awk '{print $1}') + for node in $nodes; do + echo "[$node] network interfaces status:" + docker exec ${node} ip a + echo "" + echo "[$node] route table:" + docker exec ${node} ip r + echo "" + echo "[$node] hosts file:" + docker exec ${node} cat /etc/hosts + echo "" + echo "[$node] resolve config:" + docker exec ${node} cat /etc/resolv.conf + echo "" + done + + echo "Run conformance tests" + conformance_config=${PROVIDER_PATH}/conformance.json + if [ -f "${conformance_config}" ]; then + if [ "$RUN_KUBEVIRT_CONFORMANCE" == "true" ]; then + echo "Deploy Kubevirt" + LATEST=$(curl -L "https://storage.googleapis.com/kubevirt-prow/devel/nightly/release/kubevirt/kubevirt/latest") + ${kubectl} apply -f "https://storage.googleapis.com/kubevirt-prow/devel/nightly/release/kubevirt/kubevirt/${LATEST}/kubevirt-operator.yaml" + ${kubectl} apply -f "https://storage.googleapis.com/kubevirt-prow/devel/nightly/release/kubevirt/kubevirt/${LATEST}/kubevirt-cr.yaml" + + ${kubectl} wait -n kubevirt kv kubevirt --for condition=Available --timeout 15m + + echo "Run Kubevirt conformance tests" + export SONOBUOY_EXTRA_ARGS="--plugin https://storage.googleapis.com/kubevirt-prow/devel/nightly/release/kubevirt/kubevirt/${LATEST}/conformance.yaml" + hack/conformance.sh $conformance_config + fi + + echo "Run K8S conformance tests" + export SONOBUOY_EXTRA_ARGS="--plugin systemd-logs --plugin e2e" + hack/conformance.sh $conformance_config + fi +)