diff --git a/hack/verify-flags/known-flags.txt b/hack/verify-flags/known-flags.txt index 7197d287344..b482d30356c 100644 --- a/hack/verify-flags/known-flags.txt +++ b/hack/verify-flags/known-flags.txt @@ -351,7 +351,6 @@ long-running-request-regexp low-diskspace-threshold-mb make-iptables-util-chains make-symlinks -manifest-path manifest-url manifest-url-header masquerade-all diff --git a/test/e2e_node/conformance/build/Dockerfile b/test/e2e_node/conformance/build/Dockerfile index 8e490331f54..7424cc9e727 100644 --- a/test/e2e_node/conformance/build/Dockerfile +++ b/test/e2e_node/conformance/build/Dockerfile @@ -19,17 +19,15 @@ COPY e2e_node.test /usr/local/bin # The following environment variables can be override when starting the container. # FOCUS is regex matching test to run. By default run all conformance test. -# SKIP is regex matching test to skip. By default empty. +# SKIP is regex matching test to skip. By default skip flaky and serial test. # PARALLELISM is the number of processes the test will run in parallel. # REPORT_PATH is the path in the container to save test result and logs. -# MANIFEST_PATH is the kubelet manifest path in the container. # FLAKE_ATTEMPTS is the time to retry when there is a test failure. By default 2. # TEST_ARGS is the test arguments passed into the test. ENV FOCUS="\[Conformance\]" \ SKIP="\[Flaky\]|\[Serial\]" \ PARALLELISM=8 \ REPORT_PATH="/var/result" \ - MANIFEST_PATH="/etc/manifest" \ FLAKE_ATTEMPTS=2 \ TEST_ARGS="" @@ -40,5 +38,5 @@ ENTRYPOINT ginkgo --focus="$FOCUS" \ /usr/local/bin/e2e_node.test \ -- --conformance=true \ --prepull-images=false \ - --manifest-path="$MANIFEST_PATH"\ - --report-dir="$REPORT_PATH $TEST_ARGS" + --report-dir="$REPORT_PATH" \ + $TEST_ARGS diff --git a/test/e2e_node/conformance/build/Makefile b/test/e2e_node/conformance/build/Makefile index 2ac003f747b..5b8ec5e92f2 100644 --- a/test/e2e_node/conformance/build/Makefile +++ b/test/e2e_node/conformance/build/Makefile @@ -56,5 +56,9 @@ endif push: build gcloud docker push ${REGISTRY}/node-test-${ARCH}:${VERSION} +ifeq ($(ARCH),amd64) + docker tag ${REGISTRY}/node-test-${ARCH}:${VERSION} ${REGISTRY}/node-test:${VERSION} + gcloud docker -- push ${REGISTRY}/node-test:${VERSION} +endif .PHONY: all diff --git a/test/e2e_node/conformance/run_test.sh b/test/e2e_node/conformance/run_test.sh index a1ad7af0f5c..c70603066ef 100755 --- a/test/e2e_node/conformance/run_test.sh +++ b/test/e2e_node/conformance/run_test.sh @@ -23,9 +23,6 @@ # TODO(random-liu): Use standard installer to install kubelet. # TODO(random-liu): Use standard tool to start kubelet in production way (such # as systemd, supervisord etc.) -# TODO(random-liu): Initialize kubelet with standard configmap after dynamic -# configuration landing, so that all test could get the current kubelet -# configuration and react accordingly. # Refresh sudo credentials if not running on GCE. if ! ping -c 1 -q metadata.google.internal &> /dev/null; then @@ -42,6 +39,10 @@ FOCUS=${FOCUS:-""} # flaky and serial test. SKIP=${SKIP:-""} +# TEST_ARGS is the test arguments. It could be used to override default test +# arguments in the container. +TEST_ARGS=${TEST_ARGS:-""} + # REGISTRY is the image registry for node test image. REGISTRY=${REGISTRY:-"gcr.io/google_containers"} @@ -50,7 +51,7 @@ REGISTRY=${REGISTRY:-"gcr.io/google_containers"} ARCH=${ARCH:-"amd64"} # VERSION is the version of the test container image. -VERSION=${VERSION:-"0.1"} +VERSION=${VERSION:-"0.2"} # KUBELET_BIN is the kubelet binary name. If it is not specified, use the # default binary name "kubelet". @@ -95,7 +96,7 @@ wait_kubelet() { echo "Kubelet is ready" break fi - if [ $cur -eq $maxRetry]; then + if [ $cur -eq $maxRetry ]; then echo "Health check exceeds max retry" exit 1 fi @@ -119,17 +120,20 @@ kill_kubelet() { run_test() { env="" if [ ! -z "$FOCUS" ]; then - env="$env -e FOCUS=$FOCUS" + env="$env -e FOCUS=\"$FOCUS\"" fi if [ ! -z "$SKIP" ]; then - env="$env -e SKIP=$SKIP" + env="$env -e SKIP=\"$SKIP\"" + fi + if [ ! -z "$TEST_ARGS" ]; then + env="$env -e TEST_ARGS=\"$TEST_ARGS\"" fi # The test assumes that inside the container: - # * kubelet manifest path is mounted to /etc/manifest; + # * kubelet manifest path is mounted to the same path; # * log collect directory is mounted to /var/result; # * root file system is mounted to /rootfs. - sudo docker run -it --rm --privileged=true --net=host -v /:/rootfs \ - -v $config_dir:/etc/manifest -v $LOG_DIR:/var/result $env $REGISTRY/node-test-$ARCH:$VERSION + sudo sh -c "docker run -it --rm --privileged=true --net=host -v /:/rootfs \ + -v $config_dir:$config_dir -v $LOG_DIR:/var/result ${env} $REGISTRY/node-test-$ARCH:$VERSION" } # Check whether kubelet is running. If kubelet is running, tell the user to stop diff --git a/test/e2e_node/garbage_collector_test.go b/test/e2e_node/garbage_collector_test.go index 5287b1956e4..3a6ab5bea42 100644 --- a/test/e2e_node/garbage_collector_test.go +++ b/test/e2e_node/garbage_collector_test.go @@ -257,7 +257,10 @@ func containerGCTest(f *framework.Framework, test testRun) { // Runs containerGCTest using the docker runtime. func dockerContainerGCTest(f *framework.Framework, test testRun) { - runtime := docker.ConnectToDockerOrDie(defaultDockerEndpoint, defaultRuntimeRequestTimeoutDuration) + var runtime docker.DockerInterface + BeforeEach(func() { + runtime = docker.ConnectToDockerOrDie(defaultDockerEndpoint, defaultRuntimeRequestTimeoutDuration) + }) for _, pod := range test.testPods { // Initialize the getContainerNames function to use the dockertools api thisPrefix := pod.containerPrefix