Skip to content

Commit

Permalink
docs: Add docs for e2e tests on CAA deployment
Browse files Browse the repository at this point in the history
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 <magnuskulke@microsoft.com>
  • Loading branch information
mkulke committed Dec 13, 2023
1 parent 81ac36d commit 54e1604
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion test/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- `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 <<EOF> 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 ./
```

0 comments on commit 54e1604

Please sign in to comment.