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
This commit is contained in:
Loc Nguyen
2018-06-04 15:41:32 -07:00
committed by Ria Bhatia
parent 98a111e8b7
commit 513cebe7b7
6296 changed files with 1123685 additions and 8 deletions

View File

@@ -0,0 +1,26 @@
Test 22-01 - nginx
=======
# Purpose:
To verify that the nginx application on docker hub works as expected on VIC
# References:
[1 - Docker Hub nginx Official Repository](https://hub.docker.com/_/nginx/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run an nginx container in the background and verify the server is up and running:
`docker run --name nginx1 -d nginx`
3. Run an nginx container in the background with a mapped port:
`docker run --name nginx2 -d -p 8080:80 nginx`
4. Run an nginx container in the background with a mapped content folder from a volume:
`docker run --name nginx3 -v /some/content:/usr/share/nginx/html:ro -d nginx`
# Expected Outcome:
* Each step should succeed, nginx should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,56 @@
# Copyright 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 22-01 - nginx
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Curl nginx endpoint
[Arguments] ${endpoint}
${rc} ${output}= Run And Return Rc And Output curl ${endpoint}
Should Be Equal As Integers ${rc} 0
[Return] ${output}
*** Test Cases ***
Simple background nginx
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name nginx1 -d ${nginx}
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container nginx1
Remove File index.html*
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run ${busybox} sh -c "wget ${ip} && cat index.html"
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Welcome to nginx!
Nginx with port mapping
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name nginx2 -d -p 8080:80 ${nginx}
Log ${output}
Should Be Equal As Integers ${rc} 0
${output}= Wait Until Keyword Succeeds 10x 10s Curl nginx endpoint %{VCH-IP}:8080
Should Contain ${output} Welcome to nginx!
Nginx with a mapped volume folder
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name=vol1
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -v vol1:/mydata ${busybox} sh -c "echo '<p>HelloWorld</p>' > /mydata/test.html"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name nginx3 -v vol1:/usr/share/nginx/html:ro -d -p 8081:80 ${nginx}
Log ${output}
Should Be Equal As Integers ${rc} 0
${output}= Wait Until Keyword Succeeds 10x 10s Curl nginx endpoint %{VCH-IP}:8081/test.html
Should Contain ${output} HelloWorld

View File

@@ -0,0 +1,25 @@
Test 22-02 - redis
=======
# Purpose:
To verify that the redis application on docker hub works as expected on VIC
# References:
[1 - Docker Hub redis Official Repository](https://hub.docker.com/_/redis/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run a redis container in the background and verify that it is working:
`docker run --name some-redis -d redis`
3. Run a redis client container that connects to the redis server
4. Run a redis container in the background with appendonly option and verify that it is working:
`docker run --name some-redis -d redis redis-server --appendonly yes`
# Expected Outcome:
* Each step should succeed, redis should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,42 @@
# Copyright 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 22-02 - redis
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Simple background redis
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name redis1 -d ${redis}
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container redis1
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run ${redis} sh -c "redis-cli -h ${ip} -p 6379 ping"
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} PONG
Redis with appendonly option
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name redis2 -d ${redis} redis-server --appendonly yes
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container redis2
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run ${redis} sh -c "redis-cli -h ${ip} -p 6379 info"
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} redis_mode:standalone
Should Contain ${output} executable:/data/redis-server

View File

