Skip to content

Commit

Permalink
Address failed PR checks
Browse files Browse the repository at this point in the history
  • Loading branch information
falfaroc committed Dec 5, 2024
1 parent 559f607 commit c86b87c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 28 deletions.
25 changes: 13 additions & 12 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ func (f *feature) createZoneSnapshotsAndRestore(location string) error {
for i := 0; i < int(f.zoneReplicaCount); i++ {
time.Sleep(10 * time.Second)

copyFile := exec.Command("cp", templateFile, updatedTemplateFile)
b, err := copyFile.CombinedOutput()
cpCmd := "cp " + templateFile + " " + updatedTemplateFile
b, err := execLocalCommand(cpCmd)
if err != nil {
return fmt.Errorf("failed to copy template file: %v\nErrMessage:\n%s", err, string(b))
}
Expand Down Expand Up @@ -382,8 +382,8 @@ func (f *feature) deleteZoneSnapshotsAndRestore(location string) error {
for i := 0; i < int(f.zoneReplicaCount); i++ {
time.Sleep(10 * time.Second)

copyFile := exec.Command("cp", templateFile, updatedTemplateFile)
b, err := copyFile.CombinedOutput()
cpCmd := "cp " + templateFile + " " + updatedTemplateFile
b, err := execLocalCommand(cpCmd)
if err != nil {
return fmt.Errorf("failed to copy template file: %v\nErrMessage:\n%s", err, string(b))
}
Expand Down Expand Up @@ -438,10 +438,11 @@ func (f *feature) areAllRestoresRunning() error {
if runningCount != int(f.zoneReplicaCount) {
time.Sleep(10 * time.Second)
continue
} else {
complete = true
break
}

complete = true
break

}

if !complete {
Expand All @@ -451,12 +452,12 @@ func (f *feature) areAllRestoresRunning() error {
return nil
}

func replaceInFile(old, new, templateFile string) error {
cmdString := "s|" + old + "|" + new + "|g"
cmd := exec.Command("sed", "-i", cmdString, templateFile)
err := cmd.Run()
func replaceInFile(oldString, newString, templateFile string) error {
cmdString := "s|" + oldString + "|" + newString + "|g"
replaceCmd := fmt.Sprintf("sed -i '%s' %s", cmdString, templateFile)
_, err := execLocalCommand(replaceCmd)
if err != nil {
return fmt.Errorf("failed to substitute %s with %s in file %s: %s", old, new, templateFile, err.Error())
return fmt.Errorf("failed to substitute %s with %s in file %s: %s", oldString, newString, templateFile, err.Error())
}
return nil
}
Expand Down
32 changes: 16 additions & 16 deletions test/e2e/templates/zone-wait/snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ metadata:
namespace: vxflexos-test
spec:
containers:
- name: busybox
image: quay.io/quay/busybox:latest
command: ["/bin/sleep", "3600"]
volumeMounts:
- mountPath: "/data0"
name: multi-az-pvc
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "200m"
memory: "256Mi"
- name: busybox
image: quay.io/quay/busybox:latest
command: ["/bin/sleep", "3600"]
volumeMounts:
- mountPath: "/data0"
name: multi-az-pvc
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "200m"
memory: "256Mi"
volumes:
- name: multi-az-pvc
persistentVolumeClaim:
claimName: snapshot-maz-pvcITERATION
- name: multi-az-pvc
persistentVolumeClaim:
claimName: snapshot-maz-pvcITERATION

0 comments on commit c86b87c

Please sign in to comment.