Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promote kubelet NodeConformance tests to Conformance #69021

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions test/conformance/testdata/conformance.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ test/e2e/common/init_container.go: "should invoke init containers on a RestartNe
test/e2e/common/init_container.go: "should invoke init containers on a RestartAlways pod"
test/e2e/common/init_container.go: "should not start app containers if init containers fail on a RestartAlways pod"
test/e2e/common/init_container.go: "should not start app containers and fail the pod if init containers fail on a RestartNever pod"
test/e2e/common/kubelet.go: "should print the output to logs"
test/e2e/common/kubelet.go: "should have an terminated reason"
test/e2e/common/kubelet.go: "should be possible to delete"
test/e2e/common/kubelet.go: "should write entries to /etc/hosts"
test/e2e/common/kubelet.go: "should not write to root filesystem"
test/e2e/common/kubelet_etc_hosts.go: "should test kubelet managed /etc/hosts file"
test/e2e/common/lifecycle_hook.go: "should execute poststart exec hook properly"
test/e2e/common/lifecycle_hook.go: "should execute prestop exec hook properly"
Expand Down
32 changes: 26 additions & 6 deletions test/e2e/common/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ var _ = framework.KubeDescribe("Kubelet", func() {
podName := "busybox-scheduling-" + string(uuid.NewUUID())

/*
Release : v1.9
Release : v1.13
Testname: Kubelet, log output, default
Description: By default the stdout and stderr from the process being executed in a pod MUST be sent to the pod's logs.
*/
It("should print the output to logs [NodeConformance]", func() {
framework.ConformanceIt("should print the output to logs [NodeConformance]", func() {
podClient.CreateSync(&v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
Expand Down Expand Up @@ -98,7 +98,12 @@ var _ = framework.KubeDescribe("Kubelet", func() {
})
})

It("should have an terminated reason [NodeConformance]", func() {
/*
Release : v1.13
Testname: Kubelet, failed pod, terminated reason
Description: Create a Pod with terminated state. Pod MUST have only one container. Container MUST be in terminated state and MUST have an terminated reason.
*/
framework.ConformanceIt("should have an terminated reason [NodeConformance]", func() {
Eventually(func() error {
podData, err := podClient.Get(podName, metav1.GetOptions{})
if err != nil {
Expand All @@ -118,15 +123,25 @@ var _ = framework.KubeDescribe("Kubelet", func() {
}, time.Minute, time.Second*4).Should(BeNil())
})

It("should be possible to delete [NodeConformance]", func() {
/*
Release : v1.13
Testname: Kubelet, failed pod, delete
Description: Create a Pod with terminated state. This terminated pod MUST be able to be deleted.
*/
framework.ConformanceIt("should be possible to delete [NodeConformance]", func() {
err := podClient.Delete(podName, &metav1.DeleteOptions{})
Expect(err).To(BeNil(), fmt.Sprintf("Error deleting Pod %v", err))
})
})
Context("when scheduling a busybox Pod with hostAliases", func() {
podName := "busybox-host-aliases" + string(uuid.NewUUID())

It("should write entries to /etc/hosts [NodeConformance]", func() {
/*
Release : v1.13
Testname: Kubelet, hostAliases
Description: Create a Pod with hostAliases and a container with command to output /etc/hosts entries. Pod's logs MUST have matching entries of specified hostAliases to the output of /etc/hosts entries.
*/
framework.ConformanceIt("should write entries to /etc/hosts [NodeConformance]", func() {
podClient.CreateSync(&v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Name: podName,
Expand Down Expand Up @@ -171,7 +186,12 @@ var _ = framework.KubeDescribe("Kubelet", func() {
Context("when scheduling a read only busybox container", func() {
podName := "busybox-readonly-fs" + string(uuid.NewUUID())

It("should not write to root filesystem [NodeConformance]", func() {
/*
Release : v1.13
Testname: Kubelet, pod with read only root file system
Description: Create a Pod with security context set with ReadOnlyRootFileSystem set to true. The Pod then tries to write to the /file on the root, write operation to the root filesystem MUST fail as expected.
*/
framework.ConformanceIt("should not write to root filesystem [NodeConformance]", func() {
isReadOnly := true
podClient.CreateSync(&v1.Pod{
ObjectMeta: metav1.ObjectMeta{
Expand Down