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:
Niels de Vos 2021-03-04 10:23:53 +01:00 committed by mergify[bot]
parent 5e63743243
commit c5f00a9e3d
2 changed files with 33 additions and 1 deletions

View File

@ -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) {

View File

@ -30,6 +30,9 @@ data:
"tenantTokenName": "storage-encryption-token"
}
}
},
"secrets-metadata-test": {
"encryptionKMSType": "metadata"
}
}
metadata: