From 2f07831eb4f01a04d4c5ca15e2bbc517befe8774 Mon Sep 17 00:00:00 2001 From: YZ775 Date: Mon, 23 Oct 2023 05:19:13 +0000 Subject: [PATCH] add mtest Signed-off-by: YZ775 --- mtest/reboot_test.go | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mtest/reboot_test.go b/mtest/reboot_test.go index 30488232..04c1d1cd 100644 --- a/mtest/reboot_test.go +++ b/mtest/reboot_test.go @@ -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()) @@ -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))