* Add Virtual Kubelet provider for VIC Initial virtual kubelet provider for VMware VIC. This provider currently handles creating and starting of a pod VM via the VIC portlayer and persona server. Image store handling via the VIC persona server. This provider currently requires the feature/wolfpack branch of VIC. * Added pod stop and delete. Also added node capacity. Added the ability to stop and delete pod VMs via VIC. Also retrieve node capacity information from the VCH. * Cleanup and readme file Some file clean up and added a Readme.md markdown file for the VIC provider. * Cleaned up errors, added function comments, moved operation code 1. Cleaned up error handling. Set standard for creating errors. 2. Added method prototype comments for all interface functions. 3. Moved PodCreator, PodStarter, PodStopper, and PodDeleter to a new folder. * Add mocking code and unit tests for podcache, podcreator, and podstarter Used the unit test framework used in VIC to handle assertions in the provider's unit test. Mocking code generated using OSS project mockery, which is compatible with the testify assertion framework. * Vendored packages for the VIC provider Requires feature/wolfpack branch of VIC and a few specific commit sha of projects used within VIC. * Implementation of POD Stopper and Deleter unit tests (#4) * Updated files for initial PR
103 lines
2.6 KiB
Bash
Executable File
103 lines
2.6 KiB
Bash
Executable File
#!/bin/bash -e
|
|
# Copyright 2016-2018 VMware, Inc. 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.
|
|
|
|
# Run robot integration tests locally, no .yml files required.
|
|
# Set GITHUB_TOKEN once and switch environments just by changing GOVC_URL
|
|
|
|
cmd="pybot"
|
|
|
|
while getopts t: flag
|
|
do
|
|
case $flag in
|
|
# run a specific test
|
|
t)
|
|
cmd="$cmd --exclude skip -t \"$OPTARG\""
|
|
;;
|
|
esac
|
|
done
|
|
|
|
shift $((OPTIND-1))
|
|
|
|
if [ -z "$GITHUB_TOKEN" ] || [ -z "$GOVC_URL" ]; then
|
|
echo "usage: GITHUB_TOKEN=... GOVC_URL=... $0 test.robot..."
|
|
exit 1
|
|
fi
|
|
|
|
# check if govc env command works as expected
|
|
if ! govc version -require 0.9.0; then
|
|
echo "govc version must be updated"
|
|
exit 1
|
|
fi
|
|
|
|
if [ -z "$DOMAIN" ]; then
|
|
echo "DOMAIN not set, using --no-tlsverify for all tests"
|
|
fi
|
|
|
|
cd "$(git rev-parse --show-toplevel)"
|
|
|
|
tests=${*#${PWD}/}
|
|
|
|
# Create a temp drone.yml file
|
|
tempfile() {
|
|
# tempprefix=$(basename "$0")
|
|
# mktemp /tmp/${tempprefix}.yml
|
|
mktemp .tmp.drone.XXXXX.yml
|
|
# $(mktemp .tmp.drone.`date +%s`.yml)
|
|
}
|
|
|
|
cleanup() {
|
|
echo "removing temp file $tmpYml"
|
|
rm -f $tmpYml
|
|
}
|
|
tmpYml=$(tempfile)
|
|
#cleanup temp file on exit
|
|
trap cleanup EXIT
|
|
|
|
cat > $tmpYml <<CONFIG
|
|
---
|
|
workspace:
|
|
base: /go
|
|
path: src/github.com/vmware/vic
|
|
|
|
pipeline:
|
|
clone:
|
|
image: plugins/git
|
|
tags: true
|
|
# dont clone submodules
|
|
recursive: false
|
|
vic-integration-test-on-pr:
|
|
image: gcr.io/eminent-nation-87317/vic-integration-test:1.44
|
|
pull: true
|
|
environment:
|
|
GITHUB_AUTOMATION_API_KEY: $GITHUB_TOKEN
|
|
TEST_URL_ARRAY: $(govc env -x GOVC_URL_HOST)
|
|
TEST_USERNAME: $(govc env GOVC_USERNAME)
|
|
TEST_PASSWORD: $(govc env GOVC_PASSWORD)
|
|
TEST_DATASTORE: ${GOVC_DATASTORE:-$(basename "$(govc ls datastore | head -1)")}
|
|
TEST_RESOURCE: ${GOVC_RESOURCE_POOL:-$(govc ls host/*/Resources)}
|
|
BRIDGE_NETWORK: $BRIDGE_NETWORK
|
|
PUBLIC_NETWORK: $PUBLIC_NETWORK
|
|
DOMAIN: $DOMAIN
|
|
BIN: bin
|
|
GOPATH: /go
|
|
SHELL: /bin/bash
|
|
TEST_TIMEOUT: 60s
|
|
GOVC_INSECURE: true
|
|
commands:
|
|
- $cmd ${tests:-tests/test-cases}
|
|
CONFIG
|
|
|
|
drone exec --local $tmpYml
|