Skip to content

Commit 7b86bdc

Browse files
committed
fix(tests): Increase attestation timeout and update Makefile
The `test_attestation` test may time out while waiting for SSH access, as VM boot can exceed the previous 300s limit. Increase the maximum wait time to 600s to prevent this. Also, update the `integration-tests` target in the Makefile to add the `crds-rs` dependency and ensure the namespace is created before applying the manifests. Signed-off-by: Yalan Zhang <[email protected]>
1 parent 7238e18 commit 7b86bdc

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ endif
134134
$(YQ) '.spec.publicTrusteeAddr = "$(TRUSTEE_ADDR):8080"' \
135135
-i $(DEPLOY_PATH)/trusted_execution_cluster_cr.yaml
136136
$(YQ) '.namespace = "$(NAMESPACE)"' -i config/rbac/kustomization.yaml
137+
$(KUBECTL) create namespace $(NAMESPACE) || true
137138
$(KUBECTL) apply -f $(DEPLOY_PATH)/operator.yaml
138139
$(KUBECTL) apply -f config/crd
139140
$(KUBECTL) apply -k config/rbac
@@ -171,7 +172,7 @@ test: crds-rs
171172
test-release: crds-rs
172173
cargo test --workspace --bins --release
173174

174-
integration-tests: generate trusted-cluster-gen
175+
integration-tests: generate trusted-cluster-gen crds-rs
175176
RUST_LOG=info cargo test --test trusted_execution_cluster --test attestation \
176177
--features virtualization -- --no-capture --test-threads=1
177178

test_utils/src/virt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ pub async fn create_kubevirt_vm(
193193
},
194194
"resources": {
195195
"requests": {
196+
"cpu": "2",
196197
"memory": "4096M"
197198
}
198199
}

tests/attestation.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ impl SingleAttestationContext {
4848
test_ctx.info(format!("VM {} is Running", vm_name));
4949

5050
test_ctx.info(format!("Waiting for SSH access to VM {}", vm_name));
51-
virt::wait_for_vm_ssh_ready(namespace, vm_name, &key_path, 300).await?;
51+
virt::wait_for_vm_ssh_ready(namespace, vm_name, &key_path, 600).await?;
5252
test_ctx.info("SSH access is ready");
5353

5454
Ok(Self {
@@ -148,8 +148,8 @@ async fn test_parallel_vm_attestation() -> anyhow::Result<()> {
148148
// Wait for SSH access on both VMs in parallel
149149
test_ctx.info("Waiting for SSH access on both VMs");
150150
let (ssh1_ready, ssh2_ready) = tokio::join!(
151-
virt::wait_for_vm_ssh_ready(namespace, vm1_name, &key_path1, 300),
152-
virt::wait_for_vm_ssh_ready(namespace, vm2_name, &key_path2, 300)
151+
virt::wait_for_vm_ssh_ready(namespace, vm1_name, &key_path1, 900),
152+
virt::wait_for_vm_ssh_ready(namespace, vm2_name, &key_path2, 900)
153153
);
154154

155155
ssh1_ready?;

0 commit comments

Comments
 (0)