Skip to content

Commit 80cd997

Browse files
committed
tkg win test fix
1 parent 1100ada commit 80cd997

File tree

8 files changed

+16
-11
lines changed

8 files changed

+16
-11
lines changed

tests/e2e/constants/env_constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,4 +213,5 @@ const (
213213
EnvVmknic4Vsan = "VMKNIC_FOR_VSAN"
214214
EnvAccessMode = "ACCESS_MODE"
215215
EnvVpToCsi = "VCPTOCSI"
216+
EnvVsphereTKGSystemNamespace = "VSPHERE_TKG_SYSTEM_NAMESPACE"
216217
)

tests/e2e/constants/kubernetes.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ const (
9999
VsphereCloudProviderConfiguration = "vsphere-cloud-provider.conf"
100100
VsphereControllerManager = "vmware-system-tkg-controller-manager"
101101
VSphereCSIConf = "csi-vsphere.conf"
102-
VsphereTKGSystemNamespace = "svc-tkg-domain-c10"
103102
WcpServiceName = "wcp"
104103
VmcWcpHost = "10.2.224.24" //This is the LB IP of VMC WCP and its constant
105104
DevopsTKG = "test-cluster-e2e-script"

tests/e2e/e2e_common.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ const (
229229
vsphereCloudProviderConfiguration = "vsphere-cloud-provider.conf"
230230
vsphereControllerManager = "vmware-system-tkg-controller-manager"
231231
vSphereCSIConf = "csi-vsphere.conf"
232-
vsphereTKGSystemNamespace = "svc-tkg-domain-c10"
232+
envVsphereTKGSystemNamespace = "VSPHERE_TKG_SYSTEM_NAMESPACE"
233233
waitTimeForCNSNodeVMAttachmentReconciler = 30 * time.Second
234234
wcpServiceName = "wcp"
235235
vmcWcpHost = "10.2.224.24" //This is the LB IP of VMC WCP and its constant
@@ -349,6 +349,7 @@ const (
349349
stretchedSvc = "stretchedSvc"
350350
devops = "devops"
351351
vc901 = "vc901"
352+
multiGc = "multiGc"
352353
)
353354

354355
// The following variables are required to know cluster type to run common e2e

tests/e2e/gc_block_resize_retain_policy.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Tests with reclaimation po
126126

127127
// Replace second element with pod.Name.
128128
if windowsEnv {
129-
cmd = []string{"exec", "", "--namespace=" + namespace, "powershell.exe", "cat", "/mnt/volume1/fstype.txt"}
129+
cmd = []string{"exec", "", "--namespace=" + namespace, "--", "powershell.exe", "cat", "/mnt/volume1/fstype.txt"}
130130
} else {
131131
cmd = []string{"exec", "", "--namespace=" + namespace, "--", "/bin/sh", "-c", "df -Tkm | grep /mnt/volume1"}
132132
}
@@ -206,7 +206,8 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Tests with reclaimation po
206206
// 18. Delete PVC created in step 6.
207207
// 19. Delete PV leftover in GC.
208208
// 20. Delete SC created in step 1.
209-
ginkgo.It("PV with reclaim policy can be reused and resized with pod", ginkgo.Label(p0, block, tkg, vc70), func() {
209+
ginkgo.It("PV with reclaim policy can be reused and resized with pod", ginkgo.Label(p0, block, tkg,
210+
windows, vc70), func() {
210211
ctx, cancel := context.WithCancel(context.Background())
211212
defer cancel()
212213
// Create a Pod to use this PVC, and verify volume has been attached.
@@ -412,7 +413,7 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Tests with reclaimation po
412413
// 17. delete GC2.
413414
// Steps 6 and 17 need to run manually before and after this suite.
414415
ginkgo.It("PV with reclaim policy retain can be resized when used in a fresh GC", ginkgo.Label(p0,
415-
block, tkg, vc70), func() {
416+
block, tkg, windows, multiGc, vc70), func() {
416417
ctx, cancel := context.WithCancel(context.Background())
417418
defer cancel()
418419
newGcKubconfigPath := os.Getenv("NEW_GUEST_CLUSTER_KUBE_CONFIG")

tests/e2e/gc_block_volume_expansion.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Test", func() {
117117

118118
// Replace second element with pod.Name.
119119
if windowsEnv {
120-
cmd = []string{"exec", "", "--namespace=" + namespace, "powershell.exe", "cat", "/mnt/volume1/fstype.txt"}
120+
cmd = []string{"exec", "", "--namespace=" + namespace, "--", "powershell.exe", "cat", "/mnt/volume1/fstype.txt"}
121121
} else {
122122
cmd = []string{"exec", "", "--namespace=" + namespace, "--", "/bin/sh", "-c", "df -Tkm | grep /mnt/volume1"}
123123
}
@@ -1564,7 +1564,7 @@ var _ = ginkgo.Describe("[csi-guest] Volume Expansion Test", func() {
15641564
"exec",
15651565
pod.Name,
15661566
"--namespace=" + namespace,
1567-
"powershell.exe",
1567+
"-- powershell.exe",
15681568
"$out = New-Object byte[] 536870912; (New-Object Random).NextBytes($out); " +
15691569
"[System.IO.File]::WriteAllBytes('/mnt/volume1/testdata2.txt', $out)",
15701570
}

tests/e2e/tkgs_ha_utils.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ func verifyOnlineVolumeExpansionOnGc(client clientset.Interface, namespace strin
268268
"exec",
269269
pod.Name,
270270
"--namespace=" + namespace,
271-
"powershell.exe",
271+
"-- powershell.exe",
272272
"$out = New-Object byte[] 536870912; (New-Object Random).NextBytes($out); " +
273273
"[System.IO.File]::WriteAllBytes('/mnt/volume1/testdata2.txt', $out)",
274274
}
@@ -286,7 +286,7 @@ func verifyOnlineVolumeExpansionOnGc(client clientset.Interface, namespace strin
286286
"exec",
287287
pod.Name,
288288
"--namespace=" + namespace,
289-
"powershell.exe",
289+
"-- powershell.exe",
290290
"Copy-Item -Path '/mnt/volume1/testdata2.txt' " +
291291
"-Destination '/mnt/volume1/testdata2_pod.txt'",
292292
}
@@ -306,7 +306,7 @@ func verifyOnlineVolumeExpansionOnGc(client clientset.Interface, namespace strin
306306
"exec",
307307
pod.Name,
308308
"--namespace=" + namespace,
309-
"powershell.exe",
309+
"-- powershell.exe",
310310
"((Get-FileHash '/mnt/volume1/testdata2.txt' -Algorithm SHA256).Hash -eq " +
311311
"(Get-FileHash '/mnt/volume1/testdata2_pod.txt' -Algorithm SHA256).Hash)",
312312
}

tests/e2e/util.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,7 @@ func bringDownCsiController(Client clientset.Interface, namespace ...string) {
10671067
// bringDownTKGController helps to bring the TKG control manager pod down.
10681068
// Its taks svc client as input.
10691069
func bringDownTKGController(Client clientset.Interface) {
1070+
vsphereTKGSystemNamespace = GetAndExpectStringEnvVar(envVsphereTKGSystemNamespace)
10701071
updateDeploymentReplica(Client, 0, vsphereControllerManager, vsphereTKGSystemNamespace)
10711072
ginkgo.By("TKGControllManager replica is set to 0")
10721073
}
@@ -1089,6 +1090,7 @@ func bringUpCsiController(Client clientset.Interface, csiReplicaCount int32, nam
10891090
// bringUpTKGController helps to bring the TKG control manager pod up.
10901091
// Its taks svc client as input.
10911092
func bringUpTKGController(Client clientset.Interface, tkgReplica int32) {
1093+
vsphereTKGSystemNamespace = GetAndExpectStringEnvVar(envVsphereTKGSystemNamespace)
10921094
err := updateDeploymentReplicawithWait(Client, tkgReplica, vsphereControllerManager, vsphereTKGSystemNamespace)
10931095
gomega.Expect(err).NotTo(gomega.HaveOccurred())
10941096
ginkgo.By("TKGControllManager is up")

tests/e2e/volume_health_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ var _ = ginkgo.Describe("Volume health check", func() {
5757
isVsanHealthServiceStopped bool
5858
isSPSServiceStopped bool
5959
csiNamespace string
60+
vsphereTKGSystemNamespace string
6061
)
6162

6263
ginkgo.BeforeEach(func() {
@@ -70,6 +71,7 @@ var _ = ginkgo.Describe("Volume health check", func() {
7071
csiNamespace = GetAndExpectStringEnvVar(envCSINamespace)
7172
nodeList, err := fnodes.GetReadySchedulableNodes(ctx, f.ClientSet)
7273
datastoreURL = GetAndExpectStringEnvVar(envSharedDatastoreURL)
74+
vsphereTKGSystemNamespace = GetAndExpectStringEnvVar(envVsphereTKGSystemNamespace)
7375
framework.ExpectNoError(err, "Unable to find ready and schedulable Node")
7476
if guestCluster {
7577
svcClient, svNamespace := getSvcClientAndNamespace()
@@ -2123,7 +2125,6 @@ var _ = ginkgo.Describe("Volume health check", func() {
21232125
gcClient, err = createKubernetesClientFromConfig(k8senv)
21242126
gomega.Expect(err).NotTo(gomega.HaveOccurred())
21252127
}
2126-
21272128
tkgReplicaDeployment, err := svcClient.AppsV1().Deployments(vsphereTKGSystemNamespace).Get(ctx,
21282129
vsphereControllerManager, metav1.GetOptions{})
21292130
gomega.Expect(err).NotTo(gomega.HaveOccurred())

0 commit comments

Comments
 (0)