-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move extra VDDK arguments functional test.
Put this in import_test and assert the values there, instead of in the VDDK test plugin. The VDDK plugin logs the given values, and then the test scans the log for what it expects to see. Signed-off-by: Matthew Arnold <[email protected]>
- Loading branch information
Showing
4 changed files
with
92 additions
and
51 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1184,25 +1184,6 @@ var _ = Describe("[vendor:[email protected]][level:component]DataVolume tests", | |
return dv | ||
} | ||
|
||
createVddkDataVolumeWithExtraArgs := func(dataVolumeName, size, url string) *cdiv1.DataVolume { | ||
dv := createVddkDataVolumeWithInitImageURL(dataVolumeName, size, url) | ||
extraArguments := v1.ConfigMap{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Namespace: f.Namespace.Name, | ||
Name: "vddk-extra-args-map", | ||
}, | ||
Data: map[string]string{ // Must match vddk-test-plugin | ||
common.VddkArgsKeyName: "VixDiskLib.nfcAio.Session.BufSizeIn64KB=16", | ||
}, | ||
} | ||
_, err := f.K8sClient.CoreV1().ConfigMaps(f.Namespace.Name).Create(context.TODO(), &extraArguments, metav1.CreateOptions{}) | ||
if !k8serrors.IsAlreadyExists(err) { | ||
Expect(err).ToNot(HaveOccurred()) | ||
} | ||
controller.AddAnnotation(dv, controller.AnnVddkExtraArgs, extraArguments.Name) | ||
return dv | ||
} | ||
|
||
// Similar to previous table, but with additional cleanup steps to save and restore VDDK image config map | ||
DescribeTable("should", Serial, func(args dataVolumeTestArguments) { | ||
_, err := utils.CopyConfigMap(f.K8sClient, f.CdiInstallNs, common.VddkConfigMap, f.CdiInstallNs, savedVddkConfigMap, "") | ||
|
@@ -1273,30 +1254,6 @@ var _ = Describe("[vendor:[email protected]][level:component]DataVolume tests", | |
Message: "Import Complete", | ||
Reason: "Completed", | ||
}}), | ||
Entry("[test_id:5083]succeed importing VDDK data volume with extra arguments ConfigMap set", dataVolumeTestArguments{ | ||
name: "dv-import-vddk", | ||
size: "1Gi", | ||
url: vcenterURL, | ||
dvFunc: createVddkDataVolumeWithExtraArgs, | ||
eventReason: dvc.ImportSucceeded, | ||
phase: cdiv1.Succeeded, | ||
checkPermissions: false, | ||
readyCondition: &cdiv1.DataVolumeCondition{ | ||
Type: cdiv1.DataVolumeReady, | ||
Status: v1.ConditionTrue, | ||
}, | ||
boundCondition: &cdiv1.DataVolumeCondition{ | ||
Type: cdiv1.DataVolumeBound, | ||
Status: v1.ConditionTrue, | ||
Message: "PVC dv-import-vddk Bound", | ||
Reason: "Bound", | ||
}, | ||
runningCondition: &cdiv1.DataVolumeCondition{ | ||
Type: cdiv1.DataVolumeRunning, | ||
Status: v1.ConditionFalse, | ||
Message: "Import Complete", | ||
Reason: "Completed", | ||
}}), | ||
) | ||
|
||
// similar to other tables but with check of quota | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,6 +189,63 @@ var _ = Describe("[rfe_id:1115][crit:high][vendor:[email protected]][level:compo | |
Expect(importer.DeletionTimestamp).To(BeNil()) | ||
} | ||
}) | ||
|
||
It("[test_id:6689]succeed importing VDDK data volume with extra arguments ConfigMap set", Label("VDDK"), func() { | ||
vddkConfigOptions := []string{ | ||
"VixDiskLib.nfcAio.Session.BufSizeIn64KB=16", | ||
"vixDiskLib.nfcAio.Session.BufCount=4", | ||
} | ||
|
||
vddkConfigMap := &v1.ConfigMap{ | ||
ObjectMeta: metav1.ObjectMeta{ | ||
Name: "vddk-extras", | ||
}, | ||
Data: map[string]string{ | ||
common.VddkArgsKeyName: strings.Join(vddkConfigOptions, "\n"), | ||
}, | ||
} | ||
|
||
_, err := f.K8sClient.CoreV1().ConfigMaps(f.Namespace.Name).Create(context.TODO(), vddkConfigMap, metav1.CreateOptions{}) | ||
if !k8serrors.IsAlreadyExists(err) { | ||
Expect(err).ToNot(HaveOccurred()) | ||
} | ||
|
||
vcenterURL := fmt.Sprintf(utils.VcenterURL, f.CdiInstallNs) | ||
dataVolume := f.CreateVddkDataVolume("import-pod-vddk-config-test", "100Mi", vcenterURL) | ||
|
||
By(fmt.Sprintf("Create new DataVolume %s", dataVolume.Name)) | ||
controller.AddAnnotation(dataVolume, controller.AnnPodRetainAfterCompletion, "true") | ||
controller.AddAnnotation(dataVolume, controller.AnnVddkExtraArgs, "vddk-extras") | ||
dataVolume, err = utils.CreateDataVolumeFromDefinition(f.CdiClient, f.Namespace.Name, dataVolume) | ||
Expect(err).ToNot(HaveOccurred()) | ||
|
||
By("Verify PVC was created") | ||
pvc, err := utils.WaitForPVC(f.K8sClient, dataVolume.Namespace, dataVolume.Name) | ||
Expect(err).ToNot(HaveOccurred()) | ||
f.ForceBindIfWaitForFirstConsumer(pvc) | ||
|
||
By("Wait for import to be completed") | ||
err = utils.WaitForDataVolumePhase(f, dataVolume.Namespace, cdiv1.Succeeded, dataVolume.Name) | ||
Expect(err).ToNot(HaveOccurred(), "DataVolume not in phase succeeded in time") | ||
|
||
By("Find importer pods after completion") | ||
pvcName := dataVolume.Name | ||
// When using populators, the PVC Prime name is used to build the importer pod | ||
if usePopulator, _ := dvc.CheckPVCUsingPopulators(pvc); usePopulator { | ||
pvcName = populators.PVCPrimeName(pvc) | ||
} | ||
By("Find importer pod " + pvcName) | ||
importer, err := utils.FindPodByPrefixOnce(f.K8sClient, dataVolume.Namespace, common.ImporterPodName, common.CDILabelSelector) | ||
Expect(err).ToNot(HaveOccurred()) | ||
Expect(importer.DeletionTimestamp).To(BeNil()) | ||
|
||
logs, err := f.RunKubectlCommand("logs", "-n", dataVolume.Namespace, importer.Name) | ||
Expect(err).To(BeNil()) | ||
for _, option := range vddkConfigOptions { | ||
By(fmt.Sprintf("Check for configuration value %s in nbdkit logs", option)) | ||
Expect(strings.Contains(logs, option)).To(BeTrue()) | ||
} | ||
}) | ||
}) | ||
|
||
var _ = Describe("[Istio] Namespace sidecar injection", Serial, func() { | ||
|
This file contains 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