Fixe verify bazel

Remove rootfs and chroot in scripts
This commit is contained in:
Harry Zhang 2016-10-25 15:11:06 +08:00
parent 64c8d3ad3d
commit fad1990eaa
4 changed files with 16 additions and 34 deletions

View File

@ -13,28 +13,8 @@ load(
go_library( go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"bindata.go",
"main.go", "main.go",
":bindata",
],
)
genrule(
name = "bindata",
srcs = [
"//examples:sources",
"//test/images:sources",
"//test/fixtures:sources",
"//test/e2e/testing-manifests:sources",
],
outs = ["bindata.go"],
cmd = """
$(location //vendor:github.com/jteeuwen/go-bindata/go-bindata) \
-nometadata -o "$(OUTS)" -pkg generated \
-prefix $$(pwd) \
-ignore .jpg -ignore .png -ignore .md \
$(SRCS)
""",
tools = [
"//vendor:github.com/jteeuwen/go-bindata/go-bindata",
], ],
tags = ["automanaged"],
) )

View File

@ -60,6 +60,7 @@ go_test(
"image_id_test.go", "image_id_test.go",
"kubelet_test.go", "kubelet_test.go",
"lifecycle_hook_test.go", "lifecycle_hook_test.go",
"log_path_test.go",
"memory_eviction_test.go", "memory_eviction_test.go",
"mirror_pod_test.go", "mirror_pod_test.go",
"resource_usage_test.go", "resource_usage_test.go",
@ -76,8 +77,10 @@ go_test(
"//pkg/api/unversioned:go_default_library", "//pkg/api/unversioned:go_default_library",
"//pkg/client/cache:go_default_library", "//pkg/client/cache:go_default_library",
"//pkg/client/clientset_generated/internalclientset:go_default_library", "//pkg/client/clientset_generated/internalclientset:go_default_library",
"//pkg/kubelet:go_default_library",
"//pkg/kubelet/api/v1alpha1/stats:go_default_library", "//pkg/kubelet/api/v1alpha1/stats:go_default_library",
"//pkg/kubelet/cm:go_default_library", "//pkg/kubelet/cm:go_default_library",
"//pkg/kubelet/container:go_default_library",
"//pkg/kubelet/dockertools:go_default_library", "//pkg/kubelet/dockertools:go_default_library",
"//pkg/kubelet/images:go_default_library", "//pkg/kubelet/images:go_default_library",
"//pkg/kubelet/metrics:go_default_library", "//pkg/kubelet/metrics:go_default_library",

View File

@ -36,10 +36,7 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() {
podClient := f.PodClient() podClient := f.PodClient()
ns := f.Namespace.Name ns := f.Namespace.Name
rootfsDirVolumeName := "docker-dir-vol" logDirVolumeName := "log-dir-vol"
rootfsDir := "/root"
rootDir := "/"
logDir := kubelet.ContainerLogsDir logDir := kubelet.ContainerLogsDir
logPodName := "logger-" + string(uuid.NewUUID()) logPodName := "logger-" + string(uuid.NewUUID())
@ -65,7 +62,7 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() {
} }
podClient.Create(logPod) podClient.Create(logPod)
err := framework.WaitForPodSuccessInNamespace(f.Client, logPodName, ns) err := framework.WaitForPodSuccessInNamespace(f.ClientSet, logPodName, ns)
framework.ExpectNoError(err, "Failed waiting for pod: %s to enter success state", logPodName) framework.ExpectNoError(err, "Failed waiting for pod: %s to enter success state", logPodName)
// get containerID from created Pod // get containerID from created Pod
@ -86,13 +83,14 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() {
{ {
Image: "gcr.io/google_containers/busybox:1.24", Image: "gcr.io/google_containers/busybox:1.24",
Name: checkContName, Name: checkContName,
// if we find expected log file and contains right content, exit 0 // If we find expected log file and contains right content, exit 0
// else, keep checking until test timeout // else, keep checking until test timeout
Command: []string{"sh", "-c", "chroot " + rootfsDir + " while true; do if [ -e " + expectedlogFile + " ] && grep -q " + logString + " " + expectedlogFile + "; then exit 0; fi; sleep 1; done"}, Command: []string{"sh", "-c", "while true; do if [ -e " + expectedlogFile + " ] && grep -q " + logString + " " + expectedlogFile + "; then exit 0; fi; sleep 1; done"},
VolumeMounts: []api.VolumeMount{ VolumeMounts: []api.VolumeMount{
{ {
Name: rootfsDirVolumeName, Name: logDirVolumeName,
MountPath: rootfsDir, // mount ContainerLogsDir to the same path in container
MountPath: expectedlogFile,
ReadOnly: true, ReadOnly: true,
}, },
}, },
@ -100,10 +98,10 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() {
}, },
Volumes: []api.Volume{ Volumes: []api.Volume{
{ {
Name: rootfsDirVolumeName, Name: logDirVolumeName,
VolumeSource: api.VolumeSource{ VolumeSource: api.VolumeSource{
HostPath: &api.HostPathVolumeSource{ HostPath: &api.HostPathVolumeSource{
Path: rootDir, Path: expectedlogFile,
}, },
}, },
}, },
@ -112,7 +110,7 @@ var _ = framework.KubeDescribe("ContainerLogPath", func() {
} }
podClient.Create(checkPod) podClient.Create(checkPod)
err = framework.WaitForPodSuccessInNamespace(f.Client, checkPodName, ns) err = framework.WaitForPodSuccessInNamespace(f.ClientSet, checkPodName, ns)
framework.ExpectNoError(err, "Failed waiting for pod: %s to enter success state", checkPodName) framework.ExpectNoError(err, "Failed waiting for pod: %s to enter success state", checkPodName)
}) })
}) })

