mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-03 03:38:15 +00:00
e2e_node: remove Dbus test case
The test case restarts dbus and systemd, which is considered dangerous practice and caused slowdown of the test cases for CRI-O Serial jobs.
This commit is contained in:
@@ -24,7 +24,6 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"time"
|
||||
@@ -652,44 +651,6 @@ func getNodeReadyStatus(ctx context.Context, f *framework.Framework) bool {
|
||||
return isNodeReady(&nodeList.Items[0])
|
||||
}
|
||||
|
||||
func systemctlDaemonReload() error {
|
||||
cmd := "systemctl daemon-reload"
|
||||
_, err := runCommand("sh", "-c", cmd)
|
||||
return err
|
||||
}
|
||||
|
||||
var (
|
||||
dbusConfPath = "/etc/systemd/system/dbus.service.d/k8s-graceful-node-shutdown-e2e.conf"
|
||||
dbusConf = `
|
||||
[Unit]
|
||||
RefuseManualStart=no
|
||||
RefuseManualStop=no
|
||||
[Service]
|
||||
KillMode=control-group
|
||||
ExecStop=
|
||||
`
|
||||
)
|
||||
|
||||
func overlayDbusConfig() error {
|
||||
err := os.MkdirAll(filepath.Dir(dbusConfPath), 0755)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = os.WriteFile(dbusConfPath, []byte(dbusConf), 0644)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return systemctlDaemonReload()
|
||||
}
|
||||
|
||||
func restoreDbusConfig() error {
|
||||
err := os.Remove(dbusConfPath)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return systemctlDaemonReload()
|
||||
}
|
||||
|
||||
const (
|
||||
// https://github.com/kubernetes/kubernetes/blob/1dd781ddcad454cc381806fbc6bd5eba8fa368d7/pkg/kubelet/nodeshutdown/nodeshutdown_manager_linux.go#L43-L44
|
||||
podShutdownReason = "Terminated"
|
||||
|
||||
Reference in New Issue
Block a user