mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
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:
commit
42d5a1a9cd
@ -351,7 +351,6 @@ long-running-request-regexp
|
|||||||
low-diskspace-threshold-mb
|
low-diskspace-threshold-mb
|
||||||
make-iptables-util-chains
|
make-iptables-util-chains
|
||||||
make-symlinks
|
make-symlinks
|
||||||
manifest-path
|
|
||||||
manifest-url
|
manifest-url
|
||||||
manifest-url-header
|
manifest-url-header
|
||||||
masquerade-all
|
masquerade-all
|
||||||
|
@ -19,17 +19,15 @@ COPY e2e_node.test /usr/local/bin
|
|||||||
|
|
||||||
# The following environment variables can be override when starting the container.
|
# The following environment variables can be override when starting the container.
|
||||||
# FOCUS is regex matching test to run. By default run all conformance test.
|
# 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.
|
# 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.
|
# 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.
|
# 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.
|
# TEST_ARGS is the test arguments passed into the test.
|
||||||
ENV FOCUS="\[Conformance\]" \
|
ENV FOCUS="\[Conformance\]" \
|
||||||
SKIP="\[Flaky\]|\[Serial\]" \
|
SKIP="\[Flaky\]|\[Serial\]" \
|
||||||
PARALLELISM=8 \
|
PARALLELISM=8 \
|
||||||
REPORT_PATH="/var/result" \
|
REPORT_PATH="/var/result" \
|
||||||
MANIFEST_PATH="/etc/manifest" \
|
|
||||||
FLAKE_ATTEMPTS=2 \
|
FLAKE_ATTEMPTS=2 \
|
||||||
TEST_ARGS=""
|
TEST_ARGS=""
|
||||||
|
|
||||||
@ -40,5 +38,5 @@ ENTRYPOINT ginkgo --focus="$FOCUS" \
|
|||||||
/usr/local/bin/e2e_node.test \
|
/usr/local/bin/e2e_node.test \
|
||||||
-- --conformance=true \
|
-- --conformance=true \
|
||||||
--prepull-images=false \
|
--prepull-images=false \
|
||||||
--manifest-path="$MANIFEST_PATH"\
|
--report-dir="$REPORT_PATH" \
|
||||||
--report-dir="$REPORT_PATH $TEST_ARGS"
|
$TEST_ARGS
|
||||||
|
@ -56,5 +56,9 @@ endif
|
|||||||
|
|
||||||
push: build
|
push: build
|
||||||
gcloud docker push ${REGISTRY}/node-test-${ARCH}:${VERSION}
|
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
|
.PHONY: all
|
||||||
|
@ -23,9 +23,6 @@
|
|||||||
# TODO(random-liu): Use standard installer to install kubelet.
|
# TODO(random-liu): Use standard installer to install kubelet.
|
||||||
# TODO(random-liu): Use standard tool to start kubelet in production way (such
|
# TODO(random-liu): Use standard tool to start kubelet in production way (such
|
||||||
# as systemd, supervisord etc.)
|
# 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.
|
# Refresh sudo credentials if not running on GCE.
|
||||||
if ! ping -c 1 -q metadata.google.internal &> /dev/null; then
|
if ! ping -c 1 -q metadata.google.internal &> /dev/null; then
|
||||||
@ -42,6 +39,10 @@ FOCUS=${FOCUS:-""}
|
|||||||
# flaky and serial test.
|
# flaky and serial test.
|
||||||
SKIP=${SKIP:-""}
|
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 is the image registry for node test image.
|
||||||
REGISTRY=${REGISTRY:-"gcr.io/google_containers"}
|
REGISTRY=${REGISTRY:-"gcr.io/google_containers"}
|
||||||
|
|
||||||
@ -50,7 +51,7 @@ REGISTRY=${REGISTRY:-"gcr.io/google_containers"}
|
|||||||
ARCH=${ARCH:-"amd64"}
|
ARCH=${ARCH:-"amd64"}
|
||||||
|
|
||||||
# VERSION is the version of the test container image.
|
# 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
|
# KUBELET_BIN is the kubelet binary name. If it is not specified, use the
|
||||||
# default binary name "kubelet".
|
# default binary name "kubelet".
|
||||||
@ -95,7 +96,7 @@ wait_kubelet() {
|
|||||||
echo "Kubelet is ready"
|
echo "Kubelet is ready"
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
if [ $cur -eq $maxRetry]; then
|
if [ $cur -eq $maxRetry ]; then
|
||||||
echo "Health check exceeds max retry"
|
echo "Health check exceeds max retry"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@ -119,17 +120,20 @@ kill_kubelet() {
|
|||||||
run_test() {
|
run_test() {
|
||||||
env=""
|
env=""
|
||||||
if [ ! -z "$FOCUS" ]; then
|
if [ ! -z "$FOCUS" ]; then
|
||||||
env="$env -e FOCUS=$FOCUS"
|
env="$env -e FOCUS=\"$FOCUS\""
|
||||||
fi
|
fi
|
||||||
if [ ! -z "$SKIP" ]; then
|
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
|
fi
|
||||||
# The test assumes that inside the container:
|
# 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;
|
# * log collect directory is mounted to /var/result;
|
||||||
# * root file system is mounted to /rootfs.
|
# * root file system is mounted to /rootfs.
|
||||||
sudo docker run -it --rm --privileged=true --net=host -v /:/rootfs \
|
sudo sh -c "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
|
-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
|
# Check whether kubelet is running. If kubelet is running, tell the user to stop
|
||||||
|
@ -257,7 +257,10 @@ func containerGCTest(f *framework.Framework, test testRun) {
|
|||||||
|
|
||||||
// Runs containerGCTest using the docker runtime.
|
// Runs containerGCTest using the docker runtime.
|
||||||
func dockerContainerGCTest(f *framework.Framework, test testRun) {
|
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 {
|
for _, pod := range test.testPods {
|
||||||
// Initialize the getContainerNames function to use the dockertools api
|
// Initialize the getContainerNames function to use the dockertools api
|
||||||
thisPrefix := pod.containerPrefix
|
thisPrefix := pod.containerPrefix
|
||||||
|
Loading…
Reference in New Issue
Block a user