mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-22 21:10:22 +00:00
e2e: Add helper to run encryption tests on block and file
Add a `By` wrapper to parameterize encryption related test functions and run them on both block and file encryption Signed-off-by: Marcel Lauhoff <marcel.lauhoff@suse.com>
This commit is contained in:
parent
cec88a7bff
commit
0f626b705a
@ -232,6 +232,15 @@ func checkClusternameInMetadata(f *framework.Framework, ns, pool, image string)
|
||||
}
|
||||
}
|
||||
|
||||
// ByFileAndBlockEncryption wraps ginkgo's By to run the test body using file and block encryption specific validators.
|
||||
func ByFileAndBlockEncryption(
|
||||
text string,
|
||||
callback func(validator encryptionValidateFunc, encryptionType string),
|
||||
) {
|
||||
By(text+" (block)", func() { callback(validateEncryptedPVCAndAppBinding, "block") })
|
||||
By(text+" (file)", func() { callback(validateEncryptedFilesystemAndAppBinding, "file") })
|
||||
}
|
||||
|
||||
var _ = Describe("RBD", func() {
|
||||
f := framework.NewDefaultFramework(rbdType)
|
||||
var c clientset.Interface
|
||||
|
@ -482,6 +482,8 @@ func validateCloneInDifferentPool(f *framework.Framework, snapshotPool, cloneSc,
|
||||
return nil
|
||||
}
|
||||
|
||||
type encryptionValidateFunc func(pvcPath, appPath string, kms kmsConfig, f *framework.Framework) error
|
||||
|
||||
func validateEncryptedPVCAndAppBinding(pvcPath, appPath string, kms kmsConfig, f *framework.Framework) error {
|
||||
pvc, app, err := createPVCAndAppBinding(pvcPath, appPath, f, deployTimeout)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user