* 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
135 lines
6.5 KiB
Plaintext
135 lines
6.5 KiB
Plaintext
# Copyright 2016-2017 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
|
|
|
|
*** Settings ***
|
|
Documentation Test 9-01 - VICAdmin ShowHTML
|
|
Resource ../../resources/Util.robot
|
|
Suite Setup Install VIC Appliance To Test Server certs=${false}
|
|
Suite Teardown Cleanup VIC Appliance On Test Server
|
|
Default Tags
|
|
|
|
*** Keywords ***
|
|
Login And Save Cookies
|
|
[Tags] secret
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/authentication -XPOST -F username=%{TEST_USERNAME} -F password=%{TEST_PASSWORD} -D /tmp/cookies-%{VCH-NAME}
|
|
Should Be Equal As Integers ${rc} 0
|
|
|
|
*** Test Cases ***
|
|
Get Login Page
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/authentication
|
|
Should contain ${output} <title>VCH Admin</title>
|
|
|
|
While Logged Out Fail To Display HTML
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}
|
|
Should not contain ${output} <title>VIC: %{VCH-NAME}</title>
|
|
Should Contain ${output} <a href="/authentication">See Other</a>.
|
|
|
|
While Logged Out Fail To Get Portlayer Log
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/port-layer.log
|
|
Should Not Contain ${output} Launching portlayer server
|
|
Should Contain ${output} <a href="/authentication">See Other</a>.
|
|
|
|
While Logged Out Fail To Get VCH-Init Log
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/init.log
|
|
Should not contain ${output} reaping child processes
|
|
Should Contain ${output} <a href="/authentication">See Other</a>.
|
|
|
|
While Logged Out Fail To Get Docker Personality Log
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/docker-personality.log
|
|
Should not contain ${output} docker personality
|
|
Should Contain ${output} <a href="/authentication">See Other</a>.
|
|
|
|
While Logged Out Fail To Get Container Logs
|
|
${rc} ${output}= Run And Return Rc and Output docker %{VCH-PARAMS} pull ${busybox}
|
|
Should Be Equal As Integers ${rc} 0
|
|
Should Not Contain ${output} Error
|
|
${rc} ${container}= Run And Return Rc and Output docker %{VCH-PARAMS} create ${busybox} /bin/top
|
|
Should Be Equal As Integers ${rc} 0
|
|
Should Not Contain ${container} Error
|
|
${rc} ${output}= Run And Return Rc and Output docker %{VCH-PARAMS} start ${container}
|
|
Should Be Equal As Integers ${rc} 0
|
|
Should Not Contain ${output} Error
|
|
${rc} ${output}= Run And Return Rc and Output curl -sk %{VIC-ADMIN}/container-logs.tar.gz | tar tvzf -
|
|
Should not Be Equal As Integers ${rc} 0
|
|
Should Contain ${output} gzip: stdin: not in gzip format
|
|
Log ${output}
|
|
Should not Contain ${output} ${container}/vmware.log
|
|
Should not Contain ${output} ${container}/tether.debug
|
|
|
|
While Logged Out Fail To Get VICAdmin Log
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/vicadmin.log
|
|
Log ${output}
|
|
Should not contain ${output} Launching vicadmin pprof server
|
|
Should Contain ${output} <a href="/authentication">See Other</a>.
|
|
|
|
Display HTML
|
|
Login And Save Cookies
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN} -b /tmp/cookies-%{VCH-NAME}
|
|
Should contain ${output} <title>VIC: %{VCH-NAME}</title>
|
|
|
|
Get Portlayer Log
|
|
Login And Save Cookies
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/port-layer.log -b /tmp/cookies-%{VCH-NAME}
|
|
Should contain ${output} Launching portlayer server
|
|
|
|
Get VCH-Init Log
|
|
Login And Save Cookies
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/init.log -b /tmp/cookies-%{VCH-NAME}
|
|
Should contain ${output} reaping child processes
|
|
|
|
Get Docker Personality Log
|
|
Login And Save Cookies
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/docker-personality.log -b /tmp/cookies-%{VCH-NAME}
|
|
Should contain ${output} docker personality
|
|
|
|
Get Container Logs
|
|
Login And Save Cookies
|
|
${rc} ${output}= Run And Return Rc and Output docker %{VCH-PARAMS} pull ${busybox}
|
|
Should Be Equal As Integers ${rc} 0
|
|
Should Not Contain ${output} Error
|
|
${rc} ${container}= Run And Return Rc and Output docker %{VCH-PARAMS} create ${busybox} /bin/top
|
|
Should Be Equal As Integers ${rc} 0
|
|
Should Not Contain ${container} Error
|
|
${rc} ${output}= Run And Return Rc and Output docker %{VCH-PARAMS} start ${container}
|
|
Log ${output}
|
|
Should Be Equal As Integers ${rc} 0
|
|
Should Not Contain ${output} Error
|
|
${vmName}= Get VM Display Name ${container}
|
|
${rc} ${output}= Run And Return Rc and Output curl -sk %{VIC-ADMIN}/container-logs.tar.gz -b /tmp/cookies-%{VCH-NAME} | (cd /tmp; tar xvzf - ${vmName}/tether.debug ${vmName}/vmware.log)
|
|
Log ${output}
|
|
${rc} ${output}= Run And Return Rc and Output ls -l /tmp/${vmName}/vmware.log
|
|
Should Be Equal As Integers ${rc} 0
|
|
${rc} ${output}= Run And Return Rc and Output ls -l /tmp/${vmName}/tether.debug
|
|
Should Be Equal As Integers ${rc} 0
|
|
${rc} ${output}= Run And Return Rc and Output grep 'prepping for switch to container filesystem' /tmp/${vmName}/tether.debug
|
|
Should Be Equal As Integers ${rc} 0
|
|
Run rm -f /tmp/${vmName}/tether.debug /tmp/${vmName}/vmware.log
|
|
|
|
Get VICAdmin Log
|
|
Login And Save Cookies
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/vicadmin.log -b /tmp/cookies-%{VCH-NAME}
|
|
Log ${output}
|
|
Should contain ${output} Launching vicadmin pprof server
|
|
|
|
Check that VIC logs do not contain sensitive data
|
|
Scrape Logs For The Password
|
|
|
|
Wan Routes Through Proxy
|
|
Cleanup VIC Appliance On Test Server
|
|
Install VIC Appliance To Test Server certs=${false} additional-args=--http-proxy=http://0.0.0.0:12345
|
|
|
|
Login And Save Cookies
|
|
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN} -b /tmp/cookies-%{VCH-NAME}
|
|
Should contain ${output} <div class="sixty">Registry and Internet Connectivity<span class="error-message">
|