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:
Ed Bartosh
2024-03-20 17:34:47 +02:00
parent a309fadbac
commit 9ce994af9f
3 changed files with 0 additions and 104 deletions

View File

@@ -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"