Commit 3d7c79ca authored by Marek Grabowski's avatar Marek Grabowski

Merge pull request #19836 from ixdy/jenkins-test-image-netcat

Update kubekins-test image to include netcat
parents dda29bed ad8ea35d
......@@ -42,5 +42,5 @@ docker run --rm=true \
-v "${REPO_DIR}":/go/src/k8s.io/kubernetes \
-v "${KUBE_JUNIT_REPORT_DIR}":/workspace/artifacts \
--env REPO_DIR="${REPO_DIR}" \
-i gcr.io/google_containers/kubekins-test:0.5 \
-i gcr.io/google_containers/kubekins-test:0.6 \
bash -c "cd kubernetes && ./hack/jenkins/test-dockerized.sh"
......@@ -24,8 +24,12 @@ ENV TERM xterm
WORKDIR /workspace
RUN apt-get -o Acquire::Check-Valid-Until=false update && apt-get install -y rsync
# file is used when uploading test artifacts to GCS.
RUN apt-get install -y file
# libapparmor1 is needed for docker-in-docker.
RUN apt-get install -y file libapparmor1
RUN apt-get install -y libapparmor1
# netcat is used by integration test scripts.
RUN apt-get install -y netcat-openbsd
RUN mkdir -p /go/src/k8s.io/kubernetes
RUN ln -s /go/src/k8s.io/kubernetes /workspace/kubernetes
......
all: push
TAG = 0.5
TAG = 0.6
container:
docker build -t gcr.io/google_containers/kubekins-test .
......
......@@ -50,7 +50,7 @@ kube::util::wait_for_url() {
# returns a random port
kube::util::get_random_port() {
awk -v min=1 -v max=65535 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'
awk -v min=1024 -v max=65535 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'
}
# use netcat to check if the host($1):port($2) is free (return 0 means free, 1 means used)
......@@ -65,7 +65,7 @@ kube::util::test_host_port_free() {
return ${success}
}
if [ ! $(nc -vz "${host} ${port}") ]; then
if [ ! $(nc -vz "${host}" "${port}") ]; then
kube::log::status "${host}:${port} is free, proceeding..."
return ${success}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment