mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
e2e: add test for the SecretsMetadataKMS provider
The new provider should be able to provision and mount an encrypted volume. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
5e63743243
commit
c5f00a9e3d
29
e2e/rbd.go
29
e2e/rbd.go
@ -438,6 +438,35 @@ var _ = Describe("RBD", func() {
|
||||
}
|
||||
})
|
||||
|
||||
By("create a PVC and bind it to an app with encrypted RBD volume with SecretsMetadataKMS", func() {
|
||||
err := deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete storageclass with error %v", err)
|
||||
}
|
||||
scOpts := map[string]string{
|
||||
"encrypted": "true",
|
||||
"encryptionKMSID": "secrets-metadata-test",
|
||||
}
|
||||
err = createRBDStorageClass(f.ClientSet, f, nil, scOpts, deletePolicy)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create storageclass with error %v", err)
|
||||
}
|
||||
err = validateEncryptedPVCAndAppBinding(pvcPath, appPath, "", f)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to validate encrypted pvc with error %v", err)
|
||||
}
|
||||
// validate created backend rbd images
|
||||
validateRBDImageCount(f, 0)
|
||||
err = deleteResource(rbdExamplePath + "storageclass.yaml")
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to delete storageclass with error %v", err)
|
||||
}
|
||||
err = createRBDStorageClass(f.ClientSet, f, nil, nil, deletePolicy)
|
||||
if err != nil {
|
||||
e2elog.Failf("failed to create storageclass with error %v", err)
|
||||
}
|
||||
})
|
||||
|
||||
By("create a PVC clone and bind it to an app", func() {
|
||||
// snapshot beta is only supported from v1.17+
|
||||
if k8sVersionGreaterEquals(f.ClientSet, 1, 17) {
|
||||
|
@ -30,7 +30,10 @@ data:
|
||||
"tenantTokenName": "storage-encryption-token"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"secrets-metadata-test": {
|
||||
"encryptionKMSType": "metadata"
|
||||
}
|
||||
}
|
||||
metadata:
|
||||
name: ceph-csi-encryption-kms-config
|
||||
|
Loading…
Reference in New Issue
Block a user