Merge pull request #37392 from Random-Liu/final-cleanup-for-nct

Automatic merge from submit-queue

Node Conformance Test: Final cleanup for node conformance test.

This PR fits node conformance test with recent change.
* Remove `--manifest-path` because the test will get kubelet configuration through `/configz` now. https://github.com/kubernetes/kubernetes/pull/36919
* Add `$TEST_ARGS` so that we can override arguments inside the container.
* Fix a bug in garbage_collector_test.go which will cause the framework tries to connect docker no matter running the test or not. @dashpole 
* Add `${REGISTRY}/node-test:${VERSION}` for convenience. 
* Bump up the image version to `0.2`. (the one released with v1.4 is `v0.1`)

I've run the test both with `run_test.sh` script and directly `docker run`. Both of them passed.

After this gets merged, I'll build and push the new test image.

@dchen1107 
/cc @kubernetes/sig-node
This commit is contained in:
Kubernetes Submit Queue 2016-11-29 22:39:52 -08:00 committed by GitHub
commit 42d5a1a9cd
5 changed files with 25 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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