Files
virtual-kubelet/vendor/github.com/vmware/vic/tests/test-cases/Group3-Docker-Compose/3-03-Docker-Compose-Basic.robot
Loc Nguyen 513cebe7b7 VMware vSphere Integrated Containers provider (#206)
* 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
2018-06-04 15:41:32 -07:00

133 lines
6.7 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 3-03 - Docker Compose Basic
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server certs=${true}
Suite Teardown Cleanup VIC Appliance On Test Server
*** Variables ***
${yml} version: "2"\nservices:\n${SPACE}web:\n${SPACE}${SPACE}image: python:2.7\n${SPACE}${SPACE}ports:\n${SPACE}${SPACE}- "5000:5000"\n${SPACE}${SPACE}depends_on:\n${SPACE}${SPACE}- redis\n${SPACE}redis:\n${SPACE}${SPACE}image: redis\n${SPACE}${SPACE}ports:\n${SPACE}${SPACE}- "5001:5001"
${link-yml} version: "2"\nservices:\n${SPACE}redis1:\n${SPACE}${SPACE}image: redis:alpine\n${SPACE}${SPACE}container_name: redis1\n${SPACE}${SPACE}ports: ["6379"]\n${SPACE}web1:\n${SPACE}${SPACE}image: busybox\n${SPACE}${SPACE}container_name: a.b.c\n${SPACE}${SPACE}links:\n${SPACE}${SPACE}- redis1:aaa\n${SPACE}${SPACE}command: ["ping", "aaa"]
${rename-yml-1} version: "2"\nservices:\n${SPACE}web:\n${SPACE}${SPACE}image: busybox\n${SPACE}${SPACE}command: ["/bin/top"]
${rename-yml-2} version: "2"\nservices:\n${SPACE}web:\n${SPACE}${SPACE}image: ubuntu\n${SPACE}${SPACE}command: ["date"]
${hello-yml} version: "2"\nservices:\n${SPACE}top:\n${SPACE}${SPACE}image: busybox\n${SPACE}${SPACE}container_name: top\n${SPACE}${SPACE}command: ["echo", "hello, world"]
*** Keywords ***
Check Compose Logs
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file link-compose.yml logs
Should Be Equal As Integers ${rc} 0
Should Contain ${output} PING aaa
Should Not Contain ${output} bad address 'aaa'
*** Test Cases ***
Compose basic
Set Environment Variable COMPOSE_HTTP_TIMEOUT 300
Run echo '${yml}' > basic-compose.yml
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} network create vic_default
Log ${output}
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file basic-compose.yml create
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file basic-compose.yml start
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file basic-compose.yml logs
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file basic-compose.yml stop
Log ${output}
Should Be Equal As Integers ${rc} 0
Compose kill
${rc} ${out}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} -f basic-compose.yml up -d
Log ${out}
Should Be Equal As Integers ${rc} 0
${rc} ${out}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} -f basic-compose.yml kill redis
Log ${out}
Should Be Equal As Integers ${rc} 0
${rc} ${out}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} -f basic-compose.yml down
Log ${out}
Should Be Equal As Integers ${rc} 0
Compose Up while another container is running (ps filtering related)
${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d busybox /bin/top
Log ${out}
Should Be Equal As Integers ${rc} 0
${rc} ${out}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} -f basic-compose.yml up -d
Log ${out}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file basic-compose.yml down
Log ${output}
Should Be Equal As Integers ${rc} 0
Compose Up with link
Run echo '${link-yml}' > link-compose.yml
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file link-compose.yml up -d
Log ${output}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 10s Check Compose Logs
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file link-compose.yml down
Log ${output}
Should Be Equal As Integers ${rc} 0
Compose bundle creation
${rc} Run And Return Rc docker-compose %{COMPOSE-PARAMS} --file basic-compose.yml pull
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file basic-compose.yml bundle
Log ${output}
Should Contain ${output} Wrote bundle
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file basic-compose.yml down
Log ${output}
Should Be Equal As Integers ${rc} 0
Compose up -d --force-recreate
Run echo '${rename-yml-1}' > compose-rename.yml
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file compose-rename.yml up -d
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file compose-rename.yml up -d --force-recreate
Log ${output}
Should Be Equal As Integers ${rc} 0
Compose up -d with a new image
Run echo '${rename-yml-2}' > compose-rename.yml
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file compose-rename.yml up -d
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} --file compose-rename.yml down
Log ${output}
Should Be Equal As Integers ${rc} 0
Compose up in foreground (attach path)
Run echo '${hello-yml}' > hello-compose.yml
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} -f hello-compose.yml pull
Should Be Equal As Integers ${rc} 0
Log ${output}
# Bring up the compose app and wait till they're up and running
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} -f hello-compose.yml up
Log ${output}
Should Contain ${output} hello, world
${rc} ${output}= Run And Return Rc And Output docker-compose %{COMPOSE-PARAMS} -f hello-compose.yml down
Log ${output}
Should Be Equal As Integers ${rc} 0