Skip to content

Commit ca6d6c8

Browse files
Vc version in the test
1 parent e8e9d25 commit ca6d6c8

File tree

107 files changed

+1163
-3821
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1163
-3821
lines changed

tests/e2e/binding_modes_with_topology.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ var _ = ginkgo.Describe("[csi-topology-vanilla] Topology-Aware-Provisioning-With
113113

114114
ginkgo.By("Expect claim to be in Bound state and provisioning volume passes")
115115
err = fpv.WaitForPersistentVolumeClaimPhase(ctx, v1.ClaimBound, client,
116-
pvclaim.Namespace, pvclaim.Name, framework.Poll, framework.ClaimProvisionTimeout)
116+
pvclaim.Namespace, pvclaim.Name, framework.Poll, time.Minute)
117117
gomega.Expect(err).NotTo(gomega.HaveOccurred(), fmt.Sprintf("Failed to provision volume with err: %v", err))
118118

119119
pv = getPvFromClaim(client, pvclaim.Namespace, pvclaim.Name)

tests/e2e/config_change_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ var _ bool = ginkgo.Describe("[csi-supervisor] config-change-test", func() {
7777
// Create Storage class and PVC
7878
ginkgo.By("Creating Storage Class and PVC")
7979
_, pvc, err := createPVCAndStorageClass(ctx, client, namespace, nil,
80-
scParameters, "", nil, "", true, "", storagePolicyName)
80+
scParameters, "", nil, "", false, "", storagePolicyName)
8181
gomega.Expect(err).NotTo(gomega.HaveOccurred())
8282

8383
ginkgo.By(fmt.Sprintf("Waiting for claim %s to be in bound phase", pvc.Name))
@@ -100,6 +100,7 @@ var _ bool = ginkgo.Describe("[csi-supervisor] config-change-test", func() {
100100
gomega.Expect(err).NotTo(gomega.HaveOccurred())
101101

102102
ginkgo.By(fmt.Sprintln("Changing password on the vCenter host"))
103+
vcAddress := e2eVSphere.Config.Global.VCenterHostname + ":" + sshdPort
103104
username := vsphereCfg.Global.User
104105
currentPassword := vsphereCfg.Global.Password
105106
newPassword := e2eTestPassword

tests/e2e/connection.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,20 +91,16 @@ func connect(ctx context.Context, vs *vSphere, forceRefresh ...bool) {
9191

9292
// newClient creates a new client for vSphere connection.
9393
func newClient(ctx context.Context, vs *vSphere) *govmomi.Client {
94-
isPrivateNetwork := GetBoolEnvVarOrDefault("IS_PRIVATE_NETWORK", false)
95-
vCenterIp := vs.Config.Global.VCenterHostname
96-
if isPrivateNetwork {
97-
vCenterIp = GetStringEnvVarOrDefault("LOCAL_HOST_IP", defaultlocalhostIP)
98-
}
9994
url, err := neturl.Parse(fmt.Sprintf("https://%s:%s/sdk",
100-
vCenterIp, vs.Config.Global.VCenterPort))
95+
vs.Config.Global.VCenterHostname, vs.Config.Global.VCenterPort))
10196
gomega.Expect(err).NotTo(gomega.HaveOccurred())
10297
url.User = neturl.UserPassword(vs.Config.Global.User, vs.Config.Global.Password)
10398
client, err := govmomi.NewClient(ctx, url, true)
10499
gomega.Expect(err).NotTo(gomega.HaveOccurred())
105100
err = client.UseServiceVersion(vsanNamespace)
106101
gomega.Expect(err).NotTo(gomega.HaveOccurred())
107102
client.RoundTripper = vim25.Retry(client.RoundTripper, vim25.TemporaryNetworkError(roundTripperDefaultCount))
103+
client.Version = cnsDevVersion
108104
return client
109105
}
110106

@@ -122,6 +118,8 @@ func connectCns(ctx context.Context, vs *vSphere) error {
122118
if vs.CnsClient == nil {
123119
vs.CnsClient, err = newCnsClient(ctx, vs.Client.Client)
124120
gomega.Expect(err).NotTo(gomega.HaveOccurred())
121+
vs.CnsClient.Version = cnsDevVersion
122+
vs.CnsClient.Client.Version = cnsDevVersion
125123
}
126124
return nil
127125
}

tests/e2e/crypto.go

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ import (
2626
"github.com/onsi/ginkgo/v2"
2727
"github.com/onsi/gomega"
2828
vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1"
29-
vmopv2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2"
3029
vmopv3 "github.com/vmware-tanzu/vm-operator/api/v1alpha3"
31-
vmopv4 "github.com/vmware-tanzu/vm-operator/api/v1alpha4"
3230
v1 "k8s.io/api/core/v1"
3331
storagev1 "k8s.io/api/storage/v1"
3432
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -120,9 +118,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
120118
}
121119
vmopScheme := runtime.NewScheme()
122120
gomega.Expect(vmopv1.AddToScheme(vmopScheme)).Should(gomega.Succeed())
123-
gomega.Expect(vmopv2.AddToScheme(vmopScheme)).Should(gomega.Succeed())
124121
gomega.Expect(vmopv3.AddToScheme(vmopScheme)).Should(gomega.Succeed())
125-
gomega.Expect(vmopv4.AddToScheme(vmopScheme)).Should(gomega.Succeed())
126122
vmopClient, err = ctlrclient.New(f.ClientConfig(), ctlrclient.Options{Scheme: vmopScheme})
127123
gomega.Expect(err).NotTo(gomega.HaveOccurred())
128124
vmImageName := GetAndExpectStringEnvVar(envVmsvcVmImageName)
@@ -156,6 +152,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
156152

157153
if isVsanHealthServiceStopped {
158154
ginkgo.By(fmt.Sprintln("Starting vsan-health on the vCenter host"))
155+
vcAddress := e2eVSphere.Config.Global.VCenterHostname + ":" + sshdPort
159156
err := invokeVCenterServiceControl(ctx, startOperation, vsanhealthServiceName, vcAddress)
160157
gomega.Expect(err).NotTo(gomega.HaveOccurred())
161158
ginkgo.By(fmt.Sprintf("Sleeping for %v seconds to allow vsan-health to come up again", vsanHealthServiceWaitTime))
@@ -173,7 +170,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
173170
3. Create PVC with EncryptionClass [2]
174171
4. Validate PVC volume [3] is encrypted with encryption key [1]
175172
*/
176-
ginkgo.It("Verify PVC is encrypted with EncryptionClass", func() {
173+
ginkgo.It("Verify PVC is encrypted with EncryptionClass", ginkgo.Label(p1, wcp, vc90), func() {
177174
ctx, cancel := context.WithCancel(context.Background())
178175
defer cancel()
179176

@@ -203,7 +200,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
203200
3. Create a PVC with encrypted StorageClass but without specifying an EncryptionClass
204201
4. Validate PVC volume [3] is encrypted with encryption key [1]
205202
*/
206-
ginkgo.It("Verify PVC is encrypted with default EncryptionClass", func() {
203+
ginkgo.It("Verify PVC is encrypted with default EncryptionClass", ginkgo.Label(p1, wcp, vc90), func() {
207204
ctx, cancel := context.WithCancel(context.Background())
208205
defer cancel()
209206

@@ -236,7 +233,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
236233
7. Update PVC with second EncryptionClass [4]
237234
8. Validate PVC volume [5] is encrypted with second encryption key [2]
238235
*/
239-
ginkgo.It("Verify PVC is recrypted when a new EncryptionClass is applied", func() {
236+
ginkgo.It("Verify PVC is recrypted when a new EncryptionClass is applied", ginkgo.Label(p1, wcp, vc90), func() {
240237
ctx, cancel := context.WithCancel(context.Background())
241238
defer cancel()
242239

@@ -283,7 +280,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
283280
7. Validate PVC volume [4] is encrypted with second encryption key [2]
284281
*/
285282
ginkgo.It("Verify PVC is recrypted when a new encryption key is applied to its "+
286-
"associated EncryptionClass", func() {
283+
"associated EncryptionClass", ginkgo.Label(p1, wcp, vc90), func() {
287284
ctx, cancel := context.WithCancel(context.Background())
288285
defer cancel()
289286

@@ -322,7 +319,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
322319
3. Create PVC with EncryptionClass [2]
323320
*/
324321
ginkgo.It("Verify PVC creation fails when associated with an EncryptionClass "+
325-
"but the StorageClass does not support encryption", func() {
322+
"but the StorageClass does not support encryption", ginkgo.Label(p1, wcp, vc90), func() {
326323

327324
ctx, cancel := context.WithCancel(context.Background())
328325
defer cancel()
@@ -357,7 +354,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
357354
5. Validate VM [4] is encrypted with encryption key [1]
358355
6. Validate PVC [3] is not encrypted
359356
*/
360-
ginkgo.It("Verify VM is encrypted with EncryptionClass while PVC is not encrypted", func() {
357+
ginkgo.It("Verify VM is encrypted with EncryptionClass while PVC is not encrypted", ginkgo.Label(p1, wcp, vc90), func() {
361358
ctx, cancel := context.WithCancel(context.Background())
362359
defer cancel()
363360

@@ -405,7 +402,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
405402
5. Validate VM [4] is encrypted with encryption key [1]
406403
6. Validate PVC [3] is encrypted with encryption key [1]
407404
*/
408-
ginkgo.It("Verify VM and associated PVC are encrypted with EncryptionClass", func() {
405+
ginkgo.It("Verify VM and associated PVC are encrypted with EncryptionClass", ginkgo.Label(p1, wcp, vc90), func() {
409406
ctx, cancel := context.WithCancel(context.Background())
410407
defer cancel()
411408

@@ -454,7 +451,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
454451
5. Validate VM [4] is encrypted with encryption key [1]
455452
6. Validate PVC [3] is encrypted with encryption key [1]
456453
*/
457-
ginkgo.It("Verify VM and associated PVC are encrypted with default EncryptionClass", func() {
454+
ginkgo.It("Verify VM and associated PVC are encrypted with default EncryptionClass", ginkgo.Label(p1, wcp, vc90), func() {
458455
ctx, cancel := context.WithCancel(context.Background())
459456
defer cancel()
460457

@@ -505,7 +502,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
505502
11. Validate PVC [5] is encrypted with second encryption key [2]
506503
12. Validate VM [6] is encrypted with first encryption key [1]
507504
*/
508-
ginkgo.It("Verify VM and attached PVC are encrypted/recrypted with different keys", func() {
505+
ginkgo.It("Verify VM and attached PVC are encrypted/recrypted with different keys", ginkgo.Label(p1, wcp, vc90), func() {
509506
ctx, cancel := context.WithCancel(context.Background())
510507
defer cancel()
511508

@@ -577,7 +574,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
577574
9. Bring vsan-service up
578575
10. Validate PVC volume [5] is encrypted with second encryption key [2]
579576
*/
580-
ginkgo.It("Verify PVC encryption when vsan-health is down", func() {
577+
ginkgo.It("Verify PVC encryption when vsan-health is down", ginkgo.Label(p1, wcp, negative, vc90), func() {
581578
ctx, cancel := context.WithCancel(context.Background())
582579
defer cancel()
583580

@@ -607,6 +604,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume encryption",
607604
validateVolumeToBeEncryptedWithKey(ctx, pvc.Spec.VolumeName, keyProviderID, keyID1)
608605

609606
ginkgo.By("7. Stop Vsan-health service")
607+
vcAddress := e2eVSphere.Config.Global.VCenterHostname + ":" + sshdPort
610608
ginkgo.By(fmt.Sprintln("Stopping vsan-health on the vCenter host"))
611609
isVsanHealthServiceStopped = true
612610
err := invokeVCenterServiceControl(ctx, stopOperation, vsanhealthServiceName, vcAddress)

tests/e2e/crypto_snapshot.go

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ import (
2727
"github.com/onsi/ginkgo/v2"
2828
"github.com/onsi/gomega"
2929
vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1"
30-
vmopv2 "github.com/vmware-tanzu/vm-operator/api/v1alpha2"
3130
vmopv3 "github.com/vmware-tanzu/vm-operator/api/v1alpha3"
32-
vmopv4 "github.com/vmware-tanzu/vm-operator/api/v1alpha4"
3331
storagev1 "k8s.io/api/storage/v1"
3432
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
3533
"k8s.io/apimachinery/pkg/runtime"
@@ -131,9 +129,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume snapshot enc
131129
}
132130
vmopScheme := runtime.NewScheme()
133131
gomega.Expect(vmopv1.AddToScheme(vmopScheme)).Should(gomega.Succeed())
134-
gomega.Expect(vmopv2.AddToScheme(vmopScheme)).Should(gomega.Succeed())
135132
gomega.Expect(vmopv3.AddToScheme(vmopScheme)).Should(gomega.Succeed())
136-
gomega.Expect(vmopv4.AddToScheme(vmopScheme)).Should(gomega.Succeed())
137133
vmopClient, err = ctlrclient.New(f.ClientConfig(), ctlrclient.Options{Scheme: vmopScheme})
138134
gomega.Expect(err).NotTo(gomega.HaveOccurred())
139135
vmImageName := GetAndExpectStringEnvVar(envVmsvcVmImageName)
@@ -177,7 +173,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume snapshot enc
177173
4. Create a dynamic volume snapshot from PVC [3]
178174
5. Create PVC with EncryptionClass [2] from snapshot [4]
179175
*/
180-
ginkgo.It("Verify PVC from snapshot is recrypted with the same EncryptionClass", func() {
176+
ginkgo.It("Verify PVC from snapshot is recrypted with the same EncryptionClass", ginkgo.Label(p1, wcp, negative, vc90), func() {
181177
ctx, cancel := context.WithCancel(context.Background())
182178
defer cancel()
183179

@@ -222,7 +218,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume snapshot enc
222218
6. Create second EncryptionClass with encryption key [5]
223219
7. Create PVC with EncryptionClass [6] from snapshot [4]
224220
*/
225-
ginkgo.It("Verify PVC from snapshot is recrypted with different EncryptionClass", func() {
221+
ginkgo.It("Verify PVC from snapshot is recrypted with different EncryptionClass", ginkgo.Label(p1, wcp, negative, vc90), func() {
226222
ctx, cancel := context.WithCancel(context.Background())
227223
defer cancel()
228224

@@ -272,7 +268,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume snapshot enc
272268
4. Create a dynamic volume snapshot from PVC [3]
273269
5. Create PVC with EncryptionClass [2] from snapshot [4]
274270
*/
275-
ginkgo.It("Verify PVC from snapshot is encrypted with EncryptionClass", func() {
271+
ginkgo.It("Verify PVC from snapshot is encrypted with EncryptionClass", ginkgo.Label(p1, wcp, negative, vc90), func() {
276272
ctx, cancel := context.WithCancel(context.Background())
277273
defer cancel()
278274

@@ -314,7 +310,7 @@ var _ = ginkgo.Describe("[csi-supervisor] [encryption] Block volume snapshot enc
314310
4. Create a dynamic volume snapshot from PVC [3]
315311
5. Create PVC without encryption from snapshot [4]
316312
*/
317-
ginkgo.It("Verify PVC from snapshot is decrypted", func() {
313+
ginkgo.It("Verify PVC from snapshot is decrypted", ginkgo.Label(p1, wcp, negative, vc90), func() {
318314
ctx, cancel := context.WithCancel(context.Background())
319315
defer cancel()
320316

tests/e2e/csi_cns_telemetry_statefulsets.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ var _ = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] [csi-supervisor]
164164
if !windowsEnv {
165165
gomega.Expect(fss.CheckMount(ctx, client, statefulset, mountPath)).NotTo(gomega.HaveOccurred())
166166
}
167-
ssPodsBeforeScaleDown, err := fss.GetPodList(ctx, client, statefulset)
168-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
167+
ssPodsBeforeScaleDown := fss.GetPodList(ctx, client, statefulset)
169168
gomega.Expect(ssPodsBeforeScaleDown.Items).NotTo(gomega.BeEmpty(),
170169
fmt.Sprintf("Unable to get list of Pods from the Statefulset: %v", statefulset.Name))
171170
gomega.Expect(len(ssPodsBeforeScaleDown.Items) == int(replicas)).To(gomega.BeTrue(),
@@ -208,8 +207,7 @@ var _ = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] [csi-supervisor]
208207
_, scaledownErr := fss.Scale(ctx, client, statefulset, replicas)
209208
gomega.Expect(scaledownErr).NotTo(gomega.HaveOccurred())
210209
fss.WaitForStatusReplicas(ctx, client, statefulset, replicas)
211-
ssPodsAfterScaleDown, err := fss.GetPodList(ctx, client, statefulset)
212-
gomega.Expect(err).NotTo(gomega.HaveOccurred())
210+
ssPodsAfterScaleDown := fss.GetPodList(ctx, client, statefulset)
213211
gomega.Expect(len(ssPodsAfterScaleDown.Items) == int(replicas)).To(gomega.BeTrue(),
214212
"Number of Pods in the statefulset should match with number of replicas")
215213
})

tests/e2e/csi_cns_telemetry_vc_reboot.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var _ bool = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] "+
4343
var (
4444
client clientset.Interface
4545
namespace string
46+
vcAddress string
4647
isVcRebooted bool
4748
)
4849
ginkgo.BeforeEach(func() {
@@ -61,8 +62,8 @@ var _ bool = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] "+
6162
// Reset the cluster distribution value to default value "CSI-Vanilla".
6263
setClusterDistribution(ctx, client, vanillaClusterDistribution)
6364
}
65+
vcAddress = e2eVSphere.Config.Global.VCenterHostname + ":" + sshdPort
6466
})
65-
6667
ginkgo.AfterEach(func() {
6768
ctx, cancel := context.WithCancel(context.Background())
6869
defer cancel()
@@ -160,7 +161,7 @@ var _ bool = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] "+
160161
err = invokeVCenterReboot(ctx, vcAddress)
161162
isVcRebooted = true
162163
gomega.Expect(err).NotTo(gomega.HaveOccurred())
163-
err = waitForHostToBeUp(vcAddress)
164+
err = waitForHostToBeUp(e2eVSphere.Config.Global.VCenterHostname)
164165
gomega.Expect(err).NotTo(gomega.HaveOccurred())
165166
ginkgo.By("Done with reboot")
166167

@@ -199,7 +200,7 @@ var _ bool = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] "+
199200
gomega.Expect(err).NotTo(gomega.HaveOccurred())
200201
}()
201202

202-
err = waitForHostToBeUp(vcAddress)
203+
err = waitForHostToBeUp(e2eVSphere.Config.Global.VCenterHostname)
203204
gomega.Expect(err).NotTo(gomega.HaveOccurred())
204205
ginkgo.By("Done with reboot")
205206
essentialServices := []string{spsServiceName, vsanhealthServiceName, vpxdServiceName}
@@ -302,7 +303,7 @@ var _ bool = ginkgo.Describe("[csi-block-vanilla] [csi-file-vanilla] "+
302303
err = invokeVCenterReboot(ctx, vcAddress)
303304
isVcRebooted = true
304305
gomega.Expect(err).NotTo(gomega.HaveOccurred())
305-
err = waitForHostToBeUp(vcAddress)
306+
err = waitForHostToBeUp(e2eVSphere.Config.Global.VCenterHostname)
306307
gomega.Expect(err).NotTo(gomega.HaveOccurred())
307308
ginkgo.By("Done with reboot")
308309
essentialServices := []string{spsServiceName, vsanhealthServiceName, vpxdServiceName}

0 commit comments

Comments
 (0)