From a53a64129dfe493f3669cf4302b033d34e032996 Mon Sep 17 00:00:00 2001 From: Marcel Lauhoff Date: Fri, 26 Aug 2022 20:18:07 +0200 Subject: [PATCH] e2e: add PVC-PVC clone Ceph FS fscrypt tests Note: Feature fixed https://tracker.ceph.com/issues/57641 Signed-off-by: Marcel Lauhoff --- e2e/cephfs.go | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/e2e/cephfs.go b/e2e/cephfs.go index 2fb914450..a53155c6e 100644 --- a/e2e/cephfs.go +++ b/e2e/cephfs.go @@ -1680,6 +1680,44 @@ var _ = Describe(cephfsType, func() { } }) + if testCephFSFscrypt { + kmsToTest := map[string]kmsConfig{ + "secrets-metadata-test": secretsMetadataKMS, + "vault-test": vaultKMS, + } + for kmsID, kmsConf := range kmsToTest { + kmsID := kmsID + kmsConf := kmsConf + By("create an encrypted PVC-PVC clone and bind it to an app with "+kmsID, func() { + err := deleteResource(cephFSExamplePath + "storageclass.yaml") + if err != nil { + e2elog.Failf("failed to delete storageclass: %v", err) + } + + scOpts := map[string]string{ + "encrypted": "true", + "encryptionKMSID": kmsID, + } + + err = createCephfsStorageClass(f.ClientSet, f, true, scOpts) + if err != nil { + e2elog.Failf("failed to create CephFS storageclass: %v", err) + } + + validateFscryptClone(pvcPath, appPath, pvcSmartClonePath, appSmartClonePath, kmsConf, f) + + err = deleteResource(cephFSExamplePath + "storageclass.yaml") + if err != nil { + e2elog.Failf("failed to delete storageclass: %v", err) + } + err = createCephfsStorageClass(f.ClientSet, f, false, nil) + if err != nil { + e2elog.Failf("failed to create CephFS storageclass: %v", err) + } + }) + } + } + By("create a PVC-PVC clone and bind it to an app", func() { var wg sync.WaitGroup totalCount := 3