Change:
xref: Graceful node shutdown test uses to invoke dbus - As per some distros, don't have installed so the test must be skipped in those environments. We should consider if we can switch to use or perhaps and fall back to to ensure the test can work across more distros.
/sig node
/sig testing
/remove-kind bug /kind feature I'm putting kind feature to signify that nothing is really broken in k8s, tests needs improvement.
/remove-sig testing This dbus command should be up to SIG node, though tentatively: /triage accepted
/area test
Do we actually have these other distros available to prevent regressions if we change that?
/assign
the change will be to replace skip logic when is missing to use an alternative way to send this. So there will be no regression on distros where it currently runs without the skip. Original bug should have a link to job that was failing
I would like to work on improving the command. Am I understanding correct here We have to change to logic where we skip to use busctl instead. Could you please give me some idea on how can we make it to use , some similar examples in the repo would be really useful.
please have a look at The issue is that the command available is too old and doesn't include .
I see, it looks like we are not just adding a condition for instead we are replacing it with . It looks you are already working on it. Please inform if I can help in anyway. Thanks for the response.
Both are possible... it was easier to get a CI signal if that was used in all cases. I might put the condition later. I am waiting for comments in the PR, but feel free to propose other solutions that might work with older systemd versions.

Discussion:
"context" "fmt" "os" <del> "os/exec" </del> "path/filepath" <del> "strconv" </del> "time" "k8s.io/apimachinery/pkg/fields"

"k8s.io/kubernetes/pkg/apis/scheduling" "k8s.io/kubernetes/test/e2e/framework" <ins> "github.com/godbus/dbus/v5" </ins> v1 "k8s.io/api/core/v1" schedulingv1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/kubernetes/pkg/features" kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config" kubelettypes "k8s.io/kubernetes/pkg/kubelet/types" <del> e2eskipper "k8s.io/kubernetes/test/e2e/framework/skipper" </del> testutils "k8s.io/kubernetes/test/utils" )

}) ginkgo.BeforeEach(func() { <del> if err := lookEmitSignalCommand(); err != nil { e2eskipper.Skipf("skipping test because: %v", err) return } </del> ginkgo.By("Wait for the node to be ready") waitForNodeReady() })

}) ginkgo.BeforeEach(func() { <del> if err := lookEmitSignalCommand(); err != nil { e2eskipper.Skipf("skipping test because: %v", err) return } </del> ginkgo.By("Wait for the node to be ready") waitForNodeReady()

// Emits a fake PrepareForShutdown dbus message on system dbus. Will cause kubelet to react to an active shutdown event. func emitSignalPrepareForShutdown(b bool) error { <del> cmd := "dbus-send --system /org/freedesktop/login1 org.freedesktop.login1.Manager.PrepareForShutdown boolean:" + strconv.FormatBool(b) _, err := runCommand("sh", "-c", cmd) return err } func lookEmitSignalCommand() error { _, err := exec.LookPath("dbus-send") return err </del> <ins> conn, err := dbus.ConnectSystemBus() if err != nil { return err } defer conn.Close() return conn.Emit("/org/freedesktop/login1", "org.freedesktop.login1.Manager.PrepareForShutdown", b) </ins> } func getNodeReadyStatus(f *framework.Framework) bool {