Add TestVolumeEncryption#751
Open
hamistao wants to merge 18 commits into
Open
Conversation
hamistao
force-pushed
the
longhorn_encryption_test
branch
3 times, most recently
from
July 8, 2026 20:25
00c4fa3 to
3ced3f8
Compare
floatingman
reviewed
Jul 13, 2026
floatingman
left a comment
Contributor
There was a problem hiding this comment.
Just a few comments, but I think the one in secrets.go might cause a panic if not handled.
floatingman
requested review from
khushboo-rancher,
lscalabrini01 and
slickwarren
July 13, 2026 21:03
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds a new Longhorn end-to-end test (TestVolumeEncryption) to validate encrypted volume behavior across on-node replica data and S3 backups, while also refactoring several secret/storage helpers and updating module dependencies to support the new functionality.
Changes:
- Add
TestVolumeEncryptiontoLonghornTestSuite, including S3 backup/restore validation. - Introduce/adjust helper actions for Longhorn resources, S3 access, storage/PVC workflows, and secret templates (switching many call sites to
map[string]string/StringData). - Update
go.mod/go.sumdependencies (root,actions/, andinteroperability/) to newer versions required by added Longhorn/AWS functionality.
Reviewed changes
Copilot reviewed 38 out of 41 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| validation/upgrade/workload.go | Switch secret helper import and update secret template to use StringData-style input. |
| validation/snapshot/rke2/snapshot_s3_restore_test.go | Use new actions/storage/s3 helpers for bucket lifecycle. |
| validation/snapshot/k3s/snapshot_s3_restore_test.go | Use new actions/storage/s3 helpers for bucket lifecycle. |
| validation/rbac/secrets/rbac_registry_secrets_test.go | Update secret data setup to map[string]string for secret creation. |
| validation/rbac/secrets/rbac_opaque_secrets_test.go | Update secret data setup to map[string]string and assertions for updated secret data. |
| validation/rbac/globalrolesv2/namespacedrules_test.go | Update secret data setup to map[string]string. |
| validation/rbac/clusterandprojectroles/cluster_role_test.go | Update secret data setup to map[string]string. |
| validation/rbac/certificates/certificate_rbac_test.go | Update TLS secret data setup to map[string]string. |
| validation/rbac/aggregatedclusterroles/aggregated_cluster_roles_prtb_test.go | Update secret data setup to map[string]string. |
| validation/rbac/aggregatedclusterroles/aggregated_cluster_roles_crtb_test.go | Update secret data setup to map[string]string. |
| validation/rbac/aggregatedclusterroles/aggregated_cluster_roles_cleanup_test.go | Update secret data setup to map[string]string. |
| validation/projects/project_scoped_secrets_test.go | Update project-scoped secret helper signature and secret data to map[string]string. |
| validation/longhorn/longhorn_test.go | Add TestVolumeEncryption and supporting imports/constants; adjust Longhorn config loading usage. |
| validation/longhorn/chartinstall/installation_test.go | Improve workload pod selection and mounted-volume checks; reuse chart constants. |
| validation/charts/webhook.go | Remove unused constant. |
| validation/charts/monitoring_test.go | Switch secret helper import path to actions/kubeapi/secrets. |
| validation/charts/backup_restore/backup_restore.go | Switch secret helper import path and use StringData-style secret template input. |
| validation/certificates/cert_test.go | Update TLS secret creation data to map[string]string. |
| interoperability/longhorn/longhorn.go | Change Longhorn test config loader to return a value instead of pointer. |
| interoperability/go.mod | Bump dependency versions for interoperability module. |
| interoperability/go.sum | Update dependency checksums for interoperability module. |
| go.mod | Bump dependency versions; add replace for beszel; update k8s/prometheus/x/* versions. |
| actions/storage/verify.go | Update node filesystem checks to poll via backoff; update mounted-volume checks to accept kubeconfig. |
| actions/storage/s3/s3.go | Rename package to s3 and add helpers to locate/read backup objects. |
| actions/storage/pvc.go | Refactor PVC creation to separate CreatePVC and add workload labeling for pod lookup. |
| actions/secrets/secrets.go | Remove old secrets template helper (moved to actions/kubeapi/secrets). |
| actions/provisioning/verify.go | Remove unused constants and simplify SSH command string formatting. |
| actions/provisioning/creates.go | Switch secret helper import path and use map[string]string for secret template data. |
| actions/kubeapi/storageclasses/storageclasses.go | Expand NewStorageClass constructor to set provisioner/parameters/expansion. |
| actions/kubeapi/secrets/template.go | Move secret stevetype constant here and switch template to StringData. |
| actions/kubeapi/secrets/secrets.go | Update SecretCopyWithNewData to accept map[string]string. |
| actions/kubeapi/secrets/create.go | Update secret creation helpers to accept map[string]string. |
| actions/kubeapi/longhorn/longhorn.go | Add Longhorn helper actions for volumes, backup targets, backups, restore, and deletion. |
| actions/go.mod | Bump module dependencies for actions module (AWS SDK v2, Longhorn manager, etc.). |
| actions/go.sum | Update dependency checksums for actions module. |
| actions/cloudprovider/verify.go | Remove pod-status check and unused constants/import. |
| actions/cloudprovider/cloudprovider.go | Switch Harvester credential secret data to map[string]string. |
| actions/charts/ranchermonitoring.go | Adjust watch handling; update failure error formatting. |
| actions/charts/longhorn.go | Add exported Longhorn storage class constants alongside namespace/chart name. |
| .github/scripts/check-gomod.sh | Adjust messaging/quoting and fix an indentation/fi formatting issue. |
Comments suppressed due to low confidence (1)
actions/storage/s3/s3.go:112
ReadS3Objectignores the error fromGetObjectand doesn't close the response body. This can cause panics on error and leak HTTP connections/file descriptors during test runs.
hamistao
force-pushed
the
longhorn_encryption_test
branch
from
July 14, 2026 02:05
3ced3f8 to
12f6b33
Compare
lscalabrini01
requested changes
Jul 14, 2026
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Also moves the pre-existing functions to `actions/storage/s3` Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
CI tries to run these commands when they are between ` https://github.com/rancher/tests/actions/runs/28968388225/job/85957411738?pr=751 Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
Signed-off-by: hamistao <pedro.ribeiro@suse.com>
hamistao
force-pushed
the
longhorn_encryption_test
branch
from
July 21, 2026 14:37
12f6b33 to
71fb2da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces the test
TestVolumeEncryptionto ourLonghornTestSuite. Among other small unrelated improvements to the codebase.Said test required introducing new helper funcitions to handle longhorn resources such as voluemes, backups and backuptargets. These functions can also be moved to shepherd if we think it would make more sense for them to live there. Comments on the operations performed during the test are greatly appreciated as this is a very complex test and there are many possible approaches to satisfying the steps outlined in the pit schema for this test or possibly even improving the current schema.
So main topics that I am looking forward to getting feedback are:
1- Are the new helper functions fine here or should they be moved to shepherd?
2- Are the steps performed able to assure the features explored work as expected?
3- Since the test is quite big and only the second half of it requires interacting with S3, should we break this test into 2 or more tests?
This work performed as part of rancher/qa-tasks#2403, the other test will be available for review in a separate PR.