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

Update kubekins-test image to include netcat
This commit is contained in:
Marek Grabowski 2016-01-21 17:43:32 +01:00
commit 3d7c79ca03
4 changed files with 9 additions and 5 deletions

View File

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

View File

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

View File

@ -1,6 +1,6 @@
all: push
TAG = 0.5
TAG = 0.6
container:
docker build -t gcr.io/google_containers/kubekins-test .

View File

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