Repository navigation
test(e2e): re-enable and modernize the VM backup e2e (backup path is uncovered) #3236
Description
Summary
The VM backup end-to-end test is disabled and stale, so the VMInstance backup/restore path is not covered by CI. Because of this, config-level regressions in the default backup flow ship unnoticed. On a v1.5.x SeaweedFS-backed cluster the default VM backup flow does not complete out of the box; the issues below would be caught by a working e2e.
Current state
Updated 2026-08-03 — the BATS era is over: the test was ported to Chainsaw and now lives at hack/e2e-chainsaw/backup/chainsaw-test.yaml.disabled. It is still not executed, and for the same reason: hack/select-e2e.sh enumerates suites with find hack/e2e-chainsaw -mindepth 2 -maxdepth 2 -name chainsaw-test.yaml, so the .disabled suffix keeps backup unselectable. The sibling app suites all run.
The API drift is on three axes, not one, so "re-enable" means rewriting the BackupJob step rather than renaming a file:
- BackupJob shape. The disabled test sets
spec.storageRef+spec.strategyRef.api/backups/v1alpha1/backupjob_types.gonow definesBackupJobSpecasApplicationRef+ a requiredBackupClassName, with an optionalPlanRef. Both old fields are gone from the type, so the apply is pruned or rejected outright rather than merely mis-routed. - Strategy name.
velero-strategy-defaultno longer exists;mainshipscozy-default-velero-vminstanceandcozy-default-velero-vmdisk. - Application kind. The test creates
apps.cozystack.io/VirtualMachine, which is not a package at all —packages/apps/has onlyvm-instanceandvm-disk, andcozy-defaultroutesVMInstanceandVMDisk.
Defaults that break the out-of-the-box flow (repo-verified)
BSL endpoint scheme vs S3 TLS.FIXED (2026-08-03 re-check).templates/_helpers.tplnow derives the endpoint from the COSI system-credentials Secret and returnshttps://<external S3 ingress>, which carries an ACME cert; the plaintexthttp://seaweedfs-s3…:8333survives invalues.yamlonly as the documented fallback forprovisionBucket: falseand for offline renders. Landed in PR fix(etcd): complete v1alpha2 transition for in-cluster 1.5→1.6 upgrades #3270; the same forced-httpsstep is tracked as a forward-compatibility note in fix(bucket): endpoint helper unconditionally forces https:// — original scheme lost for provisioned buckets #3317.- Missing
checksumAlgorithm. Still valid.git grep -i checksumAlgorithm -- packages/returns nothing, andtemplates/velero-bsl.yamlsets onlyregion,s3ForcePathStyleands3Urlunderconfig. Withvelero-plugin-for-awsv1.14.1 (AWS SDK v2) against SeaweedFS,PutObjectof the backup metadata fails with a misleadingInvalidAccessKeyId;checksumAlgorithm: ""resolves it.
Proposed
- Re-enable the backup e2e and update it to the
VMInstance+cozy-defaultBackupClassflow. - Assert the Velero
BackupreachesCompletedand that objects are written to the bucket. - Fix the remaining BSL default so the out-of-the-box flow works end to end:
checksumAlgorithm: "". The endpoint half is already done, see above.
PR #3427 "test(vmi): modernize the VMInstance/VMDisk backup/restore e2e to the BackupClass flow" is open against this.
Activity
test(vmdisk): add standalone VMDisk backup/restore e2e round-trip
test(vmdisk): run the VMDisk backup/restore round-trip un-gated in CI
test(vmi): run the VMInstance backup/restore round-trip un-gated on a…
androndo commentedon Aug 3, 2026
Refreshed the body after re-verifying against
main(04b742670). Three corrections, all in the issue's favour:hack/e2e-chainsaw/backup/chainsaw-test.yaml.disabled. It is still not executed, for the same structural reason —hack/select-e2e.shonly enumerateschainsaw-test.yaml, so the.disabledsuffix keeps the suite unselectable.spec.storageRef/spec.strategyRefare gone fromBackupJobSpec(nowApplicationRef+ requiredBackupClassName),velero-strategy-defaultno longer exists (it iscozy-default-velero-vminstance/-vmdisk), andapps.cozystack.io/VirtualMachineis not a package at all — onlyvm-instanceandvm-diskexist.https://<external S3 ingress>(PR fix(etcd): complete v1alpha2 transition for in-cluster 1.5→1.6 upgrades #3270). Defect 2, the missingchecksumAlgorithm: "", is confirmed still valid —git grep -i checksumAlgorithm -- packages/returns nothing.Also linked PR #3427, which is open against exactly this.
Found during an audit of all open backup issues.
test(vmi): modernize the VMInstance backup/restore e2e to the BackupC…
test(vmdisk): add standalone VMDisk backup/restore e2e round-trip
test(vmdisk): run the VMDisk backup/restore round-trip un-gated in CI
test(vmi): run the VMInstance backup/restore round-trip un-gated on a…
fix(backups): prepare standalone VMDisk restore targets and add VM ba…