Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions test/extended/node/node_e2e/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

g "github.com/onsi/ginkgo/v2"
o "github.com/onsi/gomega"

exutil "github.com/openshift/origin/test/extended/util"
"k8s.io/apimachinery/pkg/util/wait"
e2e "k8s.io/kubernetes/test/e2e/framework"
Expand All @@ -16,20 +17,20 @@ var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager",
oc = exutil.NewCLIWithoutNamespace("node").AsAdmin()
)

g.BeforeEach(func() {
isMicroShift, err := exutil.IsMicroShiftCluster(oc.AdminKubeClient())
o.Expect(err).NotTo(o.HaveOccurred())
if isMicroShift {
g.Skip("Skipping test on MicroShift cluster")
}
})

//author: asahay@redhat.com
g.It("[OTP] validate KUBELET_LOG_LEVEL", func() {
var kubeservice string
var kublet string
var err error

isMicroShift, err := exutil.IsMicroShiftCluster(oc.AdminKubeClient())
if err != nil {
o.Expect(err).NotTo(o.HaveOccurred(), "error determining if running on MicroShift: %v", err)
}
if isMicroShift {
g.Skip("This test case is not supported in micoshift cluster ")
}

g.By("Polling to check kubelet log level on ready nodes")
waitErr := wait.Poll(10*time.Second, 1*time.Minute, func() (bool, error) {
g.By("Getting all node names in the cluster")
Expand Down Expand Up @@ -74,4 +75,20 @@ var _ = g.Describe("[sig-node] [Jira:Node/Kubelet] Kubelet, CRI-O, CPU manager",
}
o.Expect(waitErr).NotTo(o.HaveOccurred(), "KUBELET_LOG_LEVEL is not expected, timed out")
})

//author: cmaurya@redhat.com
g.It("[OTP] validate cgroupv2 is default", func() {
g.By("1) Check cgroup version")
workerNode, err := oc.AsAdmin().WithoutNamespace().Run("get").Args("nodes", "-l", "node-role.kubernetes.io/worker", "-o=jsonpath={.items[0].metadata.name}").Output()
o.Expect(err).NotTo(o.HaveOccurred())
cgroupV, err := oc.AsAdmin().WithoutNamespace().Run("debug").Args("node/"+workerNode, "-ndefault", "--", "chroot", "/host", "/bin/bash", "-c", "stat -c %T -f /sys/fs/cgroup").Output()
o.Expect(err).NotTo(o.HaveOccurred())
e2e.Logf("cgroup version info is: [%v]\n", cgroupV)
o.Expect(strings.Contains(cgroupV, "cgroup2fs")).Should(o.BeTrue())

g.By("2) Changing cgroup from v2 to v1 should result in error")
output, err := oc.AsAdmin().WithoutNamespace().Run("patch").Args("nodes.config.openshift.io", "cluster", "-p", `{"spec": {"cgroupMode": "v1"}}`, "--type=merge").Output()
o.Expect(err).Should(o.HaveOccurred())
o.Expect(strings.Contains(output, "Unsupported value: \"v1\"")).Should(o.BeTrue())
})
})