Skip to content

Commit

Permalink
vsan stretch automation for TKG, WCP and VMService VMs
Browse files Browse the repository at this point in the history
  • Loading branch information
Aishwarya-Hebbar committed Nov 21, 2024
1 parent 5e42551 commit 35f6fd3
Show file tree
Hide file tree
Showing 10 changed files with 4,692 additions and 3,212 deletions.
1 change: 0 additions & 1 deletion tests/e2e/csi_static_provisioning_basic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2430,5 +2430,4 @@ var _ = ginkgo.Describe("Basic Static Provisioning", func() {
gomega.Expect(err).NotTo(gomega.HaveOccurred())

})

})
68 changes: 36 additions & 32 deletions tests/e2e/e2e_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,38 +277,42 @@ customPort -> label include the testcases running on vCenter custom port <VC:444
deprecated ->label include the testcases which are no longer in execution
*/
const (
flaky = "flaky"
disruptive = "disruptive"
wcp = "wcp"
tkg = "tkg"
vanilla = "vanilla"
preferential = "preferential"
vsphereConfigSecret = "vsphereConfigSecret"
snapshot = "snapshot"
stable = "stable"
newTest = "newTest"
multiVc = "multiVc"
block = "block"
file = "file"
core = "core"
hci = "hci"
p0 = "p0"
p1 = "p1"
p2 = "p2"
vsanStretch = "vsanStretch"
longRunning = "longRunning"
deprecated = "deprecated"
vmc = "vmc"
tkgsHA = "tkgsHA"
thickThin = "thickThin"
customPort = "customPort"
windows = "windows"
semiAutomated = "semiAutomated"
level2 = "level2"
level5 = "level5"
negative = "negative"
listVolume = "listVolume"
multiSvc = "multiSvc"
flaky = "flaky"
disruptive = "disruptive"
wcp = "wcp"
tkg = "tkg"
vanilla = "vanilla"
preferential = "preferential"
vsphereConfigSecret = "vsphereConfigSecret"
snapshot = "snapshot"
stable = "stable"
newTest = "newTest"
multiVc = "multiVc"
block = "block"
file = "file"
core = "core"
hci = "hci"
p0 = "p0"
p1 = "p1"
p2 = "p2"
vsanStretch = "vsanStretch"
longRunning = "longRunning"
deprecated = "deprecated"
vmc = "vmc"
tkgsHA = "tkgsHA"
thickThin = "thickThin"
customPort = "customPort"
windows = "windows"
semiAutomated = "semiAutomated"
level2 = "level2"
level5 = "level5"
negative = "negative"
listVolume = "listVolume"
multiSvc = "multiSvc"
primaryCentric = "primaryCentric"
controlPlaneOnPrimary = "controlPlaneOnPrimary"
distributed = "distributed"
vmsvc = "vmsvc"
)

