From 54e1604a204044fdb00e67f96cd16f5cb42adf28 Mon Sep 17 00:00:00 2001 From: Magnus Kulke Date: Wed, 13 Dec 2023 14:18:04 +0100 Subject: [PATCH] docs: Add docs for e2e tests on CAA deployment Adding instruction on how tests can be triggered against an existing deployment of CAA. This is useful for debugging tests and testing local changes. Signed-off-by: Magnus Kulke --- test/e2e/README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/test/e2e/README.md b/test/e2e/README.md index b37fb23883..ec2bf6fff4 100644 --- a/test/e2e/README.md +++ b/test/e2e/README.md @@ -129,4 +129,34 @@ func TestCloudProviderCreateSimplePod(t *testing.T) { For running e2e test cases specifically for checking PodVM with Image from Authenticated Registry, we need to export following two variables - `AUTHENTICATED_REGISTRY_IMAGE` - Name of the image along with the tag from authenticated registry (example: quay.io/kata-containers/confidential-containers-auth:test) -- `REGISTRY_CREDENTIAL_ENCODED` - Credentials of registry encrypted as BASE64ENCODED(USERNAME:PASSWORD). If you're using quay registry, we can get the encrypted credentials from Account Settings >> Generate Encrypted Password >> Docker Configuration \ No newline at end of file +- `REGISTRY_CREDENTIAL_ENCODED` - Credentials of registry encrypted as BASE64ENCODED(USERNAME:PASSWORD). If you're using quay registry, we can get the encrypted credentials from Account Settings >> Generate Encrypted Password >> Docker Configuration + +## Running the e2e Test Suite on an Existing CAA Deployment + +To test local changes the test suite can run without provisioning any infrastructure, CoCo or CAA. Make sure your cluster is configured and available via kubectl. You also might need to set up Cloud Provider-specific API access, since some of tests assert conditions for cloud resources. + +## Azure + +Fill in `RESOURCE_GROUP` and `AZURE_SUBSCRIPTION_ID` with the values you want to use in your test. + +```bash +cat < skip-provisioning.properties +RESOURCE_GROUP_NAME="..." +AZURE_SUBSCRIPTION_ID="..." +AZURE_CLIENT_ID="unused" +AZURE_TENANT_ID="unused" +LOCATION="unused" +AZURE_IMAGE_ID="unused" +EOF +``` + +Run the test suite with the respective flags: + +```bash +CLOUD_PROVIDER=azure \ +TEST_TEARDOWN=no \ +TEST_PROVISION=no \ +TEST_INSTALL_CAA=no \ +TEST_PROVISION_FILE=./skip-provisioning.properties \ +go test -v -tags=$CLOUD_PROVIDER -timeout 10m -count=1 ./ +```