Add SELinux security context to ContainerLogPath test

Signed-off-by: Harshal Patil <harpatil@redhat.com>
This commit is contained in:
Harshal Patil 2021-04-21 13:48:32 +05:30
parent 1c9563d5d5
commit df13eebfd0

View File

@ -18,6 +18,7 @@ package e2enode
import (
"context"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
@ -74,7 +75,12 @@ var _ = SIGDescribe("ContainerLogPath [NodeConformance]", func() {
Containers: []v1.Container{
{
Image: busyboxImage,
Name: podName,
SecurityContext: &v1.SecurityContext{
SELinuxOptions: &v1.SELinuxOptions{
Type: "container_logreader_t",
},
},
Name: podName,
// If we find expected log file and contains right content, exit 0
// else, keep checking until test timeout
Command: []string{"sh", "-c", "while true; do if [ -e " + expectedLogPath + " ] && grep -q " + log + " " + expectedLogPath + "; then exit 0; fi; sleep 1; done"},