View File

@ -40,6 +40,7 @@ Container Runtime Conformance Test container runtime conformance blackbox test w
Container Runtime Conformance Test container runtime conformance blackbox test when starting a container that exits should report termination message if TerminationMessagePath is set,timothysc,1 Container Runtime Conformance Test container runtime conformance blackbox test when starting a container that exits should report termination message if TerminationMessagePath is set,timothysc,1
DNS horizontal autoscaling kube-dns-autoscaler should scale kube-dns pods in both nonfaulty and faulty scenarios,MrHohn,0 DNS horizontal autoscaling kube-dns-autoscaler should scale kube-dns pods in both nonfaulty and faulty scenarios,MrHohn,0
DNS horizontal autoscaling kube-dns-autoscaler should scale kube-dns pods when cluster size changed,MrHohn,0 DNS horizontal autoscaling kube-dns-autoscaler should scale kube-dns pods when cluster size changed,MrHohn,0
ContainerLogPath Pod with a container printed log to stdout should print log to correct log path,resouer,0
DNS should provide DNS for ExternalName services,rmmh,1 DNS should provide DNS for ExternalName services,rmmh,1
DNS should provide DNS for pods for Hostname and Subdomain Annotation,mtaufen,1 DNS should provide DNS for pods for Hostname and Subdomain Annotation,mtaufen,1
DNS should provide DNS for services,roberthbailey,1 DNS should provide DNS for services,roberthbailey,1

1 name owner auto-assigned
40 Container Runtime Conformance Test container runtime conformance blackbox test when starting a container that exits should report termination message if TerminationMessagePath is set timothysc 1
41 DNS horizontal autoscaling kube-dns-autoscaler should scale kube-dns pods in both nonfaulty and faulty scenarios MrHohn 0
42 DNS horizontal autoscaling kube-dns-autoscaler should scale kube-dns pods when cluster size changed MrHohn 0
43 ContainerLogPath Pod with a container printed log to stdout should print log to correct log path resouer 0
44 DNS should provide DNS for ExternalName services rmmh 1
45 DNS should provide DNS for pods for Hostname and Subdomain Annotation mtaufen 1
46 DNS should provide DNS for services roberthbailey 1