Skip to content

Add Azure integration test backend#170

Merged
Jakob-Naucke merged 5 commits intotrusted-execution-clusters:mainfrom
Jakob-Naucke:azure-test
Feb 9, 2026
Merged

Add Azure integration test backend#170
Jakob-Naucke merged 5 commits intotrusted-execution-clusters:mainfrom
Jakob-Naucke:azure-test

Conversation

@Jakob-Naucke
Copy link
Contributor

@Jakob-Naucke Jakob-Naucke commented Jan 27, 2026

  • Update attestation policy
  • Make KubeVirt one of multiple $VIRT_PROVIDER backends
  • Introduce environment variables for images, as well as a namespace prefix
  • Use Azure CLI for new Azure backend

Depends on #159, #179

@openshift-ci
Copy link

openshift-ci bot commented Jan 27, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all


integration-tests: generate trusted-cluster-gen crds-rs
RUST_LOG=info REGISTRY=$(REGISTRY) TAG=$(TAG) \
TRUSTEE_IMAGE=$(TRUSTEE_IMAGE) APPROVED_IMAGE=$(APPROVED_IMAGE) TEST_IMAGE=$(TEST_IMAGE) \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can you also update the README for the integrations tests

@Jakob-Naucke
Copy link
Contributor Author

update: first passing test

@Jakob-Naucke
Copy link
Contributor Author

Moving out of draft

NB this requires a trustee-attester without tpm-attester support until confidential-containers/guest-components#1277 is resolved. Even when az-snp-vtpm is registered, tpm-attester registers as composite evidence and then fails because the AK cannot be set up right on Azure. The Trustee community has some understandable concerns on silently not providing failed evidence, as well as disabling features on the command line because that might create misleading evidence. I've pushed one to quay.io/trusted-execution-clusters/trustee-attester:v0.17.0-az-only.

@Jakob-Naucke Jakob-Naucke marked this pull request as ready for review February 4, 2026 21:12
tests/README.md Outdated
### Running the tests

The Azure VMs must be able to reach cluster services like the registration server and Trustee.
If you are on OpenShift, export `PLATFORM=openshift` and `oc expose` will make the required services available.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you provide an example for 'oc expose`, it requires the service to be exposed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test code included in this PR handles this, so there should be no need to manually oc expose. Or what do you mean?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the docs isn't very clean on what is required to be expose. You mention oc expose, and it isn't very clear what needs to be exposed. That's why I asked an example

@alicefr
Copy link
Contributor

alicefr commented Feb 5, 2026

@Jakob-Naucke I think we need to randmize the name of the VM in azure. In case of kubevirt, the VM is namespaced, but for Azure that's not the case. This might introduce some conflicts when the test are run in parallel and if the VM they have the same name. Can you add a randmon 5 string char after the name of each VM?

@alicefr
Copy link
Contributor

alicefr commented Feb 5, 2026

As a follow up PR, we also require a clean-up script for the VMs of the namespace that have failed. In case of KubeVirt, it isn't that bad because they got destroyed with the kind cluster, but with Azure that's not the case

tests/README.md Outdated
export TEST_IMAGE=/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$resource_group/providers/Microsoft.Compute/galleries/$compute_gallery/images/$image_definition/versions/$image_version
```

### Running the tests
Copy link
Contributor

@alicefr alicefr Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is also missing how you build and push the images in the openshift cluster

Copy link
Contributor Author

@Jakob-Naucke Jakob-Naucke Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I wasn't. But internal registry is probably possible, and I could add some general remarks on making them available.

Re both your comments on this file, I'm thinking if we should keep the areas "testing on OpenShift" and "testing on Azure" a little more separate, even if our CI will use them in tandem.

Copy link
Contributor

@alicefr alicefr Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, probably we should mention how to test on openshift and our suggestions. Since one could think of using kind and Azure as well, but they need to expose the services if they want to test in this way

Comment on lines +31 to +32
let out = ["--output", "json"];
let output = Command::new("az").args(args).args(out).output().await?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we check if the command is really installed and present in the system?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First line of create_vm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why not here? instead of in create_vm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved for clarity. The origin of it being there is that virtctl is checked to be there early for KubeVirt, because there's a lot of sunk time until virtctl is used

Comment on lines +31 to +32
let out = ["--output", "json"];
let output = Command::new("az").args(args).args(out).output().await?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First line of create_vm

tests/README.md Outdated
export TEST_IMAGE=/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$resource_group/providers/Microsoft.Compute/galleries/$compute_gallery/images/$image_definition/versions/$image_version
```

