Skip to content

Commit

Permalink
test(ci): adding volgroup test
Browse files Browse the repository at this point in the history
Signed-off-by: Abhilash Shetty <[email protected]>
  • Loading branch information
abhilashshetty04 committed Jul 1, 2024
1 parent 5ad36ef commit f5b6335
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions tests/lvm_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ func removeVg(name string) {
ginkgo.By("Removing vg")
retries := 3
current_retry := 0
force := false
args_vg := []string{
"vgremove",
name,
}
for {
if current_retry < retries {
vg_empty := vgEmpty(name)
Expand All @@ -162,21 +165,13 @@ func removeVg(name string) {
fmt.Printf("lv in vg during retry %d\n", current_retry)
}
} else {
force = true
fmt.Printf("vg still not empty after 6 seconds, moving on with force delete\n")
args_vg = append(args_vg, "-y")
break
}
current_retry += 1
time.Sleep(2 * time.Second)
}

args_vg := []string{
"vgremove",
name,
}
if force {
fmt.Printf("vg still not empty after 6 seconds, moving on with force delete\n")
args_vg = append(args_vg, "-y")
}
_, _, err_vg := execAtLocal("sudo", nil, args_vg...)
gomega.Expect(err_vg).To(gomega.BeNil(), "vg remove failed")
}
Expand Down

0 comments on commit f5b6335

Please sign in to comment.