Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tests/e2e/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -7025,8 +7025,17 @@ func checkVcServicesHealthPostReboot(ctx context.Context, host string, timeout .
addr := ip + ":" + portNum

//list of default stopped services in VC
var defaultStoppedServicesList = []string{"vc-salt", "vmcam", "vmware-imagebuilder", "vmware-netdumper",
"vmware-rbd-watchdog", "vmware-vcha"}
baseServices := []string{"vmcam", "vmware-imagebuilder", "vmware-netdumper", "vmware-rbd-watchdog", "vmware-vcha"}

var defaultStoppedServicesList []string

if isVersionGreaterOrEqual(getVCversion(ctx, vcAddress), batchAttachSupportedVCVersion) {
// Combine the new services with the base ones
defaultStoppedServicesList = append([]string{"liagent", "vc-salt"}, baseServices...)
} else {
defaultStoppedServicesList = baseServices
}

waitErr := wait.PollUntilContextTimeout(ctx, pollTimeoutShort, pollTime, true,
func(ctx context.Context) (bool, error) {
var pendingServiceslist []string
Expand Down
34 changes: 28 additions & 6 deletions tests/e2e/volume_health_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ var _ = ginkgo.Describe("Volume health check", func() {
isSPSServiceStopped bool
csiNamespace string
vsphereTKGSystemNamespace string
isBatchAttachSupported bool
crdName string
)

ginkgo.BeforeEach(func() {
Expand All @@ -81,6 +83,11 @@ var _ = ginkgo.Describe("Volume health check", func() {
framework.Failf("Unable to find ready and schedulable Node")
}
isVsanHealthServiceStopped = false
isBatchAttachSupported = isVersionGreaterOrEqual(getVCversion(ctx, vcAddress), batchAttachSupportedVCVersion)
crdName = crdCNSNodeVMAttachment
if isBatchAttachSupported {
crdName = crdCNSNodeVMBatchAttachment
}
})

ginkgo.AfterEach(func() {
Expand Down Expand Up @@ -1178,8 +1185,13 @@ var _ = ginkgo.Describe("Volume health check", func() {
svcPVCName := volumeID
volumeID = getVolumeIDFromSupervisorCluster(svcPVCName)
gomega.Expect(volumeID).NotTo(gomega.BeEmpty())
verifyCRDInSupervisor(ctx, f, sspod.Spec.NodeName+"-"+svcPVCName,
crdCNSNodeVMAttachment, crdVersion, crdGroup, true)
expectedInstanceName := sspod.Spec.NodeName + "-" + svcPVCName
if isBatchAttachSupported {
expectedInstanceName = sspod.Spec.NodeName
}
verifyCRDInSupervisor(ctx, f, expectedInstanceName, crdName, crdVersion, crdGroup, true)
// verifyCRDInSupervisor(ctx, f, sspod.Spec.NodeName+"-"+svcPVCName,
// crdCNSNodeVMAttachment, crdVersion, crdGroup, true)

ginkgo.By(fmt.Sprintf("Verify volume: %s is attached to the node: %s",
pv.Spec.CSI.VolumeHandle, sspod.Spec.NodeName))
Expand Down Expand Up @@ -2331,8 +2343,13 @@ var _ = ginkgo.Describe("Volume health check", func() {
svcPVCName := volumeID
volumeID = getVolumeIDFromSupervisorCluster(svcPVCName)
gomega.Expect(volumeID).NotTo(gomega.BeEmpty())
verifyCRDInSupervisor(ctx, f, sspod.Spec.NodeName+"-"+svcPVCName,
crdCNSNodeVMAttachment, crdVersion, crdGroup, true)
expectedInstanceName := sspod.Spec.NodeName + "-" + svcPVCName
if isBatchAttachSupported {
expectedInstanceName = sspod.Spec.NodeName
}
verifyCRDInSupervisor(ctx, f, expectedInstanceName, crdName, crdVersion, crdGroup, true)
// verifyCRDInSupervisor(ctx, f, sspod.Spec.NodeName+"-"+svcPVCName,
// crdCNSNodeVMAttachment, crdVersion, crdGroup, true)

ginkgo.By("Expect health status of the pvc to be accessible")
pvc, err := client.CoreV1().PersistentVolumeClaims(namespace).Get(ctx,
Expand Down Expand Up @@ -2972,8 +2989,13 @@ var _ = ginkgo.Describe("Volume health check", func() {
svcPVCName := volumeID
volumeID = getVolumeIDFromSupervisorCluster(svcPVCName)
gomega.Expect(volumeID).NotTo(gomega.BeEmpty())
verifyCRDInSupervisor(ctx, f, sspod.Spec.NodeName+"-"+svcPVCName,
crdCNSNodeVMAttachment, crdVersion, crdGroup, true)
expectedInstanceName := sspod.Spec.NodeName + "-" + svcPVCName
if isBatchAttachSupported {
expectedInstanceName = sspod.Spec.NodeName
}
verifyCRDInSupervisor(ctx, f, expectedInstanceName, crdName, crdVersion, crdGroup, true)
// verifyCRDInSupervisor(ctx, f, sspod.Spec.NodeName+"-"+svcPVCName,
// crdCNSNodeVMAttachment, crdVersion, crdGroup, true)

ginkgo.By("Expect health status of the pvc to be accessible")
pvc, err := client.CoreV1().PersistentVolumeClaims(namespace).Get(ctx,
Expand Down