mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
Add test, after restart dbus, should be able to gracefully shutdown
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user