diff --git a/hack/jenkins/linux_integration_tests_kvm.sh b/hack/jenkins/linux_integration_tests_kvm.sh new file mode 100644 index 0000000000000000000000000000000000000000..c6f3dc8ef5690ff479d97614c1143740c6bf8c11 --- /dev/null +++ b/hack/jenkins/linux_integration_tests_kvm.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# Copyright 2016 The Kubernetes Authors All rights reserved. +# +# 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 script runs the integration tests on a Linux machine for the KVM Driver + +# The script expects the following env variabls: +# MINIKUBE_LOCATION: GIT_COMMIT from upstream build. +# COMMIT: Actual commit ID from upstream build +# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests +# access_token: The Github API access token. Injected by the Jenkins credential provider. + +set -e + +# Copy only the files we need to this workspace +mkdir -p out/ +gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-linux-amd64 out/ +gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-linux-amd64 out/ +gsutil cp -r gs://minikube-builds/${MINIKUBE_LOCATION}/testdata . + +chmod +x out/e2e-linux-amd64 +chmod +x out/minikube-linux-amd64 + +MINIKUBE_WANTREPORTERRORPROMPT=False \ + ./out/minikube-linux-amd64 delete || true + +rm -rf $HOME/.minikube || true + +# Allow this to fail, we'll switch on the return code below. +set +e +out/e2e-linux-amd64 -minikube-args="--vm-driver=kvm --cpus=4 --show-libmachine-logs --v=100 ${EXTRA_BUILD_ARGS}" -test.v -test.timeout=30m -binary=out/minikube-linux-amd64 +result=$? +set -e + +if [[ $result -eq 0 ]]; then + status="success" +else + status="failure" +fi + +set +x +target_url="https://storage.googleapis.com/minikube-builds/logs/${MINIKUBE_LOCATION}/Linux-KVM.txt" +curl "https://api.github.com/repos/kubernetes/minikube/statuses/${COMMIT}?access_token=$access_token" \ + -H "Content-Type: application/json" \ + -X POST \ + -d "{\"state\": \"$status\", \"description\": \"Jenkins\", \"target_url\": \"$target_url\", \"context\": \"Linux-KVM\"}" +set -x + +exit $result diff --git a/hack/jenkins/minikube_set_pending.sh b/hack/jenkins/minikube_set_pending.sh index ab73b8855bf0a2b0117a335df42967cd8491819d..6e5f618fcae45577d1cf7be420f2e1dfea38ec1e 100755 --- a/hack/jenkins/minikube_set_pending.sh +++ b/hack/jenkins/minikube_set_pending.sh @@ -27,7 +27,7 @@ set -e set +x -for job in "OSX-Virtualbox" "OSX-XHyve" "OSX-Virtualbox-SystemD" "Linux-Virtualbox"; do +for job in "OSX-Virtualbox" "OSX-XHyve" "OSX-Virtualbox-SystemD" "Linux-Virtualbox" "Linux-KVM"; do target_url="https://storage.googleapis.com/minikube-builds/logs/${ghprbPullId}/${job}.txt" curl "https://api.github.com/repos/kubernetes/minikube/statuses/${ghprbActualCommit}?access_token=$access_token" \ -H "Content-Type: application/json" \ diff --git a/test/integration/start_stop_delete_test.go b/test/integration/start_stop_delete_test.go index d0f352f533e74beddb4b77f9a856a40cf635ccd4..558c882c17e57b89368c5f1bc058ec15e5875e4b 100644 --- a/test/integration/start_stop_delete_test.go +++ b/test/integration/start_stop_delete_test.go @@ -22,6 +22,7 @@ import ( "net" "strings" "testing" + "time" "k8s.io/minikube/test/integration/util" ) @@ -44,6 +45,10 @@ func TestStartStop(t *testing.T) { t.Fatalf("IP command returned an invalid address: %s", ip) } + // TODO:r2d4 The KVM driver can't handle + // starting and stopping immediately + time.Sleep(30 * time.Second) + runner.RunCommand("stop", true) runner.CheckStatus("Stopped")