mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Add test, after restart dbus, should be able to gracefully shutdown
This commit is contained in:
parent
9c59e6c85f
commit
990d0949c4
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user