talos/hack/test/conformance.sh
Andrew Rynhard 9f9fd02ceb chore: fix conformance
The `--e2e-parallel` flag seems to skip all tests when running in
certified-conformance mode. This reverts that change, and also adds a
check that fails if the conformance tests do not pass. This ensures that
we are not publishing broken versions of our edge release.

Signed-off-by: Andrew Rynhard <andrew@andrewrynhard.com>
2019-12-01 17:08:57 -08:00

33 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
set -eou pipefail
source ./hack/test/e2e-runner.sh
# ## Run CIS conformance
# echo "Master CIS Conformance:"
# e2e_run "export KUBECONFIG=${KUBECONFIG}-${PLATFORM}-capi
# kubectl apply -f /e2emanifests/cis-kube-bench-master.yaml
# kubectl wait --timeout=300s --for=condition=complete job/kube-bench-master > /dev/null
# kubectl logs job/kube-bench-master"
# echo "Worker CIS Conformance:"
# e2e_run "export KUBECONFIG=${KUBECONFIG}-${PLATFORM}-capi
# kubectl apply -f /e2emanifests/cis-kube-bench-node.yaml
# kubectl wait --timeout=300s --for=condition=complete job/kube-bench-node > /dev/null
# kubectl logs job/kube-bench-node"
# Download sonobuoy and run kubernetes conformance
e2e_run "set -eou pipefail
apt-get update && apt-get install wget
wget --quiet -O /tmp/sonobuoy.tar.gz ${SONOBUOY_URL}
tar -xf /tmp/sonobuoy.tar.gz -C /usr/local/bin
sonobuoy run --kubeconfig ${KUBECONFIG} \
--wait \
--skip-preflight \
--plugin e2e \
--mode certified-conformance
results=\$(sonobuoy retrieve --kubeconfig ${KUBECONFIG})
sonobuoy e2e --kubeconfig ${KUBECONFIG} \$results
sonobuoy status --kubeconfig ${KUBECONFIG} --json | tee /tmp/status.json
if [ \$(cat /tmp/status.json | jq -r '.plugins[] | select(.plugin == \"e2e\") | .\"result-status\"') != 'passed' ]; then exit 1; fi"