CNF Conformance Test Psuedo code
To check for the use of alpha K8s API endpoints
To check for the use of beta K8s API endpoints
To check for the use of generally available (GA) K8s API endpoints
curl https://raw.githubusercontent.com/cncf/apisnoop/master/deployment/k8s/kind-cluster-config.yaml -o kind-cluster-config.yaml
kind create cluster --name kind-$USER --config kind-cluster-config.yaml
kubectl apply -f https://raw.githubusercontent.com/cncf/apisnoop/master/deployment/k8s/raiinbow.yaml
kubectl get pods --all-namespaces -o jsonpath='{.items[*].spec.containers[?(@.securityContext.privileged==true)].name}'
# Alternatively
docker run --rm -it ubuntu ip link add dummy0 type dummy
RTNETLINK answers: Operation not permitted
kubectl scale --replicas=3 rs/foo
To test small scale autoscaling
kubectl scale --replicas=3 rs/foo
Configuration and Lifecycle Tests
To test if the CNF is installed with a versioned Helm v3 Chart
To test if there are any (non-declarative) hardcoded IP addresses or subnet masks
grep --exclude-dir={} --exclude=*.o -rnw '.' -e '.*(?:\d{1,3}\.){3}\d{1,3}*'
To test if there is a liveness entry in the Helm chart
yq read deployment.yaml spec.template.spec.containers.0.livenessProbe
To test if there is a readiness entry in the Helm chart
yq read deployment.yaml spec.template.spec.containers.0.readinessProbe
Test starting a container without mounting a volume that has configuration files
Test if there is traffic to Fluentd
Test if there is traffic to Jaeger
Test if there is traffic to Prometheus
Test are if the monitoring calls are compatible with OpenMetric
Installable and Upgradeable Tests
Test if the install script uses Helm v3
Test if the Helm chart is published to a public helm chart repository
Hardware Resources and Scheduling Tests
Test if the CNF is accessing hardware in its configuration files
Test if the CNF is accessing hardware directly during run-time (e.g. accessing the host /dev or /proc from a mount)
Test if the CNF Testbed performance output shows adequate throughput and sessions using the CNF Testbed (vendor neutral) hardware environment