Skip to content

Commit

Permalink
Test: Fix storage lane
Browse files Browse the repository at this point in the history
Test "[Serial]without fsgroup support should succesfully start"
does need to use a privileged Pod with a namespace. This mean
the namespace sets if test suite can create a privileged pod
when we are running with PSA enabled.

This commit is just moving the pvc and vmi into privileged
namespace.

Signed-off-by: L. Pivarc <[email protected]>
  • Loading branch information
xpivarc committed Feb 2, 2023
1 parent d57564e commit 388add9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/storage/datavolume.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@ var _ = SIGDescribe("DataVolume Integration", func() {
libdv.WithForceBindAnnotation(),
)

dv, err = virtClient.CdiClient().CdiV1beta1().DataVolumes(testsuite.GetTestNamespace(nil)).Create(context.Background(), dv, metav1.CreateOptions{})
dv, err = virtClient.CdiClient().CdiV1beta1().DataVolumes(testsuite.NamespacePrivileged).Create(context.Background(), dv, metav1.CreateOptions{})
Expect(err).ToNot(HaveOccurred())
var pvc *k8sv1.PersistentVolumeClaim
Eventually(func() *k8sv1.PersistentVolumeClaim {
pvc, err = virtClient.CoreV1().PersistentVolumeClaims(testsuite.GetTestNamespace(dv)).Get(context.Background(), dv.Name, metav1.GetOptions{})
pvc, err = virtClient.CoreV1().PersistentVolumeClaims(testsuite.NamespacePrivileged).Get(context.Background(), dv.Name, metav1.GetOptions{})
if err != nil {
return nil
}
Expand All @@ -201,6 +201,7 @@ var _ = SIGDescribe("DataVolume Integration", func() {
tests.ChangeImgFilePermissionsToNonQEMU(pvc)

vmi := tests.NewRandomVMIWithDataVolume(dv.Name)
vmi.Namespace = testsuite.NamespacePrivileged

By("Starting the VirtualMachineInstance")
vmi = tests.RunVMIAndExpectLaunch(vmi, 120)
Expand Down

0 comments on commit 388add9

Please sign in to comment.