Add test, after restart dbus, should be able to gracefully shutdown

This commit is contained in:
Shiming Zhang 2021-03-19 16:08:08 +08:00
parent 9c59e6c85f
commit 990d0949c4

View File

@ -178,6 +178,24 @@ var _ = SIGDescribe("GracefulNodeShutdown [Serial] [NodeAlphaFeature:GracefulNod
return nil
}, nodeStatusUpdateTimeout, pollInterval).Should(gomega.BeNil())
})
ginkgo.It("after restart dbus, should be able to gracefully shutdown", func() {
ginkgo.By("Restart Dbus")
err := restartDbus()
framework.ExpectNoError(err)
ginkgo.By("Emitting Shutdown signal")
err = emitSignalPrepareForShutdown(true)
framework.ExpectNoError(err)
gomega.Eventually(func() error {
isReady := getNodeReadyStatus(f)
if isReady {
return fmt.Errorf("node did not become shutdown as expected")
}
return nil
}, nodeStatusUpdateTimeout, pollInterval).Should(gomega.BeNil())
})
})
})
@ -237,3 +255,9 @@ func getNodeReadyStatus(f *framework.Framework) bool {
framework.ExpectEqual(len(nodeList.Items), 1)
return isNodeReady(&nodeList.Items[0])
}
func restartDbus() error {
cmd := "systemctl restart dbus"
_, err := runCommand("sh", "-c", cmd)
return err
}