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 6, 2024
1 parent 5e42551 commit 5ce54a4
Show file tree
Hide file tree
Showing 8 changed files with 1,996 additions and 347 deletions.
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 5ce54a4

Please sign in to comment.