Skip to content

Commit

Permalink
add mtest
Browse files Browse the repository at this point in the history
Signed-off-by: YZ775 <[email protected]>
  • Loading branch information
YZ775 committed Oct 23, 2023
1 parent 28bd282 commit 2f07831
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion mtest/reboot_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,22 @@ func testRebootOperations() {
rebootQueueAdd([]string{node1})
rebootShouldNotProceed()

By("checking backoff behavior")
entries, err := getRebootEntries()
Expect(err).ShouldNot(HaveOccurred())
Expect(entries).Should(HaveLen(1))
Expect(entries[0].DrainBackOffCount).Should(Not(BeZero()))
ckecliSafe("reboot-queue", "disable")

By("resetting backoff")
ckecliSafe("reboot-queue", "reset-backoff")
entries, err = getRebootEntries()
Expect(err).ShouldNot(HaveOccurred())
Expect(entries).Should(HaveLen(1))
Expect(entries[0].DrainBackOffCount).Should(BeZero())
Expect(entries[0].DrainBackOffExpire).Should(BeZero())
ckecliSafe("reboot-queue", "enable")

cluster.Reboot.BootCheckCommand = originalBootCheckCommand
_, err = ckecliClusterSet(cluster)
Expect(err).ShouldNot(HaveOccurred())
Expand All @@ -154,7 +170,7 @@ func testRebootOperations() {
ckecliSafe("reboot-queue", "disable")
rebootQueueAdd([]string{node1})
ckecliSafe("reboot-queue", "cancel", fmt.Sprintf("%d", currentWriteIndex-1))
entries, err := getRebootEntries()
entries, err = getRebootEntries()
Expect(err).ShouldNot(HaveOccurred())
Expect(entries).Should(HaveLen(1))
Expect(entries[0].Status).To(Equal(cke.RebootStatusCancelled))
Expand Down

0 comments on commit 2f07831

Please sign in to comment.