### Running the tests
Copy link
Contributor Author

@Jakob-Naucke Jakob-Naucke Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I wasn't. But internal registry is probably possible, and I could add some general remarks on making them available.

Re both your comments on this file, I'm thinking if we should keep the areas "testing on OpenShift" and "testing on Azure" a little more separate, even if our CI will use them in tandem.

tests/README.md Outdated
### Running the tests

The Azure VMs must be able to reach cluster services like the registration server and Trustee.
If you are on OpenShift, export `PLATFORM=openshift` and `oc expose` will make the required services available.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test code included in this PR handles this, so there should be no need to manually oc expose. Or what do you mean?

@alicefr
Copy link
Contributor

alicefr commented Feb 5, 2026

The tests passed for me. Good job! We need to improve the docs and there is a refactoring for the openshift vs kind trait, but if you prefer we can address them in a follow up PR.

iroykaufman and others added 4 commits February 6, 2026 12:52
This commit updates the test utils to support running trusted execution
cluster tests on the OpenShift platform.

To execute these tests on OpenShift, the following environment variables
must be configured:

- REGISTRY:    The repository location of the container image.
- TAG:         The specific tag of the container image.
- CLUSTER_URL: The API URL of the target cluster.
- PLATFORM:    Set this to 'openshift'.

Signed-off-by: Roy Kaufman <rkaufman@redhat.com>
Co-authored-by: Jakob Naucke <jnaucke@redhat.com>
- Field is now `az-snp-vtpm` (which requires quoting due to the
  dashes) instead of `azsnpvtpm`
- No lowercasing required

Signed-off-by: Jakob Naucke <jnaucke@redhat.com>
Split test_utils::virt into a module with separate
virt::kubevirt. Introduce the VIRT_PROVIDER variable to select.

- Reformat a bit.
- Make root_key an Option for environments where machine IDs cannot be
  correlated to IPs.

Signed-off-by: Jakob Naucke <jnaucke@redhat.com>
Assisted-by: Claude
Less double-tracking and adds flexibility for testing on cloud
platforms.

Environment variables:
- {TEST,TRUSTEE,APPROVED}_IMAGE
- TEST_NAMESPACE_PREFIX

Other changes:
- OpenShift service exposure
- Get cluster URL from OpenShift directly
- Reduce some lines & indentation in
  TestContext::apply_operator_manifests and break it up some
- Move endpoint constants to lib
- Log error upon poll timeout

Signed-off-by: Jakob Naucke <jnaucke@redhat.com>
Add integration tests backend for Azure (confidential VMs, no cluster
join). Use Azure CLI to create a resource group per test, same name as
the namespace (which can be prefixed). Auto-shutdown VMs after one
hour.

Signed-off-by: Jakob Naucke <jnaucke@redhat.com>
Co-authored-by: Uri Lublin <uril@redhat.com>
Assisted-by: Gemini, Claude
Copy link
Contributor Author

@Jakob-Naucke Jakob-Naucke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alicefr Thanks for your review! Everything should be addressed. Please take another look if you can.

Comment on lines +31 to +32
let out = ["--output", "json"];
let output = Command::new("az").args(args).args(out).output().await?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved for clarity. The origin of it being there is that virtctl is checked to be there early for KubeVirt, because there's a lot of sunk time until virtctl is used

@openshift-ci
Copy link

openshift-ci bot commented Feb 6, 2026

@Jakob-Naucke: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/operator-lifecycle-verify 84dc744 link true /test operator-lifecycle-verify

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci openshift-ci bot added the lgtm label Feb 9, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 9, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: alicefr, Jakob-Naucke

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Jakob-Naucke Jakob-Naucke merged commit e103e68 into trusted-execution-clusters:main Feb 9, 2026
8 of 9 checks passed
@Jakob-Naucke Jakob-Naucke deleted the azure-test branch February 9, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants