Skip to content

Commit

Permalink
Add container used to run e2e test in Prow
Browse files Browse the repository at this point in the history
  • Loading branch information
Xuewei Zhang committed Aug 10, 2019
1 parent 7fa4f40 commit a85fd36
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/e2e/containers/prow-npd-e2e/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM gcr.io/k8s-testimages/kubekins-e2e:v20190607-c90971a-master

RUN go get github.com/onsi/ginkgo/ginkgo

RUN apt-get update
RUN apt-get install -y libsystemd-dev

ADD script.sh /script.sh
RUN chmod a+x /script.sh

CMD ["/script.sh"]
30 changes: 30 additions & 0 deletions test/e2e/containers/prow-npd-e2e/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Build the container which Prow uses to run NPD e2e tests.

IMAGE=gcr.io/gke-prow/prow-npd-e2e:live

all: push

container:
docker build --pull -t ${IMAGE} .

push: container
gcloud docker -- push ${IMAGE}

test: container
docker run --rm --entrypoint=/script.sh ${IMAGE}

.PHONY: all container push
43 changes: 43 additions & 0 deletions test/e2e/containers/prow-npd-e2e/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#!/bin/bash

# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This scripts clones a NPD repository, and then runs NPD e2e test from it.

set -o errexit
set -o pipefail
set -u
set -x

test() {
git clone https://github.com/kubernetes/node-problem-detector.git

pushd node-problem-detector

ZONE=us-central1-a PROJECT=xueweiz-experimental \
VM_IMAGE=cos-73-11647-217-0 IMAGE_PROJECT=cos-cloud \
SSH_USER=${USER} SSH_KEY=${JENKINS_GCE_SSH_PRIVATE_KEY_FILE} \
make e2e-test

popd
rm -rf node-problem-detector
}

main() {
runner.sh echo "Running NPD e2e test."
test "$@"
}

main "$@"

0 comments on commit a85fd36

Please sign in to comment.