Application binding test
Overview
This folder contains the test which checks if the BindingUsage resource allows the Pod to call the fake Gateway.
Details
The testing scenario has the following steps:
- Setup: create Application, ApplicationMapping, deployments (
fake-gateway
, gateway-client
) and set-up Istio Deniers and Rules
- Provision a ServiceClass
- Perform binding
- Add a BindingUsage
- The
gateway-client
can call the fake-gateway
(an environment variable with Gateway URL is injected, Istio allows the call)
- Remove BindingUsage
- The
gateway-client
cannot call the fake-gateway
(there is no environment variable with Gateway URL, Istio blocks the call)
The gateway-client
stores values read by the test in a ConfigMap.
Usage
This section explains how to run the test on the cluster.
Setup
Go to the project root directory.
Build testing Docker image:
./application/contrib/build.sh
Create service accounts and roles:
kubectl apply -f application/contrib/rbac.yaml
Run the test
Create a testing Pod:
kubectl apply -f application/contrib/pod.yaml
Watch resources
The test creates and updates Kubernetes resources in the acceptance-test
Namespace. You can observe the test's progress using the following command:
kubectl get configmap,po,svc,servicebindingusage,servicebinding -n acceptance-test
You can see the ConfigMap with the values saved by the gateway-client
:
kubectl get configmap -n acceptance-test -o yaml
Cleanup
Clean up all test resources:
kubectl delete ns acceptance-test
kubectl delete po -n kyma-system app-acceptance-test