// The following variables are required to know cluster type to run common e2e
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/hci_mesh_rwx_disruptive.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ var _ = ginkgo.Describe("[rwx-hci-singlevc-disruptive] RWX-Topology-HciMesh-Sing

ginkgo.By("PSOD all host in remote cluster4 and when psod is triggered, create new set of rwx pvc")
for i := 0; i < len(hostListCluster4); i++ {
err = psodHost(hostListCluster4[i])
err = psodHost(hostListCluster4[i], "")
gomega.Expect(err).NotTo(gomega.HaveOccurred())

if i == 0 {
Expand Down Expand Up @@ -729,7 +729,7 @@ var _ = ginkgo.Describe("[rwx-hci-singlevc-disruptive] RWX-Topology-HciMesh-Sing
ginkgo.By("PSOD again all host in remote cluster4 and perform scaleup " +
"operation on deployment and statefulset")
for i := 0; i < len(hostListCluster4); i++ {
err = psodHost(hostListCluster4[i])
err = psodHost(hostListCluster4[i], "")
gomega.Expect(err).NotTo(gomega.HaveOccurred())

if i == 0 {
Expand Down Expand Up @@ -1873,7 +1873,7 @@ var _ = ginkgo.Describe("[rwx-hci-singlevc-disruptive] RWX-Topology-HciMesh-Sing

ginkgo.By("PSOD all host in local cluster2 and when psod is triggered, create new set of rwx pvc")
for i := 0; i < len(hostListCluster2); i++ {
err = psodHost(hostListCluster2[i])
err = psodHost(hostListCluster2[i], "")
gomega.Expect(err).NotTo(gomega.HaveOccurred())

if i == 0 {
Expand Down Expand Up @@ -1929,7 +1929,7 @@ var _ = ginkgo.Describe("[rwx-hci-singlevc-disruptive] RWX-Topology-HciMesh-Sing
ginkgo.By("PSOD all host in local cluster3 and perform scaleup " +
"operation on deployment and statefulset")
for i := 0; i < len(hostListCluster3); i++ {
err = psodHost(hostListCluster3[i])
err = psodHost(hostListCluster3[i], "")
gomega.Expect(err).NotTo(gomega.HaveOccurred())

if i == 0 {
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/no_hci_mesh_rwx_singlevc_topology_disruptive.go
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ var _ = ginkgo.Describe("[rwx-nohci-singlevc-disruptive] RWX-Topology-NoHciMesh-

ginkgo.By("PSOD all host")
for i := 0; i < len(hostList); i++ {
err = psodHost(hostList[i])
err = psodHost(hostList[i], "")
gomega.Expect(err).NotTo(gomega.HaveOccurred())

if i == 2 {
Expand Down
16 changes: 11 additions & 5 deletions tests/e2e/rwx_topology_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -893,18 +893,24 @@ func verifyK8sNodeStatusAfterSiteRecovery(client clientset.Interface, ctx contex
}

/* This util will perform psod operation on a host */
func psodHost(hostIP string) error {
func psodHost(hostIP string, psodTimeOut string) error {
ginkgo.By("PSOD")
sshCmd := fmt.Sprintf("vsish -e set /config/Misc/intOpts/BlueScreenTimeout %s", psodTime)
op, err := runCommandOnESX("root", hostIP, sshCmd)
var timeout string
if psodTimeOut != "" {
timeout = psodTimeOut
} else {
timeout = psodTime
}
sshCmd := fmt.Sprintf("vsish -e set /config/Misc/intOpts/BlueScreenTimeout %s", timeout)
op, err := runCommandOnESX(rootUser, hostIP, sshCmd)
framework.Logf(op)
if err != nil {
return fmt.Errorf("failed to set BlueScreenTimeout: %w", err)
}

ginkgo.By("Injecting PSOD")
psodCmd := "vsish -e set /reliability/crashMe/Panic 1"
op, err = runCommandOnESX("root", hostIP, psodCmd)
psodCmd := "vsish -e set /reliability/crashMe/Panic 1; exit"
op, err = runCommandOnESX(rootUser, hostIP, psodCmd)
framework.Logf(op)
if err != nil {
return fmt.Errorf("failed to inject PSOD: %w", err)
Expand Down
12 changes: 1 addition & 11 deletions tests/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3621,18 +3621,8 @@ func psodHostWithPv(ctx context.Context, vs *vSphere, pvName string) string {
framework.Logf("hostIP %v", hostIP)
gomega.Expect(hostIP).NotTo(gomega.BeEmpty())

ginkgo.By("PSOD")
sshCmd := fmt.Sprintf("vsish -e set /config/Misc/intOpts/BlueScreenTimeout %s", psodTime)
op, err := runCommandOnESX("root", hostIP, sshCmd)
framework.Logf(op)
err := psodHost(hostIP, "")
gomega.Expect(err).NotTo(gomega.HaveOccurred())

ginkgo.By("Injecting PSOD ")
psodCmd := "vsish -e set /reliability/crashMe/Panic 1"
op, err = runCommandOnESX("root", hostIP, psodCmd)
framework.Logf(op)
gomega.Expect(err).ShouldNot(gomega.HaveOccurred())

return hostIP
}

Expand Down
Loading

0 comments on commit 35f6fd3

Please sign in to comment.