@@ -0,0 +1,22 @@
Test 22-03 - registry
=======
# Purpose:
To verify that the registry application on docker hub works as expected on VIC
# References:
[1 - Docker Hub registry Official Repository](https://hub.docker.com/_/registry/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run a registry container in the background and verify that it is working:
`docker run -d -p 5000:5000 --restart always --name registry registry:2`
# Expected Outcome:
* Each step should succeed, registry should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,33 @@
# Copyright 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 22-03 - registry
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Check docker logs for terms
[Arguments] ${container} ${terms}
${output}= Run docker %{VCH-PARAMS} logs ${container}
Should Contain ${output} ${terms}
*** Test Cases ***
Simple background registry
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -p 5000:5000 --restart always --name registry1 registry:2
Log ${output}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 10s Check docker logs for terms registry1 listening on [::]:5000
# TODO: need push to really verify this application properly

View File

@@ -0,0 +1,22 @@
Test 22-04 - mysql
=======
# Purpose:
To verify that the mysql application on docker hub works as expected on VIC
# References:
[1 - Docker Hub mysql Official Repository](https://hub.docker.com/_/mysql/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run a mysql container in the background and verify that it is working:
`docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql`
# Expected Outcome:
* Each step should succeed, mysql should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,36 @@
# Copyright 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 22-04 - mysql
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Check mysql container
[Arguments] ${ip}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --rm mysql sh -c 'mysql -h${ip} -P3306 -uroot -ppassword1 -e "show databases;"'
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} information_schema
Should Contain ${output} performance_schema
*** Test Cases ***
Simple background mysql
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name mysql1 -e MYSQL_ROOT_PASSWORD=password1 -d mysql
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container mysql1
Wait Until Keyword Succeeds 5x 6s Check mysql container ${ip}

View File

@@ -0,0 +1,22 @@
Test 22-05 - mongo
=======
# Purpose:
To verify that the mongo application on docker hub works as expected on VIC
# References:
[1 - Docker Hub mongo Official Repository](https://hub.docker.com/_/mongo/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run a mongo container in the background and verify that it is working:
`docker run --name mongo1 -d mongo`
# Expected Outcome:
* Each step should succeed, mongo should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,36 @@
# Copyright 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 22-05 - mongo
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Check mongo container
[Arguments] ${ip}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --rm mongo sh -c 'mongo "${ip}/27017" --quiet --eval "db.adminCommand( { listDatabases: 1 } )"'
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} "name" : "admin"
Should Contain ${output} "name" : "local"
*** Test Cases ***
Simple background mongo
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name mongo1 -d mongo
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container mongo1
Wait Until Keyword Succeeds 5x 6s Check mongo container ${ip}

View File

@@ -0,0 +1,22 @@
Test 22-06 - postgres
=======
# Purpose:
To verify that the postgres application on docker hub works as expected on VIC
# References:
[1 - Docker Hub postgres Official Repository](https://hub.docker.com/_/postgres/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run a mysql container in the background and verify that it is working:
`docker run --name postgres1 -e POSTGRES_PASSWORD=password1 -d postgres`
# Expected Outcome:
* Each step should succeed, postgres should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,37 @@
# Copyright 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 22-06 - postgres
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Check postgres container
[Arguments] ${ip}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --rm postgres sh -c 'PGPASSWORD=password1 psql -h${ip} -Upostgres -c "\\l"'
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} postgres
Should Contain ${output} template0
Should Contain ${output} template1
*** Test Cases ***
Simple background postgres
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name postgres1 -e POSTGRES_PASSWORD=password1 -d postgres
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container postgres1
Wait Until Keyword Succeeds 5x 6s Check postgres container ${ip}

View File

@@ -0,0 +1,28 @@
Test 22-07 - elasticsearch
=======
# Purpose:
To verify that the elasticsearch application on docker hub works as expected on VIC
# References:
[1 - Docker Hub elasticsearch Official Repository](https://hub.docker.com/_/elasticsearch/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run an elasticsearch container in the background and verify that it is working:
`docker run -d elasticsearch`
3. Run an elasticsearch container in the background with additional flags passed to elasticsearch:
`docker run -d elasticsearch -Des.node.name="TestNode"`
4. Run an elasticsearch container in the background with a custom config folder passed in:
`docker run -d -v "$PWD/config":/usr/share/elasticsearch/config elasticsearch`
5. Run an elasticsearch container in the background with a persisted data volume:
`docker run -d -v "$PWD/esdata":/usr/share/elasticsearch/data elasticsearch`
# Expected Outcome:
* Each step should succeed, elasticsearch should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,28 @@
# Copyright 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 22-07 - elasticsearch
Resource ../../resources/Util.robot
#Suite Setup Install VIC Appliance To Test Server
#Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Simple background elasticsearch
${status}= Get State Of Github Issue 3624
Run Keyword If '${status}' == 'closed' Fail Test 22-07-elasticsearch.robot needs to be updated now that Issue #3624 has been resolved
#${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name es1 -d elasticsearch
#Log ${output}
#Should Be Equal As Integers ${rc} 0
#${ip}= Get IP Address of Container es1

View File

@@ -0,0 +1,23 @@
Test 22-08 - node
=======
# Purpose:
To verify that the node application on docker hub works as expected on VIC
# References:
[1 - Docker Hub node Official Repository](https://hub.docker.com/_/node/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Create a simple node application with a package.json and server.js file copied into the container
3. Run the simple node application in the background and verify that it is working:
`docker run -p 8080:8080 -d node`
# Expected Outcome:
* Each step should succeed, node should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,74 @@
# Copyright 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 22-08 - node
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Variables ***
${package} '{"name": "docker_web_app","version": "1.0.0","description": "Node.js on Docker","author": "VMware VIC <vic@vmware.com>","main": "server.js","scripts": {"start": "node server.js"},"dependencies": {"express": "^4.13.3"}}'
${server} "'use strict';const express = require('express');const app = express();app.get('/', (req, res) => {res.send('Hello world');});app.listen('8080', '0.0.0.0');console.log('Running on http://0.0.0.0:8080');"
*** Keywords ***
Check node container
[Arguments] ${ip}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run ${busybox} wget -O- ${ip}:8080
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Hello world
*** Test Cases ***
Simple background node application
Create Directory app
Run echo ${package} > app/package.json
Run echo ${server} > app/server.js
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name=vol1
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name copier -v vol1:/mydata ${busybox}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} cp app copier:/mydata
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name node1 -v vol1:/usr/src -d node sh -c "cd /usr/src/app && npm install && npm start"
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container node1
Wait Until Keyword Succeeds 10x 12s Check node container ${ip}
[Teardown] Remove Directory app recursive=${true}
Simple background node application on alpine
Create Directory app
Run echo ${package} > app/package.json
Run echo ${server} > app/server.js
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name=vol2
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name copier2 -v vol2:/mydata ${busybox}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} cp app copier2:/mydata
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name node2 -v vol2:/usr/src -d node:alpine sh -c "cd /usr/src/app && npm install && npm start"
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container node2
Wait Until Keyword Succeeds 10x 12s Check node container ${ip}
[Teardown] Remove Directory app recursive=${true}

View File

@@ -0,0 +1,22 @@
Test 22-09 - httpd
=======
# Purpose:
To verify that the httpd application on docker hub works as expected on VIC
# References:
[1 - Docker Hub httpd Official Repository](https://hub.docker.com/_/httpd/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run an httpd container in the background and verify the server is up and running:
`docker run -dit --name httpd1 -v "$PWD":/usr/local/apache2/htdocs/ httpd:2.4`
# Expected Outcome:
* Each step should succeed, httpd should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,41 @@
# Copyright 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 22-09 - httpd
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Curl httpd endpoint
[Arguments] ${endpoint}
${rc} ${output}= Run And Return Rc And Output curl ${endpoint}
Should Be Equal As Integers ${rc} 0
[Return] ${output}
*** Test Cases ***
Httpd with a mapped volume folder
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name=vol1
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -v vol1:/mydata ${busybox} sh -c "echo '<p>HelloWorld</p>' > /mydata/test.html"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -dit --name httpd1 -v vol1:/usr/local/apache2/htdocs/ -p 8080:80 httpd:2.4
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container httpd1
${output}= Wait Until Keyword Succeeds 10x 10s Curl httpd endpoint %{VCH-IP}:8080/test.html
Should Contain ${output} HelloWorld

View File

@@ -0,0 +1,24 @@
Test 22-10 - logstash
=======
# Purpose:
To verify that the logstash application on docker hub works as expected on VIC
# References:
[1 - Docker Hub logstash Official Repository](https://hub.docker.com/_/logstash/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run a logstash container in the background with input and output mapped to stdin/stdout:
`docker run -dit logstash -e 'input { stdin { } } output { stdout { } }'`
3. Run a logstash container in the background with input mapped to a log file on a volume:
`docker run -dit -v vol1:/logs logstash -e 'input { file { path => "/logs/my.log" start_position => "beginning" } } output { stdout { } }'`
# Expected Outcome:
* Each step should succeed, logstash should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,48 @@
# Copyright 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 22-10 - logstash
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Check logstash logs
[Arguments] ${container} ${message}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} logs ${container}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} ${message}
*** Test Cases ***
Logstash with stdin and stdout mapped
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name log1 -dit logstash -e 'input { stdin { } } output { stdout { } }'
Log ${output}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 6s Check logstash logs log1 Successfully started Logstash API endpoint
Logstash with mapped volume log file
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name=vol1
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d --rm -v vol1:/mydata ${busybox} sh -c "echo 'Initial log message' > /mydata/my.log"
Should Be Equal As Integers ${rc} 0
${rc} ${logstash_container}= Run And Return Rc And Output docker %{VCH-PARAMS} run -dit -v vol1:/logs logstash -e 'input { file { path => "/logs/my.log" start_position => "beginning" } } output { stdout { } }'
Log ${logstash_container}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 6s Check logstash logs ${logstash_container} Initial log message
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec ${logstash_container} sh -c "echo 'Another exciting log message' >> /logs/my.log"
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 6s Check logstash logs ${logstash_container} Another exciting log message

View File

@@ -0,0 +1,24 @@
Test 22-11 - memcached
=======
# Purpose:
To verify that the memcached application on docker hub works as expected on VIC
# References:
[1 - Docker Hub memcached Official Repository](https://hub.docker.com/_/memcached/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run a standard memcached container in the background:
`docker run --name my-memcache -d memcached`
3. Run a memcached container in the background with additional memory:
`docker run --name my-memcache2 -d memcached memcached -m 64`
# Expected Outcome:
* Each step should succeed, memcached should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,43 @@
# Copyright 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 22-11 - memcache
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Check memcache status
[Arguments] ${port}
${result}= Run Process echo 'stats' | nc -q 3 %{VCH-IP} ${port} shell=True
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} STAT pid
Should Contain ${result.stdout} STAT time_in_listen_disabled_us 0
Should Contain ${result.stdout} STAT lru_bumps_dropped 0
*** Test Cases ***
Standard memcache container in background
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name my-memcache -d -p 11211:11211 memcached
Log ${output}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 6s Check memcache status 11211
Memcache container with additional memory
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name my-memcache2 -d -p 11212:11211 memcached memcached -m 64
Log ${output}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 6s Check memcache status 11212

View File

@@ -0,0 +1,24 @@
Test 22-12 - centos
=======
# Purpose:
To verify that the centos application on docker hub works as expected on VIC
# References:
[1 - Docker Hub centos Official Repository](https://hub.docker.com/_/centos/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Run a latest centos container:
`docker run centos:latest yum update`
3. Run a centos:6 container:
`docker run centos:6 yum update`
# Expected Outcome:
* Each step should succeed, centos should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,34 @@
# Copyright 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 22-12 - centos
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Latest centos container
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run centos yum list
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Loaded plugins: fastestmirror, ovl
Should Contain ${output} yum-plugin-versionlock.noarch
Centos:6 container
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run centos:6 yum list
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Loaded plugins: fastestmirror, ovl
Should Contain ${output} yum-plugin-versionlock.noarch

View File

@@ -0,0 +1,26 @@
Test 22-13 - consul
=======
# Purpose:
To verify that the consul application on docker hub works as expected on VIC
# References:
[1 - Docker Hub consul Official Repository](https://hub.docker.com/_/consul/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Start a basic consul application container:
`docker run -d --name=dev-consul consul`
3. Start two consul agent containers linked to the server:
`docker run -d consul agent -dev -join=172.17.0.2`
4. Query the server for the members and verify that the agents have joined successfully:
`docker exec -t dev-consul consul members`
# Expected Outcome:
* Each step should succeed, consul should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,49 @@
# Copyright 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 22-13 - consul
Resource ../../resources/Util.robot
#Suite Setup Install VIC Appliance To Test Server
#Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Check consul members
[Arguments] ${server} ${count}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec -t ${server} consul members
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain X Times ${output} alive ${count}
*** Test Cases ***
Multi-agent consul topology
${status}= Get State Of Github Issue 6393
Run Keyword If '${status}' == 'closed' Fail Test 22-13-consul.robot needs to be updated now that Issue #6393 has been resolved
${status}= Get State Of Github Issue 6394
Run Keyword If '${status}' == 'closed' Fail Test 22-13-consul.robot needs to be updated now that Issue #6394 has been resolved
${status}= Get State Of Github Issue 6395
Run Keyword If '${status}' == 'closed' Fail Test 22-13-consul.robot needs to be updated now that Issue #6395 has been resolved
#${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d --name=dev-consul -e CONSUL_BIND_INTERFACE=eth0 consul
#Log ${output}
#Should Be Equal As Integers ${rc} 0
#${ip}= Get IP Address of Container dev-consul
#${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -e CONSUL_BIND_INTERFACE=eth0 consul agent -dev -join=${ip}
#Log ${output}
#Should Be Equal As Integers ${rc} 0
#${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -e CONSUL_BIND_INTERFACE=eth0 consul agent -dev -join=${ip}
#Log ${output}
#Should Be Equal As Integers ${rc} 0
#Wait Until Keyword Succeeds 10x 6s Check consul members dev-consul 3

View File

@@ -0,0 +1,26 @@
Test 22-14 - wordpress
=======
# Purpose:
To verify that the wordpress application on docker hub works as expected on VIC
# References:
[1 - Docker Hub wordpress Official Repository](https://hub.docker.com/_/wordpress/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Start a mysql db container:
`docker run --name mysql1 -e MYSQL_ROOT_PASSWORD=password1 -d mysql`
3. Start a wordpress container linked to the mysql container:
`docker run --name wordpress1 --link mysql1:mysql -d wordpress`
4. Start a wordpress container linked to the mysql container and with published ports:
`docker run --name wordpress2 --link mysql1:mysql -p 8080:80 -d wordpress`
# Expected Outcome:
* Each step should succeed, wordpress should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,50 @@
# Copyright 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 22-14 - wordpress
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Check wordpress container
[Arguments] ${url}
Remove File index.html*
${output}= Run wget ${url} && cat index.html
Should Contain ${output} <title>WordPress &rsaquo; Setup Configuration File</title>
*** Test Cases ***
Simple wordpress container
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name mysql1 -e MYSQL_ROOT_PASSWORD=password1 -d mysql
Log ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name wordpress1 --link mysql1:mysql -d wordpress
Log ${output}
Should Be Equal As Integers ${rc} 0
${ip}= Get IP Address of Container wordpress1
Remove File index.html*
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run ${busybox} sh -c "wget ${ip} && cat index.html"
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} <title>WordPress &rsaquo; Setup Configuration File</title>
Wordpress container with published ports
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name wordpress2 --link mysql1:mysql -p 8080:80 -d wordpress
Log ${output}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 6s Check wordpress container %{VCH-IP}:8080

View File

@@ -0,0 +1,26 @@
Test 22-15 - swarm
=======
# Purpose:
To verify that the swarm application on docker hub works as expected on VIC
# References:
[1 - Docker Hub swarm Official Repository](https://hub.docker.com/_/wordpress/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Create an initial swarm cluster:
`docker run --rm swarm create`
3. Create 2 swarm nodes:
`docker run -d swarm join --addr=<node_ip:2375> token://<cluster_id>`
4. Start the swarm manager:
`docker run -t -p <swarm_port>:2375 -t swarm manage token://<cluster_id>`
# Expected Outcome:
* Each step should succeed, swarm should be running without error in each case
# Possible Problems:
None

View File

@@ -0,0 +1,53 @@
# Copyright 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 22-15 - swarm
Resource ../../resources/Util.robot
#Suite Setup Install VIC Appliance To Test Server
#Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Create a docker swarm
${status}= Get State Of Github Issue 6396
Run Keyword If '${status}' == 'closed' Fail Test 22-15-swarm.robot needs to be updated now that Issue #6396 has been resolved
# ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull swarm
# Should Be Equal As Integers ${rc} 0
# ${rc} ${cluster}= Run And Return Rc And Output docker %{VCH-PARAMS} run --rm swarm create
# Log ${cluster}
# Should Be Equal As Integers ${rc} 0
# ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d swarm join --addr=172.16.0.20:2375 token://${cluster}
# Log ${output}
# Should Be Equal As Integers ${rc} 0
# ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d swarm join --addr=172.16.0.21:2375 token://${cluster}
# Log ${output}
# Should Be Equal As Integers ${rc} 0
# ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d swarm join --addr=172.16.0.22:2375 token://${cluster}
# Log ${output}
# Should Be Equal As Integers ${rc} 0
# ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -t -p 2380:2375 -d swarm manage token://${cluster}
# Log ${output}
# Should Be Equal As Integers ${rc} 0
# ${rc} ${output}= Run And Return Rc And Output docker %{VCH-IP}:2380 info
# Log ${output}
# Should Be Equal As Integers ${rc} 0
# ${rc} ${output}= Run And Return Rc And Output docker %{VCH-IP}:2380 run busybox ls
# Log ${output}
# Should Be Equal As Integers ${rc} 0

View File

@@ -0,0 +1,34 @@
Group 22 - Docker Apps
=======
[Test 22-01 - nginx](22-01-nginx.md)
-
[Test 22-02 - redis](22-02-redis.md)
-
[Test 22-03 - registry](22-03-registry.md)
-
[Test 22-04 - mysql](22-04-mysql.md)
-
[Test 22-05 - mongo](22-05-mongo.md)
-
[Test 22-06 - postgres](22-06-postgres.md)
-
[Test 22-07 - elasticsearch](22-07-elasticsearch.md)
-
[Test 22-08 - node](22-08-node.md)
-
[Test 22-09 - httpd](22-09-httpd.md)
-
[Test 22-10 - logstash](22-10-logstash.md)
-
[Test 22-11 - memcached](22-11-memcached.md)
-
[Test 22-12 - centos](22-12-centos.md)
-
[Test 22-13 - consul](22-13-consul.md)
-
[Test 22-14 - wordpress](22-14-wordpress.md)
-
[Test 22-15 - swarm](22-15-swarm.md)
-