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,43 @@
Test 5-1 - Distributed Switch
=======
# Purpose:
To verify the VIC appliance works in a variety of different vCenter networking configurations
# References:
[1 - VMware Distributed Switch Feature](https://www.vmware.com/products/vsphere/features/distributed-switch.html)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter in Nimbus
2. Deploy three new ESXi hosts with 2 NICs each in Nimbus:
```nimbus-esxdeploy --nics=2 esx-1 3620759```
```nimbus-esxdeploy --nics=2 esx-2 3620759```
```nimbus-esxdeploy --nics=2 esx-3 3620759```
3. After setting up your govc environment based on the new vCenter deployed, create a new datacenter:
```govc datacenter.create ha-datacenter```
4. Add each of the new hosts to the vCenter:
```govc host.add -hostname=<ESXi IP> -username=<USER> -dc=ha-datacenter -password=<PW> -noverify=true```
5. Create a new distributed switch:
```govc dvs.create -dc=ha-datacenter test-ds```
6. Create three new distributed switch port groups for management and vm network traffic:
```govc dvs.portgroup.add -nports 12 -dc=ha-datacenter -dvs=test-ds management```
```govc dvs.portgroup.add -nports 12 -dc=ha-datacenter -dvs=test-ds vm-network```
```govc dvs.portgroup.add -nports 12 -dc=ha-datacenter -dvs=test-ds bridge```
7. Add the three ESXi hosts to the portgroups:
```govc dvs.add -dvs=test-ds -pnic=vmnic1 <ESXi IP1>```
```govc dvs.add -dvs=test-ds -pnic=vmnic1 <ESXi IP2>```
```govc dvs.add -dvs=test-ds -pnic=vmnic1 <ESXi IP3>```
8. Deploy VCH Appliance to the new vCenter:
```bin/vic-machine-linux create --target=<VC IP> --user=Administrator@vsphere.local --image-store=datastore1 --appliance-iso=bin/appliance.iso --bootstrap-iso=bin/bootstrap.iso --generate-cert=false --password=Admin\!23 --force=true --bridge-network=bridge --compute-resource=/ha-datacenter/host/<ESXi IP 1>/Resources --public-network=vm-network --name=VCH-test```
9. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
* When you add an ESXi host to the vCenter it will overwrite its datastore name from datastore1 to datastore1 (n)
* govc requires an actual password so you need to change the default ESXi password before Step 4
* govc doesn't seem to be able to force a host NIC over to the new distributed switch, thus you need to create the ESXi hosts with 2 NICs in order to use the 2nd NIC for the distributed switch

View File

@@ -0,0 +1,81 @@
# 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 5-1 - Distributed Switch
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Distributed Switch Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Variables ***
${esx_number}= 3
${datacenter}= ha-datacenter
*** Keywords ***
Distributed Switch Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${vc}= Evaluate 'VC-' + str(random.randint(1000,9999)) + str(time.clock()) modules=random,time
${pid}= Deploy Nimbus vCenter Server Async ${vc}
Set Suite Variable ${VC} ${vc}
&{esxes}= Deploy Multiple Nimbus ESXi Servers in Parallel 3 %{NIMBUS_USER} %{NIMBUS_PASSWORD}
@{esx_names}= Get Dictionary Keys ${esxes}
@{esx_ips}= Get Dictionary Values ${esxes}
Set Suite Variable @{list} @{esx_names}[0] @{esx_names}[1] @{esx_names}[2] %{NIMBUS_USER}-${vc}
# Finish vCenter deploy
${output}= Wait For Process ${pid}
Should Contain ${output.stdout} Overall Status: Succeeded
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc_ip}= Get IP ${vc}
Close Connection
Set Environment Variable GOVC_INSECURE 1
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin!23
Set Environment Variable GOVC_URL ${vc_ip}
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create ${datacenter}
Should Be Empty ${out}
Create A Distributed Switch ${datacenter}
Create Three Distributed Port Groups ${datacenter}
Log To Console Add ESX host to the VC and Distributed Switch
:FOR ${IDX} IN RANGE ${esx_number}
\ ${out}= Run govc host.add -hostname=@{esx_ips}[${IDX}] -username=root -dc=${datacenter} -password=${NIMBUS_ESX_PASSWORD} -noverify=true
\ Should Contain ${out} OK
\ Wait Until Keyword Succeeds 5x 15 seconds Add Host To Distributed Switch @{esx_ips}[${IDX}]
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc_ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Set Environment Variable TEST_RESOURCE /ha-datacenter/host/@{esx_ips}[0]/Resources
Set Environment Variable TEST_TIMEOUT 30m
Set Environment Variable TEST_DATASTORE datastore1
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server
Run Regression Tests

View File

@@ -0,0 +1,22 @@
Test 5-10 - Multiple Datacenter
=======
# Purpose:
To verify the VIC appliance works when the vCenter appliance has multiple datacenters
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with 3 different datacenters and a mix of ESX within the datacenters
2. Install the VIC appliance into one of the datacenters
3. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,80 @@
# 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 5-10 - Multiple Datacenters
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Multiple Datacenter Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
# Insert elements from dict2 into dict1, overwriting conflicts in dict1 & returning new dict
Combine Dictionaries
[Arguments] ${dict1} ${dict2}
${dict2keys}= Get Dictionary Keys ${dict2}
:FOR ${key} IN @{dict2keys}
\ ${elem}= Get From Dictionary ${dict2} ${key}
\ Set To Dictionary ${dict1} ${key} ${elem}
[Return] ${dict1}
Multiple Datacenter Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
&{esxes}= Create Dictionary
${num_of_esxes}= Evaluate 2
:FOR ${i} IN RANGE 3
# Deploy some ESXi instances
\ &{new_esxes}= Deploy Multiple Nimbus ESXi Servers in Parallel ${num_of_esxes} %{NIMBUS_USER} %{NIMBUS_PASSWORD}
\ ${esxes}= Combine Dictionaries ${esxes} ${new_esxes}
# Investigate to see how many were actually deployed
\ ${len}= Get Length ${esxes}
\ ${num_of_esxes}= Evaluate ${num_of_esxes} - ${len}
# Exit if we've got enough & continue loop if we don't
\ Exit For Loop If ${len} >= 2
\ Log To Console Only got ${len} ESXi instance(s); Trying again
@{esx-names}= Get Dictionary Keys ${esxes}
@{esx-ips}= Get Dictionary Values ${esxes}
${esx1}= Get From List ${esx-names} 0
${esx2}= Get From List ${esx-names} 1
${esx1-ip}= Get From List ${esx-ips} 0
${esx2-ip}= Get From List ${esx-ips} 1
${esx3} ${esx4} ${esx5} ${vc} ${esx3-ip} ${esx4-ip} ${esx5-ip} ${vc-ip}= Create a Simple VC Cluster datacenter1 cls1
Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} ${esx4} ${esx5} %{NIMBUS_USER}-${vc}
Log To Console Create datacenter2 on the VC
${out}= Run govc datacenter.create datacenter2
Should Be Empty ${out}
${out}= Run govc host.add -hostname=${esx1-ip} -username=root -dc=datacenter2 -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
Log To Console Create datacenter3 on the VC
${out}= Run govc datacenter.create datacenter3
Should Be Empty ${out}
${out}= Run govc host.add -hostname=${esx2-ip} -username=root -dc=datacenter3 -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
Set Environment Variable TEST_DATACENTER /datacenter1
Set Environment Variable GOVC_DATACENTER /datacenter1
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server certs=${false} vol=default
Run Regression Tests
Remove Environment Variable TEST_DATACENTER
Remove Environment Variable GOVC_DATACENTER

View File

@@ -0,0 +1,22 @@
Test 5-11 - Multiple Cluster
=======
# Purpose:
To verify the VIC appliance works when the vCenter appliance has multiple clusters within the datacenter
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with 3 different clusters in a datacenter and a mix of ESX within the clusters
2. Install the VIC appliance into one of the clusters
3. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,80 @@
# 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 5-11 - Multiple Clusters
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Multiple Cluster Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
# Insert elements from dict2 into dict1, overwriting conflicts in dict1 & returning new dict
Combine Dictionaries
[Arguments] ${dict1} ${dict2}
${dict2keys}= Get Dictionary Keys ${dict2}
:FOR ${key} IN @{dict2keys}
\ ${elem}= Get From Dictionary ${dict2} ${key}
\ Set To Dictionary ${dict1} ${key} ${elem}
[Return] ${dict1}
Multiple Cluster Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
&{esxes}= Create Dictionary
${num_of_esxes}= Evaluate 2
:FOR ${i} IN RANGE 3
# Deploy some ESXi instances
\ &{new_esxes}= Deploy Multiple Nimbus ESXi Servers in Parallel ${num_of_esxes} %{NIMBUS_USER} %{NIMBUS_PASSWORD}
\ ${esxes}= Combine Dictionaries ${esxes} ${new_esxes}
# Investigate to see how many were actually deployed
\ ${len}= Get Length ${esxes}
\ ${num_of_esxes}= Evaluate ${num_of_esxes} - ${len}
# Exit if we've got enough & continue loop if we don't
\ Exit For Loop If ${len} >= 2
\ Log To Console Only got ${len} ESXi instance(s); Trying again
@{esx-names}= Get Dictionary Keys ${esxes}
@{esx-ips}= Get Dictionary Values ${esxes}
${esx1}= Get From List ${esx-names} 0
${esx2}= Get From List ${esx-names} 1
${esx1-ip}= Get From List ${esx-ips} 0
${esx2-ip}= Get From List ${esx-ips} 1
${esx3} ${esx4} ${esx5} ${vc} ${esx3-ip} ${esx4-ip} ${esx5-ip} ${vc-ip}= Create a Simple VC Cluster datacenter1 cls1
Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} ${esx4} ${esx5} %{NIMBUS_USER}-${vc}
Log To Console Create cluster2 on the VC
${out}= Run govc cluster.create cls2
Should Be Empty ${out}
${out}= Run govc cluster.add -hostname=${esx1-ip} -username=root -dc=datacenter1 -cluster=cls2 -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
Log To Console Create cluster3 on the VC
${out}= Run govc cluster.create cls3
Should Be Empty ${out}
${out}= Run govc cluster.add -hostname=${esx2-ip} -username=root -dc=datacenter1 -cluster=cls3 -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server certs=${false} vol=default
Run Regression Tests
Cleanup VIC Appliance On Test Server

View File

@@ -0,0 +1,26 @@
Test 5-12 - Multiple VLAN
=======
# Purpose:
To verify the VIC appliance works when the vCenter appliance has multiple portgroups on different VLANs within the datacenter
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a distributed virtual switch with 3 portgroups on all different VLANs
2. Install the VIC appliance into one of the clusters
3. Run a variety of docker commands on the VCH appliance
4. Uninstall the VIC appliance
5. Deploy a new vCenter with a distributed virtual switch with 3 portgroups two on the same VLAN and one on a different VLAN
6. Install the VIC appliance into one of the clusters
7. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
Each VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,46 @@
# 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 5-12 - Multiple VLAN
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Multiple VLAN Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
Test Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Multiple VLAN Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${esx1} ${esx2} ${esx3} ${vc} ${esx1-ip} ${esx2-ip} ${esx3-ip} ${vc-ip}= Create a Simple VC Cluster multi-vlan-1 cls
Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} %{NIMBUS_USER}-${vc}
*** Test Cases ***
Test1
${out}= Run govc dvs.portgroup.change -vlan 1 bridge
Should Contain ${out} OK
${out}= Run govc dvs.portgroup.change -vlan 1 management
Should Contain ${out} OK
Install VIC Appliance To Test Server
Run Regression Tests
Test2
${out}= Run govc dvs.portgroup.change -vlan 1 bridge
Should Contain ${out} OK
${out}= Run govc dvs.portgroup.change -vlan 2 management
Should Contain ${out} OK
Install VIC Appliance To Test Server
Run Regression Tests

View File

@@ -0,0 +1,21 @@
Test 5-13 - Invalid ESXi Install
=======
# Purpose:
To verify the VIC appliance provides a reasonable error message when you innapropriately target an ESXi inside a VC for the install
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a distributed virtual switch
2. Attempt to install the VIC appliance into one of the ESXi directly
# Expected Outcome:
vic-machine create should fail and provide a useful error
# Possible Problems:
None

View File

@@ -0,0 +1,78 @@
# 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 5-13 - Invalid ESXi Install
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Invalid ESXi Install Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
Invalid ESXi Install Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
Set Suite Variable ${datacenter} datacenter1
Set Suite Variable ${cluster} cls
${esx1} ${esx1-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable ${ESX1} ${esx1}
Set Suite Variable ${esx1-ip} ${esx1-ip}
${esx2} ${esx2-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable ${ESX2} ${esx2}
Set Suite Variable ${esx2-ip} ${esx2-ip}
${vc} ${vc-ip}= Deploy Nimbus vCenter Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable ${VC} ${vc}
Set Suite Variable ${vc-ip} ${vc-ip}
Set Suite Variable @{list} ${esx1} ${esx2} ${vc}
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create ${datacenter}
Should Be Empty ${out}
Log To Console Create a cluster on the VC
${out}= Run govc cluster.create ${cluster}
Should Be Empty ${out}
Log To Console Add ESX host to the VC
${out}= Run govc cluster.add -hostname=${esx1-ip} -username=root -dc=${datacenter} -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
${out}= Run govc cluster.add -hostname=${esx2-ip} -username=root -dc=${datacenter} -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
Log To Console Create a distributed switch
${out}= Run govc dvs.create -dc=${datacenter} test-ds
Should Contain ${out} OK
Log To Console Create three new distributed switch port groups for management and vm network traffic
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=test-ds management
Should Contain ${out} OK
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=test-ds vm-network
Should Contain ${out} OK
${out}= Run govc dvs.portgroup.add -nports 12 -dc=${datacenter} -dvs=test-ds bridge
Should Contain ${out} OK
Log To Console Add all the hosts to the distributed switch
${out}= Run govc dvs.add -dvs=test-ds -pnic=vmnic1 /${datacenter}/host/${cluster}
Should Contain ${out} OK
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /${datacenter}/host/${cluster}
Should Be Empty ${out}
*** Test Cases ***
Test
${out}= Run bin/vic-machine-linux create --target ${esx1-ip} --user root --password e2eFunctionalTest --no-tls --name VCH-invalid-test --force --timeout 30m
Should Contain ${out} Target is managed by vCenter server \\"${vc-ip}\\", please change --target to vCenter server address or select a standalone ESXi

View File

@@ -0,0 +1,23 @@
Test 5-14 - Remove Container OOB
=======
# Purpose:
To verify that VIC works properly when a container is removed OOB in VC
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a simple cluster
2. Install the VIC appliance into one of the clusters
3. Run docker run -itd busybox /bin/top
4. Attempt to remove the container vm OOB
# Expected Outcome:
Step 4 should result in and error and a message stating that OOB deletion is disabled on VIC
# Possible Problems:
None

View File

@@ -0,0 +1,39 @@
# 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 5-14 - Remove Container OOB
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Remove Container OOB Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
Remove Container OOB Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${esx1} ${esx2} ${esx3} ${vc} ${esx1-ip} ${esx2-ip} ${esx3-ip} ${vc-ip}= Create a Simple VC Cluster
Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} %{NIMBUS_USER}-${vc}
*** Test Cases ***
Docker run an image from a container that was removed OOB
Install VIC Appliance To Test Server
${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
${rc} ${container}= Run And Return Rc And Output docker %{VCH-PARAMS} run -itd --name removeOOB busybox /bin/top
Should Be Equal As Integers ${rc} 0
${rc} ${out}= Run And Return Rc And Output govc vm.destroy removeOOB*
Should Not Be Equal As Integers ${rc} 0
Should Contain ${out} govc: ServerFaultCode: The method is disabled by 'VIC'

View File

@@ -0,0 +1,24 @@
Test 5-15 - NFS Datastore
=======
# Purpose:
To verify that VIC works properly when a VCH is installed on an NFS based datastore
# References:
[1 - Best practices for running VMware vSphere on NFS](http://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/vmware-nfs-bestpractices-white-paper-en.pdf)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a simple cluster
2. Deploy an NFS server
3. Create a new datastore out of a NFS share on the NFS server
4. Install the VIC appliance into the cluster using the new NFS based datastore
5. Run a variety of docker operation on the VCH
# Expected Outcome:
All test steps should complete without error on the NFS based datastore
# Possible Problems:
None

View File

@@ -0,0 +1,43 @@
# 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 5-15 - NFS Datastore
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m NFS Datastore Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
NFS Datastore Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${esx1} ${esx2} ${esx3} ${vc} ${esx1-ip} ${esx2-ip} ${esx3-ip} ${vc-ip}= Create a Simple VC Cluster datacenter1 cls1
Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} %{NIMBUS_USER}-${vc}
${name} ${ip}= Deploy Nimbus NFS Datastore %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Append To List ${list} ${name}
${out}= Run govc datastore.create -mode readWrite -type nfs -name nfsDatastore -remote-host ${ip} -remote-path /store /datacenter1/host/cls1
Should Be Empty ${out}
Set Environment Variable TEST_DATASTORE nfsDatastore
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server
Run Regression Tests
Cleanup VIC Appliance On Test Server

View File

@@ -0,0 +1,22 @@
Test 5-16 - iSCSI Datastore
=======
# Purpose:
To verify that VIC works properly when installed on an iSCSI based datastore
# References:
[1 - Configuring iSCSI Adapters and Storage](https://pubs.vmware.com/vsphere-55/index.jsp?topic=%2Fcom.vmware.vsphere.storage.doc%2FGUID-C476065E-C02F-47FA-A5F7-3B3F2FD40EA8.html)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a simple cluster using iSCSI based datastores
2. Install the VIC appliance into the cluster specifying one of the iSCSI datastores as the image-store
3. Run a variety of docker commands on the VCH
# Expected Outcome:
Each step should result in success and each of the docker commands should not return an error
# Possible Problems:
None

View File

@@ -0,0 +1,75 @@
# 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 5-16 - iSCSI Datastore
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10s iSCSI Datastore Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
iSCSI Datastore Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${name}= Evaluate 'vic-iscsi-' + str(random.randint(1000,9999)) modules=random
${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --plugin testng --customizeTestbed '/esx desiredPassword=e2eFunctionalTest' --noSupportBundles --vcvaBuild ${VC_VERSION} --esxBuild ${ESX_VERSION} --testbedName vcqa-sdrs-iscsi-fullInstall-vcva --runName vic-iscsi
Set Suite Variable @{list} %{NIMBUS_USER}-vic-iscsi.vcva-${VC_VERSION} %{NIMBUS_USER}-vic-iscsi.esx.0 %{NIMBUS_USER}-vic-iscsi.esx.1 %{NIMBUS_USER}-vic-iscsi.iscsi.0
Should Contain ${out} "deployment_result"=>"PASS"
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-iscsi.vcva-${VC_VERSION} | grep %{NIMBUS_USER}-vic-iscsi.vcva-${VC_VERSION}
${vc-ip}= Fetch From Right ${out} ${SPACE}
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-iscsi.esx.0 | grep %{NIMBUS_USER}-vic-iscsi.esx.0
${esx0-ip}= Fetch From Right ${out} ${SPACE}
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-iscsi.esx.1 | grep %{NIMBUS_USER}-vic-iscsi.esx.1
${esx1-ip}= Fetch From Right ${out} ${SPACE}
Set Environment Variable GOVC_URL ${esx0-ip}
Set Environment Variable GOVC_USERNAME root
Set Environment Variable GOVC_PASSWORD e2eFunctionalTest
Run govc host.esxcli network firewall set -e false
Set Environment Variable GOVC_URL ${esx1-ip}
Run govc host.esxcli network firewall set -e false
Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23
Create A Distributed Switch vcqaDC
Create Three Distributed Port Groups vcqaDC
Add Host To Distributed Switch /vcqaDC/host/cls
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /vcqaDC/host/cls
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE sharedVmfs-0
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
iSCSI Datastore
Install VIC Appliance To Test Server
Run Regression Tests

View File

@@ -0,0 +1,24 @@
Test 5-17 - FC Datastore
=======
# Purpose:
To verify that VIC works properly when a VCH is installed on an Fibre Channel based datastore
# References:
[1 - Add Fibre Channel Storage](https://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp?topic=/com.vmware.vsphere.server_configclassic.doc_41/esx_server_config/configuring_storage/t_add_fibre_channel_storage.html)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a simple cluster
2. Deploy an FC server
3. Create a new datastore out of an FC lun on the FC server
4. Install the VIC appliance into the cluster using the new FC based datastore
5. Run a variety of docker operation on the VCH
# Expected Outcome:
All test steps should complete without error on the FC based datastore
# Possible Problems:
None

View File

@@ -0,0 +1,75 @@
# 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 5-17 - FC Datastore
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m FC Datastore Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
FC Datastore Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${name}= Evaluate 'vic-fc-' + str(random.randint(1000,9999)) modules=random
${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --plugin testng --customizeTestbed '/esx desiredPassword=e2eFunctionalTest' --noSupportBundles --vcvaBuild ${VC_VERSION} --esxBuild ${ESX_VERSION} --testbedName vcqa-sdrs-fc-fullInstall-vcva --runName vic-fc
Set Suite Variable @{list} %{NIMBUS_USER}-vic-fc.vcva-${VC_VERSION} %{NIMBUS_USER}-vic-fc.esx.0 %{NIMBUS_USER}-vic-fc.esx.1 %{NIMBUS_USER}-vic-fc.fc.0
Should Contain ${out} "deployment_result"=>"PASS"
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-fc.vcva-${VC_VERSION} | grep %{NIMBUS_USER}-vic-fc.vcva-${VC_VERSION}
${vc-ip}= Fetch From Right ${out} ${SPACE}
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-fc.esx.0 | grep %{NIMBUS_USER}-vic-fc.esx.0
${esx0-ip}= Fetch From Right ${out} ${SPACE}
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-fc.esx.1 | grep %{NIMBUS_USER}-vic-fc.esx.1
${esx1-ip}= Fetch From Right ${out} ${SPACE}
Set Environment Variable GOVC_URL ${esx0-ip}
Set Environment Variable GOVC_USERNAME root
Set Environment Variable GOVC_PASSWORD e2eFunctionalTest
Run govc host.esxcli network firewall set -e false
Set Environment Variable GOVC_URL ${esx1-ip}
Run govc host.esxcli network firewall set -e false
Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23
Create A Distributed Switch vcqaDC
Create Three Distributed Port Groups vcqaDC
Add Host To Distributed Switch /vcqaDC/host/cls
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /vcqaDC/host/cls
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE sharedVmfs-0
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
FC Datastore
Install VIC Appliance To Test Server
Run Regression Tests

View File

@@ -0,0 +1,24 @@
Test 5-18 - Datastore Cluster SDRS
=======
# Purpose:
To verify that VIC works properly when a VCH is installed on a datastore cluster
# References:
[1 - Creating a Datastore Cluster](https://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.vsphere.resmgmt.doc%2FGUID-598DF695-107E-406B-9C95-0AF961FC227A.html)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a simple cluster
2. Create a storage pod or datastore cluster folder
3. Move several shared datastores into the datastore cluster
4. Install the VIC appliance into the cluster using the new datastore cluster
5. Run a variety of docker operation on the VCH
# Expected Outcome:
All test steps should complete without error on the datastore cluster
# Possible Problems:
None

View File

@@ -0,0 +1,77 @@
# 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 5-18 - Datastore Cluster SDRS
Resource ../../resources/Util.robot
#Suite Setup Wait Until Keyword Succeeds 10x 10m SDRS Datastore Setup
#Test Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
SDRS Datastore Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
{out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --customizeTestbed '/esx desiredPassword=e2eFunctionalTest' --noSupportBundles --vcvaBuild ${VC_VERSION} --esxBuild ${ESX_VERSION} --testbedName vcqa-sdrs-fc-fullInstall-vcva --runName vic-fc
Set Suite Variable @{list} %{NIMBUS_USER}-vic-fc.vcva-${VC_VERSION} %{NIMBUS_USER}-vic-fc.esx.0 %{NIMBUS_USER}-vic-fc.esx.1 %{NIMBUS_USER}-vic-fc.fc.0
Should Contain ${out} "deployment_result"=>"PASS"
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-fc.vcva-${VC_VERSION} | grep %{NIMBUS_USER}-vic-fc.vcva-${VC_VERSION}
${vc-ip}= Fetch From Right ${out} ${SPACE}
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-fc.esx.0 | grep %{NIMBUS_USER}-vic-fc.esx.0
${esx0-ip}= Fetch From Right ${out} ${SPACE}
${out}= Execute Command nimbus-ctl ip %{NIMBUS_USER}-vic-fc.esx.1 | grep %{NIMBUS_USER}-vic-fc.esx.1
${esx1-ip}= Fetch From Right ${out} ${SPACE}
Set Environment Variable GOVC_URL ${esx0-ip}
Set Environment Variable GOVC_USERNAME root
Set Environment Variable GOVC_PASSWORD e2eFunctionalTest
Run govc host.esxcli network firewall set -e false
Set Environment Variable GOVC_URL ${esx1-ip}
Run govc host.esxcli network firewall set -e false
Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23
Create A Distributed Switch vcqaDC
Create Three Distributed Port Groups vcqaDC
Add Host To Distributed Switch /vcqaDC/host/cls
${out}= Run govc folder.create -pod=true /vcqaDC/datastore/sdrs
${out}= Run govc object.mv /vcqaDC/datastore/sharedVmfs-* /vcqaDC/datastore/sdrs
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /vcqaDC/host/cls
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Set Environment Variable TEST_DATASTORE sdrs
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
SDRS Datastore
Pass Execution VIC does not support SDRS yet, see issue #2729
Install VIC Appliance To Test Server
Run Regression Tests

View File

@@ -0,0 +1,26 @@
Test 5-2 - Cluster
=======
# Purpose:
To verify the VIC appliance works when the vCenter appliance is using a cluster
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with 3 ESXi hosts in a cluster:
```govc cluster.create cls```
2. Install the VIC appliance into the cluster using the cluster path as the compute resource:
```
--compute-resource /ha-datacenter/host/cls
```
3. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,95 @@
# 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 5-2 - Cluster
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Cluster Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
Cluster Setup
[Timeout] 110 minutes
Log To Console \nWait until Nimbus is at least available...
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Close Connection
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${vc}= Evaluate 'VC-' + str(random.randint(1000,9999)) + str(time.clock()) modules=random,time
${pid}= Deploy Nimbus vCenter Server Async ${vc}
&{esxes}= Deploy Multiple Nimbus ESXi Servers in Parallel 3 %{NIMBUS_USER} %{NIMBUS_PASSWORD} ${ESX_VERSION}
@{esx_names}= Get Dictionary Keys ${esxes}
@{esx_ips}= Get Dictionary Values ${esxes}
Set Suite Variable @{list} @{esx_names}[0] @{esx_names}[1] @{esx_names}[2] %{NIMBUS_USER}-${vc}
# Finish vCenter deploy
${output}= Wait For Process ${pid}
Should Contain ${output.stdout} Overall Status: Succeeded
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc-ip}= Get IP ${vc}
Close Connection
Set Environment Variable GOVC_INSECURE 1
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin!23
Set Environment Variable GOVC_URL ${vc-ip}
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create ha-datacenter
Should Be Empty ${out}
Log To Console Create a cluster on the VC
${out}= Run govc cluster.create cls
Should Be Empty ${out}
Log To Console Add ESX host to the VC
${out}= Run govc cluster.add -hostname=@{esx_ips}[0] -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
${out}= Run govc cluster.add -hostname=@{esx_ips}[1] -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
${out}= Run govc cluster.add -hostname=@{esx_ips}[2] -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
Create A Distributed Switch ha-datacenter
Create Three Distributed Port Groups ha-datacenter
Wait Until Keyword Succeeds 5x 1 minute Add Host To Distributed Switch /ha-datacenter/host/cls/@{esx_ips}[0]
Wait Until Keyword Succeeds 5x 1 minute Add Host To Distributed Switch /ha-datacenter/host/cls/@{esx_ips}[1]
Wait Until Keyword Succeeds 5x 1 minute Add Host To Distributed Switch /ha-datacenter/host/cls/@{esx_ips}[2]
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /ha-datacenter/host/cls
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE datastore1
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server
Run Regression Tests

View File

@@ -0,0 +1,21 @@
Test 5-20 - Restore Starting State
=======
# Purpose:
To verify that a container that is starting will have it's starting state restored
during appliance reboot
# Test Steps:
1. Deploy VCH
2. Enable ESXi Firewall
3. Pull busybox
4. docker run -i busybox
5. verify run timeout
6. restart VCH
7. verify state starting
# Expected Outcome:
All test steps should complete without error
# Possible Problems:
Only will work with stand alone esxi

View File

@@ -0,0 +1,43 @@
# 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 5-20 - Restore Starting State
Resource ../../resources/Util.robot
#Suite Setup Install VIC Appliance To Test Server
#Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Restore Container Starting State on Restart
[Timeout] 110 minutes
Pass Execution Not sure why this test case is here, but it needs to be re-implemented to work in Nimbus
# enable firewall
Run govc host.esxcli network firewall set -e true
${out}= Run docker %{VCH-PARAMS} pull busybox
# with enabled firewall this will timeout
${rc} ${container}= Run And Return Rc And Output docker %{VCH-PARAMS} run -i busybox
#Should Be Equal As Integers ${rc} 0
#${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${container}
Should Contain ${container} deadline
${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} ps -a
Should Contain ${out} Starting
# disable firewall
Run govc host.esxcli network firewall set -e false
# restart appliance
Reboot VM %{VCH-NAME}
# wait for docker info to succeed
Wait Until Keyword Succeeds 20x 5 seconds Run Docker Info %{VCH-PARAMS}
# ensure we have a starting container
${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} ps -a
Should Contain ${out} Starting

View File

@@ -0,0 +1,23 @@
Test 5-21 - Datastore-Path
=======
# Purpose:
To verify that we can specify datastore paths that have spaces.
Also, to test datastore path with specified DS schemes.
# Environment:
This test requires an ESX with a deployed VIC Appliance.
# Test Steps:
1. Deploy Nimbus ESX server and install VCH
2. Run custom vic-machine create command where we specify an image store with DS scheme included
3. Rename 'datastore1' to 'datastore (1)'
4. Install VCH using 'datastore (1)
5. Run custom vic-machine create command using 'datastore (1)' where we specify an image store with DS scheme
# Expected Outcome:
1. The VCH should deploy w/o errors
2. Vic-machine create command should pass when installing using image store with DS scheme included
3. Renaming of datastore to 'datastore (1)' should succeed
4. VCH should deploy w/o errors when installing to datastore (1)
5. Vic-machine create command should pass when installing using image store with DS scheme include and space in path

View File

@@ -0,0 +1,93 @@
# 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 5-21 - Datastore-Path
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Setup Suite ESX
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Variables ***
${testDatastoreSpace}= "datastore (1)"
${dsScheme}= ds://
*** Keywords ***
Setup Suite ESX
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${esx1} ${esx1-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable ${ESX1} ${esx1}
Set Suite Variable @{list} ${esx1}
Log To Console Deploy VIC Appliance To ESX
Set Environment Variable TEST_URL_ARRAY ${esx1-ip}
Set Environment Variable TEST_URL ${esx1-ip}
Set Environment Variable TEST_USERNAME root
Set Environment Variable TEST_PASSWORD ${NIMBUS_ESX_PASSWORD}
Set Environment Variable TEST_DATASTORE datastore1
Set Environment Variable TEST_TIMEOUT 30m
Set Environment Variable HOST_TYPE ESXi
Remove Environment Variable TEST_DATACENTER
Remove Environment Variable TEST_RESOURCE
Remove Environment Variable BRIDGE_NETWORK
Remove Environment Variable PUBLIC_NETWORK
${output}= Install VIC Appliance To Test Server certs=${false}
Should Contain ${output} Installer completed successfully
*** Test Cases ***
Datastore - DS Scheme Specified in Volume Store
Log To Console \nStarting DS Scheme in Volume Store Test...
# Attempt to cleanup old/canceled tests
Run Keyword And Ignore Error Cleanup Dangling VMs On Test Server
Run Keyword And Ignore Error Cleanup Datastore On Test Server
Log To Console \nRunning custom vic-machine create - with DS Scheme in Volume Store
# Need to run custom vic-machine create to specify volume store with DS scheme
${output}= Run bin/vic-machine-linux create --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL_ARRAY} --user=%{TEST_USERNAME} --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} --image-store=%{TEST_DATASTORE} --volume-store=${dsScheme}%{TEST_DATASTORE}/images:default --password=%{TEST_PASSWORD} --appliance-iso=bin/appliance.iso --bootstrap-iso=bin/bootstrap.iso --insecure-registry harbor.ci.drone.local --force --kv
Should Contain ${output} Installer completed successfully
Datastore - Space in Path
Log To Console \nStarting Space in Path Test...
# Rename original TEST_DATASTORE to a datastore with a space in the path
${out}= Run govc object.rename /ha-datacenter/datastore/%{TEST_DATASTORE} ${testDatastoreSpace}
Should Contain ${out} OK
Set Environment Variable TEST_DATASTORE ${testDatastoreSpace}
${output}= Install VIC Appliance To Test Server certs=${false} vol=default
Should Contain ${output} Installer completed successfully
Datastore - Space in Path with Scheme
Log To Console \nStarting Space in Path with Scheme Test...
# Rename original TEST_DATASTORE to a datastore with a space in the path: this is a double check
${out}= Run govc object.rename /ha-datacenter/datastore/%{TEST_DATASTORE} ${testDatastoreSpace}
Should Contain ${out} OK
Set Environment Variable TEST_DATASTORE ${testDatastoreSpace}
# Attempt to cleanup old/canceled tests
Run Keyword And Ignore Error Cleanup Dangling VMs On Test Server
Run Keyword And Ignore Error Cleanup Datastore On Test Server
Log To Console \nRunning custom vic-machine create - with DS Scheme in Volume Store with space in path
# Need to run custom vic-machine create to specify volume store with DS scheme
${output}= Run bin/vic-machine-linux create --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL_ARRAY} --user=%{TEST_USERNAME} --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} --image-store=%{TEST_DATASTORE} --volume-store=${dsScheme}%{TEST_DATASTORE}/images:default --password=%{TEST_PASSWORD} --appliance-iso=bin/appliance.iso --bootstrap-iso=bin/bootstrap.iso --insecure-registry harbor.ci.drone.local --force --kv
Should Contain ${output} Installer completed successfully

View File

@@ -0,0 +1,117 @@
Test 5-22 - NFS Volume
=======
# Purpose:
To verify that NFS shared volumes work with currently supported docker commands
# References:
[1 - Best practices for running VMware vSphere on NFS](http://www.vmware.com/content/dam/digitalmarketing/vmware/en/pdf/techpaper/vmware-nfs-bestpractices-white-paper-en.pdf)
[2 - Docker Command Line Reference - Volume Create](https://docs.docker.com/engine/reference/commandline/volume_create/)
[3 - Docker Command Line Reference - Exec](https://docs.docker.com/engine/reference/commandline/exec/)
[4 - Docker Command Line Reference - Volume Inspect](https://docs.docker.com/engine/reference/commandline/volume_inspect/)
[5 - Docker Command Line Reference](https://docs.docker.com/engine/reference/commandline/volume_ls/)
# Environment:
This test requires access to VMware Nimbus for dynamic ESXi and NFS server creation
# Test Steps:
1. Deploy VIC appliance to an ESX and use a read only NFS mount point
2. Issue docker volume create on read only volume
3. Deploy VIC appliance to an ESX and use fake NFS mount point
4. Deploy VIC appliance to an ESX and use valid NFS mount point
5. Issue docker volume create using no name for the volume (unnamed) on VolumeStore=nfsVolumeStore (NFS volume)
6. Issue docker run -v using unnamed volume and the mount command, run docker wait, then docker rm on container
7. Issue docker volume create --name=nfs_default_%{VCH-NAME} on VolumeStore=nfsVolumeStore (NFS volume)
8. Issue docker run -v using unnamed volume and the mount command, run docker wait, then docker rm on container
9. Issue docker volume create on unnamed volume
10. Issue docker volume create on named volume
11. Issue docker volume create --name="test!@\#$%^&*()"
12. Create container ${createFileContainer} using named nfs volume
13. Issue docker exec -i ${createFileContainer} echo # --> to write contents to a file (created by this echo command) on NFS volume
14. Issue docker exec -i ${createFileContainer} ls # to verify file is created in the correct directory on NFS volume
15. Issue docker exec -i ${createFileContainer} cat # to verify contents of the file
16. Create a container using named nfs volume and echo # to append more contents to the file used by earlier container
17. Create a container using named nfs volume and echo # to append to the same file
18. Create a container using named nfs volume and echo # to append to the same file
19. Create a container using named nfs volume and cat # verify contents of the file
20. Create a detached container using named nfs volume using named nfs volume to cat the file from last test
21. Issue docker logs to see the results of the cat command # verify contents of the file
22. Create a container using named nfs volume and rm the file just used.
23. Create a container using named nfs volume and cat the file that was just removed
24. Issue docker start on detached container from earlier
25. Issue docker logs on detached container
26. Spin up on container per item in a list to write once a sec to a file the value passed in from the list and save the container ids
27. Create container using named nfs volume and cat the contents of the file from the previous step
28. Check output from each container that was writing to the file.
29. Stop all the running write containers.
30. Issue docker volume inspect ${nfsNamedVolume}
31. Issue docker volume ls
32. Issue docker volume rm ${nfsDefaultVolume}
33. Issue docker volume rm ${nfsNamedVolume}
34. Create a container using a standard volume and named NFS volume
35. Inspect the container to check volume info
37. Restart the VCH
38. Inspect the container to check that the volume info is the same as before
39. Create a detached container using named nfs volume and write to file every second
40. Create a container using named nfs volume and tail the file from previous step
41. Kill the NFS Server from Nimbus
42. Create a container using named nfs volume from killed NFS server and tail the file from previous step
43. Create a container using named nfs volume from killed NFS server and write to file from previous step
44. Create a container using named nfs volume from killed NFS server and ls the mydata directory
# Expected Outcome:
* Step 1 will pass VCH creation but should fail in mounting the read only NFS mount point
* Step 2 should result in error with the following error message:
```
Error response from daemon: No volume store named (${nfsReadOnlyVolumeStore}) exists
```
* Step 3 will pass VCH creation but should fail in mounting the fake NFS mount point
* Step 4 should complete successfully; VCH should be created/installed
* Step 5 should complete successfully and return a long string name for the volume created
* Step 6 should verify that the NFS volume is mounted on a temp container; container rm should succeed
* Step 7 should complete successfully and return named volume
* Step 8 same as step 4 but using the named volume instead
* Step 9 should result in error with the following error message:
```
Error response from daemon: A volume named ${nfsDefaultVolume} already exists. Choose a different volume name.
```
* Step 10 should result in error with the following error message:
```
Error response from daemon: A volume named ${nfsNamedVolume} already exists. Choose a different volume name.
```
* Step 11 should result in error with the following message:
```
Error response from daemon: create test???: "test???" includes invalid characters for a local volume name, only "\[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed
```
* Steps 12 - 22 should result in success
* Step 23 should result in error with the following error message:
```
cat: can't open 'mydata/test_nfs_file.txt': No such file or directory
```
* Step 24 and 25 should succeed, however step 25 will show the same error as above in the logs
* Steps 26 - 29 should result in success
* Step 30 should result in a properly formatted JSON response
* Step 31 should result in each nfs volume being listed with both driver and volume name
* Step 32 should result in success and the volume should not be listed anymore
* Step 33 should result in error with the following message:
```
Error response from daemon: volume ${nfsNamedVolume} in use by
```
* Steps 34-38 should result in success
* Steps 39 - 41 should result in success; step 41 should kill/drop the server
* Step 42 should result in error with the following message:
```
Server error from portlayer: unable to wait for process launch status:
```
* Steps 43 - 44 should result in error with the rc = 125.
# Possible Problems:
Mount command may be affected by Nimbus's performance returning '' when the volume was successfully created/mounted

View File

@@ -0,0 +1,326 @@
# 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 5-22 - NFS Volume
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Setup ESX And NFS Suite
Suite Teardown Run Keyword And Ignore Error NFS Volume Cleanup
Test Teardown Gather NFS Logs
*** Variables ***
${nfsVolumeStore}= nfsVolumeStore
${nfsFakeVolumeStore}= nfsFakeVolumeStore
${nfsReadOnlyVolumeStore}= nfsReadOnlyVolumeStore
${unnamedNFSVolContainer} unnamedNFSvolContainer
${namedNFSVolContainer} namednfsVolContainer
${createFileContainer}= createFileContainer
${nfs_bogon_ip}= 198.51.100.1
${mntDataTestContainer}= mount-data-test
${mntTest}= /mnt/test
${mntNamed}= /mnt/named
*** Keywords ***
Setup ESX And NFS Suite
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
Log To Console \nStarting test...
${esx1} ${esx1_ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${POD}= Fetch POD ${esx1}
Log To Console ${POD}
Close Connection
${nfs} ${nfs_ip}= Deploy Nimbus NFS Datastore %{NIMBUS_USER} %{NIMBUS_PASSWORD} additional-args=--nimbus ${POD}
${nfs_readonly} ${nfs_readonly_ip}= Deploy Nimbus NFS Datastore %{NIMBUS_USER} %{NIMBUS_PASSWORD} additional-args=--disk 5000000 --disk 5000000 --mountOpt ro --nfsOpt ro --mountPoint=storage1 --mountPoint=storage2 --nimbus ${POD}
Set Suite Variable @{list} ${esx1} ${nfs} ${nfs_readonly}
Set Suite Variable ${ESX1} ${esx1}
Set Suite Variable ${ESX1_IP} ${esx1_ip}
Set Suite Variable ${NFS_IP} ${nfs_ip}
Set Suite Variable ${NFS} ${nfs}
Set Suite Variable ${NFS_READONLY_IP} ${nfs_readonly_ip}
# Enable logging on the nfs servers
${out}= Run Keyword And Ignore Error Run sshpass -p %{DEPLOYED_PASSWORD} ssh -o StrictHostKeyChecking\=no root@${NFS_IP} rpcdebug -m nfsd -s all
${out}= Run Keyword And Ignore Error Run sshpass -p %{DEPLOYED_PASSWORD} ssh -o StrictHostKeyChecking\=no root@${NFS_IP} rpcdebug -m rpc -s all
${out}= Run Keyword And Ignore Error Run sshpass -p %{DEPLOYED_PASSWORD} ssh -o StrictHostKeyChecking\=no root@${NFS_IP} service rpcbind restart
${out}= Run Keyword And Ignore Error Run sshpass -p %{DEPLOYED_PASSWORD} ssh -o StrictHostKeyChecking\=no root@${NFS_READONLY_IP} rpcdebug -m nfsd -s all
${out}= Run Keyword And Ignore Error Run sshpass -p %{DEPLOYED_PASSWORD} ssh -o StrictHostKeyChecking\=no root@${NFS_READONLY_IP} rpcdebug -m rpc -s all
${out}= Run Keyword And Ignore Error Run sshpass -p %{DEPLOYED_PASSWORD} ssh -o StrictHostKeyChecking\=no root@${NFS_READONLY_IP} service rpcbind restart
Setup ENV Variables for VIC Appliance Install
Log To Console \nSetup Environment Variables for VIC Appliance To ESX\n
Set Environment Variable TEST_URL_ARRAY ${ESX1_IP}
Set Environment Variable TEST_URL ${ESX1_IP}
Set Environment Variable TEST_USERNAME root
Set Environment Variable TEST_PASSWORD ${NIMBUS_ESX_PASSWORD}
Set Environment Variable TEST_DATASTORE datastore1
Set Environment Variable TEST_TIMEOUT 30m
Set Environment Variable HOST_TYPE ESXi
Remove Environment Variable TEST_DATACENTER
Remove Environment Variable TEST_RESOURCE
Remove Environment Variable BRIDGE_NETWORK
Remove Environment Variable PUBLIC_NETWORK
Verify NFS Volume Basic Setup
[Arguments] ${volumeName} ${containerName} ${nfsIP} ${rwORro}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name ${containerName} -v ${volumeName}:/mydata ${busybox} mount
Should Be Equal As Integers ${rc} 0
Should Contain ${output} ${nfsIP}://store/volumes/${volumeName}
Should Contain ${output} /mydata type nfs (${rwORro}
${ContainerRC} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} wait ${containerName}
Should Be Equal As Integers ${ContainerRC} 0
Should Not Contain ${output} Error response from daemon
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${containerName}
Should Be Equal As Integers ${rc} 0
Verify NFS Volume Already Created
[Arguments] ${containerVolName}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name=${containerVolName} --opt VolumeStore=${nfsVolumeStore}
Should Be Equal As Integers ${rc} 1
Should Contain ${output} Error response from daemon: A volume named ${containerVolName} already exists. Choose a different volume name.
Reboot VM and Verify Basic VCH Info
Log To Console Rebooting VCH\n - %{VCH-NAME}
Reboot VM %{VCH-NAME}
Wait For VCH Initialization 24x
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} images
Should Be Equal As Integers ${rc} 0
Should Contain ${output} ${busybox}
Gather NFS Logs
${out}= Run Keyword And Continue On Failure Run sshpass -p %{DEPLOYED_PASSWORD} ssh -o StrictHostKeyChecking\=no root@${NFS_IP} dmesg -T
Log ${out}
${out}= Run Keyword And Continue On Failure Run sshpass -p %{DEPLOYED_PASSWORD} ssh -o StrictHostKeyChecking\=no root@${NFS_READONLY_IP} dmesg -T
Log ${out}
NFS Volume Cleanup
Gather NFS Logs
Nimbus Cleanup ${list}
*** Test Cases ***
VIC Appliance Install with Read Only NFS Volume
Setup ENV Variables for VIC Appliance Install
# Will only produce a warning in VCH creation output
${output}= Install VIC Appliance To Test Server certs=${false} additional-args=--volume-store="nfs://${NFS_READONLY_IP}/exports/storage1?uid=0&gid=0:${nfsReadOnlyVolumeStore}"
Should Contain ${output} Installer completed successfully
Should Contain ${output} VolumeStore (${nfsReadOnlyVolumeStore}) cannot be brought online - check network, nfs server, and --volume-store configurations
Should Contain ${output} Not all configured volume stores are online - check port layer log via vicadmin
${rc} ${volumeOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --opt VolumeStore=${nfsReadOnlyVolumeStore}
Should Be Equal As Integers ${rc} 1
Should Contain ${volumeOutput} Error response from daemon: No volume store named (${nfsReadOnlyVolumeStore}) exists
VIC Appliance Install With Fake NFS Server
Setup ENV Variables for VIC Appliance Install
# Will only produce a warning in VCH creation output
${output}= Install VIC Appliance To Test Server certs=${false} additional-args=--volume-store="nfs://${nfs_bogon_ip}/store?uid=0&gid=0:${nfsFakeVolumeStore}"
Should Contain ${output} VolumeStore (${nfsFakeVolumeStore}) cannot be brought online - check network, nfs server, and --volume-store configurations
VIC Appliance Install With Correct NFS Server
Setup ENV Variables for VIC Appliance Install
Log To Console \nDeploy VIC Appliance To ESX
# Should succeed
${output}= Install VIC Appliance To Test Server certs=${false} additional-args=--volume-store="nfs://${NFS_IP}/store?uid=0&gid=0:${nfsVolumeStore}"
Should Contain ${output} Installer completed successfully
Simple Docker Volume Create
#Pull image ${busybox}
${rc} ${volumeOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --opt VolumeStore=${nfsVolumeStore}
Should Be Equal As Integers ${rc} 0
Set Suite Variable ${nfsUnNamedVolume} ${volumeOutput}
Verify NFS Volume Basic Setup ${nfsUnNamedVolume} ${unnamedNFSVolContainer} ${NFS_IP} rw
Docker Volume Create Named Volume
${rc} ${volumeOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name nfs-volume_%{VCH-NAME} --opt VolumeStore=${nfsVolumeStore}
Should Be Equal As Integers ${rc} 0
Should Be Equal As Strings ${volumeOutput} nfs-volume_%{VCH-NAME}
Set Suite Variable ${nfsNamedVolume} ${volumeOutput}
Verify NFS Volume Basic Setup nfs-volume_%{VCH-NAME} ${namedNFSVolContainer} ${NFS_IP} rw
Docker Volume Create Already Named Volume
Run Keyword And Ignore Error Verify NFS Volume Already Created ${nfsUnNamedVolume}
Run Keyword And Ignore Error Verify NFS Volume Already Created ${nfsNamedVolume}
Docker Volume Create with possibly Invalid Name
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name="test!@\#$%^&*()" --opt VolumeStore=${nfsVolumeStore}
Should Be Equal As Integers ${rc} 1
Should Be Equal As Strings ${output} Error response from daemon: volume name "test!@\#$%^&*()" includes invalid characters, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed
Docker Single Write and Read to/from File from one Container using NFS Volume
# Done with the same container for this test.
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name ${createFileContainer} -d -v ${nfsNamedVolume}:/mydata ${busybox} /bin/top -d 600
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec -i ${createFileContainer} sh -c "echo 'The Texas and Chile flag look similar.\n' > /mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec -i ${createFileContainer} sh -c "ls mydata/"
Should Be Equal As Integers ${rc} 0
Should Contain ${output} test_nfs_file.txt
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec -i ${createFileContainer} sh -c "cat mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
Should Contain ${output} The Texas and Chile flag look similar.
Docker Multiple Writes from Multiple Containers (one at a time) and Read from Another
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "echo 'The Chad and Romania flag look the same.\n' >> /mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "echo 'The Luxembourg and the Netherlands flag look exactly the same.\n' >> /mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "echo 'Norway and Iceland have flags that are basically inverses of each other.\n' >> /mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "cat mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
Should Contain ${output} The Texas and Chile flag look similar.
Should Contain ${output} The Chad and Romania flag look the same.
Should Contain ${output} The Luxembourg and the Netherlands flag look exactly the same.
Should Contain ${output} Norway and Iceland have flags that are basically inverses of each other.
Docker Read and Remove File
${rc} ${catID}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "cat mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} logs ${catID}
Should Contain ${output} Norway and Iceland have flags that are basically inverses of each other.
${rc} ${removeID}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "rm mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "cat mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 1
Should Contain ${output} cat: can't open 'mydata/test_nfs_file.txt': No such file or directory
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${catID}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} logs ${catID}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} cat: can't open 'mydata/test_nfs_file.txt': No such file or directory
Simultaneous Container Write to File
@{inputList}= Create List These flags also look similar to each other. Senegal and Mali. Indonesia and Monaco. New Zealand and Australia. Venezuela, Ecuador, and Colombia. Slovenia, Russia, and Slovakia.
${containers}= Create List
Log To Console \nSpin up Write Containers
:FOR ${item} IN @{inputList}
\ ${rc} ${id}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "while true; do echo ${item} >> /mydata/test_nfs_mult_write.txt; sleep 5; done"
\ Should Be Equal As Integers ${rc} 0
\ Append To List ${containers} ${id}
${rc} ${catOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "tail -40 /mydata/test_nfs_mult_write.txt"
Should Be Equal As Integers ${rc} 0
Log To Console \nCheck tail output for write items
:FOR ${item} IN @{inputList}
\ Should Contain ${catOutput} ${item}
Log To Console \nStop Write Containers
:FOR ${id} IN @{containers}
\ ${rc} ${stopOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} stop ${id}
\ Should Be Equal As Integers ${rc} 0
Simple Docker Volume Inspect
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume inspect ${nfsNamedVolume}
Should Be Equal As Integers ${rc} 0
${output}= Evaluate json.loads(r'''${output}''') json
${id}= Get From Dictionary ${output[0]} Name
Should Be Equal As Strings ${id} ${nfsNamedVolume}
Simple Volume ls Test
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume ls
Should Be Equal As Integers ${rc} 0
Should Contain ${output} vsphere
Should Contain ${output} ${nfsNamedVolume}
Should Contain ${output} ${nfsUnNamedVolume}
Should Contain ${output} DRIVER
Should Contain ${output} VOLUME NAME
Volume rm Tests
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume rm ${nfsUnNamedVolume}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume ls
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} ${nfsUnNamedVolume}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume rm ${nfsNamedVolume}
Should Be Equal As Integers ${rc} 1
Should Contain ${output} Error response from daemon: volume ${nfsNamedVolume} in use by
Docker Inspect Mount Data after Reboot
${rc} ${container}= Run And Return Rc And Output docker %{VCH-PARAMS} create --name ${mntDataTestContainer} -v ${mntTest} -v ${nfsNamedVolume}:${mntNamed} ${busybox}
Should Be Equal As Integers ${rc} 0
# Create check list for Volume Inspect
@{checkList}= Create List ${mntTest} ${mntNamed} ${nfsNamedVolume}
Verify Volume Inspect Info Before VM Reboot ${mntDataTestContainer} ${checkList}
# Gather logs before rebooting
Run Keyword And Continue On Failure Gather Logs From Test Server -before-reboot
Reboot VM and Verify Basic VCH Info
Verify Volume Inspect Info After VM Reboot ${mntDataTestContainer} ${checkList}
Kill NFS Server
Sleep 5 minutes
${rc} ${runningContainer}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "while true; do echo 'Still here...\n' >> /mydata/test_nfs_kill.txt; sleep 2; done"
Should Be Equal As Integers ${rc} 0
${rc} ${tailOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "tail -5 /mydata/test_nfs_kill.txt"
Should Be Equal As Integers ${rc} 0
Should Contain ${tailOutput} Still here...
Kill Nimbus Server %{NIMBUS_USER} %{NIMBUS_PASSWORD} ${NFS}
${status}= Get State Of Github Issue 5946
Run Keyword If '${status}' == 'closed' Fail Test 5-22-NFS-Volume.robot needs to be updated now that Issue #5946 has been resolved
# Issue 5946 should provide a better error message for the next three tests
${rc} ${tailOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "tail -5 /mydata/test_nfs_kill.txt"
Should Be Equal As Integers ${rc} 125
#Should Contain ${tailOutput} Server error from portlayer: unable to wait for process launch status:
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "echo 'Where am I writing to?...\n' >> /mydata/test_nfs_kill.txt"
Should Be Equal As Integers ${rc} 125
${rc} ${lsOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "ls mydata"
Should Be Equal As Integers ${rc} 125
#Should Contain ${lsOutput} Server error from portlayer: unable to wait for process launch status:

View File

@@ -0,0 +1,20 @@
Test 5-24 - Non vSphere Local Cluster
=======
# Purpose:
To verify that installing a VCH into a VC cluster that does not have vsphere.local domain configured works as expected
# References:
# Environment:
This test requires access to VMware Nimbus for dynamic vSphere configuration and creation
# Test Steps:
1. Create a simple vCenter cluster in Nimbus with the domain configured to vic.test instead of vsphere.local
2. Install a VCH
3. Run a variety of docker commands
# Expected Outcome:
* Each step should result in success
# Possible Problems:

View File

@@ -0,0 +1,84 @@
# 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 5-24 - Non vSphere Local Cluster
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Non vSphere Local Cluster Install Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
Test Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Non vSphere Local Cluster Install Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
Log To Console \nStarting simple VC cluster deploy...
${vc}= Evaluate 'VC-' + str(random.randint(1000,9999)) + str(time.clock()) modules=random,time
${pid}= Deploy Nimbus vCenter Server Async ${vc} --dirDomain vic.test
&{esxes}= Deploy Multiple Nimbus ESXi Servers in Parallel 3 %{NIMBUS_USER} %{NIMBUS_PASSWORD} ${ESX_VERSION}
@{esx_names}= Get Dictionary Keys ${esxes}
@{esx_ips}= Get Dictionary Values ${esxes}
Set Suite Variable @{list} @{esx_names}[0] @{esx_names}[1] @{esx_names}[2] %{NIMBUS_USER}-${vc}
# Finish vCenter deploy
${output}= Wait For Process ${pid} timeout=70 minutes on_timeout=terminate
Log ${output.stdout}
Log ${output.stderr}
Should Contain ${output.stdout} Overall Status: Succeeded
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc_ip}= Get IP ${vc}
Close Connection
Set Environment Variable GOVC_INSECURE 1
Set Environment Variable GOVC_USERNAME Administrator@vic.test
Set Environment Variable GOVC_PASSWORD Admin!23
Set Environment Variable GOVC_URL ${vc_ip}
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create dc1
Should Be Empty ${out}
Log To Console Create a cluster on the VC
${out}= Run govc cluster.create cls
Should Be Empty ${out}
Log To Console Add ESX host to the VC
:FOR ${IDX} IN RANGE 3
\ ${out}= Run govc cluster.add -hostname=@{esx_ips}[${IDX}] -username=root -dc=dc1 -password=${NIMBUS_ESX_PASSWORD} -noverify=true
\ Should Contain ${out} OK
Setup Network For Simple VC Cluster 3 dc1 cls
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /dc1/host/cls
Should Be Empty ${out}
Set Environment Variable TEST_URL_ARRAY ${vc_ip}
Set Environment Variable TEST_URL ${vc_ip}
Set Environment Variable TEST_USERNAME Administrator@vic.test
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable TEST_DATASTORE datastore1
Set Environment Variable TEST_DATACENTER /dc1
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server
Run Regression Tests

View File

@@ -0,0 +1,21 @@
Test 5-25 - OPS User Grant
=======
# Purpose:
To verify that VIC works properly when a VCH is installed with the option to create the proper permissions for the OPS-user
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a simple cluster
2. Create Local OPS User on VC
3. Give the Local OPS User ReadOnly Role on /
3. Install the VIC appliance into the cluster with the --ops-grant-perms option
4. Run a variety of docker operation on the VCH
# Expected Outcome:
All test steps should complete without error
# Possible Problems:
None

View File

@@ -0,0 +1,75 @@
# 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 5-25 - OPS-User-Grant
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Ops User Create
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
Test Teardown Run Keyword If Test Failed Gather VC Logs
*** Keywords ***
Gather VC Logs
Log To Console Collecting VC logs ..
Run Keyword And Ignore Error Gather Logs From ESX Server
Log To Console VC logs collected
Ops User Create
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
Set Suite Variable ${datacenter} datacenter1
Set Suite Variable ${cluster} cls1
${esx1} ${esx2} ${esx3} ${vc} ${esx1-ip} ${esx2-ip} ${esx3-ip} ${vc-ip}= Create a Simple VC Cluster ${datacenter} ${cluster}
Log To Console Finished Creating Cluster ${vc}
Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} %{NIMBUS_USER}-${vc}
${vc}= Set Variable vcname
Set Suite Variable ${ops_user_base_name} vch-user
Set Suite Variable ${ops_user_domain} vsphere.local
${ops_user_name}= Catenate SEPARATOR=@ ${ops_user_base_name} ${ops_user_domain}
Log To Console Base User Name: ${ops_user_base_name}
Log To Console Full User Name: ${ops_user_name}
Set Suite Variable ${ops_user_name}
Set Suite Variable ${ops_user_password} Admin!23
Set Suite Variable ${vc_admin_password} Admin!23
Log To Console Setting up ops-user: ${ops_user_name}
${rc} ${output}= Run And Return Rc And Output sshpass -p vmware ssh -o StrictHostKeyChecking=no root@${vc-ip} /usr/lib/vmware-vmafd/bin/dir-cli user create --account ${ops_user_base_name} --user-password ${ops_user_password} --first-name ${ops_user_base_name} --last-name ${ops_user_domain} --password ${vc_admin_password}
Log User Create ${ops_user_name}, rc: ${rc}, output: ${output}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output sshpass -p vmware ssh -o StrictHostKeyChecking=no root@${vc-ip} /usr/lib/vmware-vmafd/bin/dir-cli user find-by-name --account ${ops_user_base_name} --password ${vc_admin_password}
Log User Find ${ops_user_base_name}, rc: ${rc}, output: ${output}
Should Be Equal As Integers ${rc} 0
${out}= Run govc role.usage
Log Output, govc role.usage: ${out}
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server additional-args=--ops-user ${ops_user_name} --ops-password ${ops_user_password} --ops-grant-perms
# Run a govc test to check that access is denied on some resources
Log To Console Running govc to set drs-enabled, it should fail
${rc} ${output}= Run And Return Rc And Output GOVC_USERNAME=${ops_user_name} GOVC_PASSWORD=${ops_user_password} govc cluster.change -drs-enabled /${datacenter}/host/${cluster}
Log Govc output: ${output}
Should Be Equal As Integers ${rc} 1
Should Contain ${output} Permission to perform this operation was denied
Run Regression Tests
Cleanup VIC Appliance On Test Server

View File

@@ -0,0 +1,23 @@
Test 5-26 - Static IP Address
=======
# Purpose:
To verify that VIC works properly when a VCH is installed with a static IP address
# References:
1 `vic-machine-linux create -x`
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a simple cluster
2. Reserve a static IP address
3. Install the VIC appliance into the cluster with the new static IP address
4. Run a variety of docker operations on the VCH
# Expected Outcome:
All test steps should complete without error
# Possible Problems:
None

View File

@@ -0,0 +1,66 @@
# Copyright 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
*** Settings ***
Documentation Test 5-26 - Static IP Address
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Static IP Address Create
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
Static IP Address Create
[Timeout] 110 minutes
Log To Console Starting Static IP Address test...
Set Suite Variable ${NIMBUS_LOCATION} NIMBUS_LOCATION=wdc
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${name}= Evaluate 'vic-5-26-' + str(random.randint(1000,9999)) modules=random
${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --noSupportBundles --plugin testng --vcvaBuild ${VC_VERSION} --esxBuild ${ESX_VERSION} --testbedName vic-simple-cluster --testbedSpecRubyFile /dbc/pa-dbc1111/mhagen/nimbus-testbeds/testbeds/vic-simple-cluster.rb --runName ${name}
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc-ip}= Get IP ${name}.vc.0
${pod}= Fetch POD ${name}.vc.0
Set Suite Variable ${NIMBUS_POD} ${pod}
Close Connection
Set Suite Variable @{list} %{NIMBUS_USER}-${name}.esx.0 %{NIMBUS_USER}-${name}.esx.1 %{NIMBUS_USER}-${name}.esx.2 %{NIMBUS_USER}-${name}.nfs.0 %{NIMBUS_USER}-${name}.vc.0
Log To Console Finished Creating Cluster ${name}
${out}= Get Static IP Address
Set Suite Variable ${static} ${out}
Append To List ${list} %{STATIC_WORKER_NAME}
Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE nfs0-1
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 15m
*** Test Cases ***
Test
Log To Console \nStarting test...
Custom Testbed Keepalive /dbc/pa-dbc1111/mhagen
Install VIC Appliance To Test Server additional-args=--public-network-ip &{static}[ip]/&{static}[netmask] --public-network-gateway &{static}[gateway] --dns-server 10.170.16.48
Run Regression Tests

View File

@@ -0,0 +1,25 @@
Test 5-3 - Enhanced Linked Mode
=======
# Purpose:
To verify the VIC appliance works in when the vCenter appliance is using enhanced linked mode
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy two new vCenters in Nimbus each with one ESXi host configured
2. Establish an enhanced link between the two vCenters
3. Deploy VCH Appliance to the first vCenter cluster, referencing the cluster's own compute resources
4. Run a variety of docker commands on the VCH appliance
5. Deploy VCH Appliance to the first vCenter cluster, but reference the second cluster's resources through the enhanced link
6. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error in both scenarios and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,170 @@
# 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 5-3 - Enhanced Linked Mode
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Enhanced Link Mode Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
# Insert elements from dict2 into dict1, overwriting conflicts in dict1 & returning new dict
Combine Dictionaries
[Arguments] ${dict1} ${dict2}
${dict2keys}= Get Dictionary Keys ${dict2}
:FOR ${key} IN @{dict2keys}
\ ${elem}= Get From Dictionary ${dict2} ${key}
\ Set To Dictionary ${dict1} ${key} ${elem}
[Return] ${dict1}
Enhanced Link Mode Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${name}= Evaluate 'els-' + str(random.randint(1000,9999)) modules=random
Set Suite Variable ${user} %{NIMBUS_USER}
Log To Console \nDeploying Nimbus Testbed: ${name}
${pid}= Run Secret SSHPASS command %{NIMBUS_USER} '%{NIMBUS_PASSWORD}' 'nimbus-testbeddeploy --lease=1 --noStatsDump --noSupportBundles --plugin test-vpx --testbedName test-vpx-m2n2-vcva-3esx-pxeBoot-8gbmem --vcvaBuild ${VC_VERSION} --esxPxeDir ${ESX_VERSION} --runName ${name}'
&{esxes}= Create Dictionary
${num_of_esxes}= Evaluate 3
:FOR ${i} IN RANGE 3
# Deploy some ESXi instances
\ &{new_esxes}= Deploy Multiple Nimbus ESXi Servers in Parallel ${num_of_esxes} %{NIMBUS_USER} %{NIMBUS_PASSWORD}
\ ${esxes}= Combine Dictionaries ${esxes} ${new_esxes}
# Investigate to see how many were actually deployed
\ ${len}= Get Length ${esxes}
\ ${num_of_esxes}= Evaluate 3 - ${len}
# Exit if we've got enough & continue loop if we don't
\ Exit For Loop If ${len} >= 3
\ Log To Console Only got ${len} ESXi instance(s); Trying again
@{esx-names}= Get Dictionary Keys ${esxes}
@{esx-ips}= Get Dictionary Values ${esxes}
${esx1}= Get From List ${esx-names} 0
${esx2}= Get From List ${esx-names} 1
${esx3}= Get From List ${esx-names} 2
${esx4-ip}= Get From List ${esx-ips} 0
${esx5-ip}= Get From List ${esx-ips} 1
${esx6-ip}= Get From List ${esx-ips} 2
# Finish test bed deploy
${output}= Wait For Process ${pid} timeout=70 minutes on_timeout=terminate
Log ${output.stdout}
Log ${output.stderr}
Should Be Equal As Integers ${output.rc} 0
${output}= Split To Lines ${output.stdout}
:FOR ${line} IN @{output}
\ ${status}= Run Keyword And Return Status Should Contain ${line} ${name}.vc.0' is up. IP:
\ ${ip}= Run Keyword If ${status} Fetch From Right ${line} ${SPACE}
\ Run Keyword If ${status} Set Suite Variable ${vc1-ip} ${ip}
\ ${status}= Run Keyword And Return Status Should Contain ${line} ${name}.vc.1' is up. IP:
\ ${ip}= Run Keyword If ${status} Fetch From Right ${line} ${SPACE}
\ Run Keyword If ${status} Set Suite Variable ${vc2-ip} ${ip}
\ ${status}= Run Keyword And Return Status Should Contain ${line} ${name}.esx.0' is up. IP:
\ ${ip}= Run Keyword If ${status} Fetch From Right ${line} ${SPACE}
\ Run Keyword If ${status} Set Suite Variable ${esx1-ip} ${ip}
\ ${status}= Run Keyword And Return Status Should Contain ${line} ${name}.esx.1' is up. IP:
\ ${ip}= Run Keyword If ${status} Fetch From Right ${line} ${SPACE}
\ Run Keyword If ${status} Set Suite Variable ${esx2-ip} ${ip}
\ ${status}= Run Keyword And Return Status Should Contain ${line} ${name}.esx.2' is up. IP:
\ ${ip}= Run Keyword If ${status} Fetch From Right ${line} ${SPACE}
\ Run Keyword If ${status} Set Suite Variable ${esx3-ip} ${ip}
Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} ${user}-${name}.vc.0 ${user}-${name}.vc.1 ${user}-${name}.vc.2 ${user}-${name}.vc.3 ${user}-${name}.nfs.0 ${user}-${name}.esx.0 ${user}-${name}.esx.1 ${user}-${name}.esx.2
Remove Environment Variable GOVC_PASSWORD
Remove Environment Variable GOVC_USERNAME
Set Environment Variable GOVC_INSECURE 1
:FOR ${ip} IN ${esx1-ip} ${esx2-ip} ${esx3-ip}
\ Log To Console Changing password for ${ip}
\ Set Environment Variable GOVC_URL root:@${ip}
\ Wait Until Keyword Succeeds 10x 3 minutes Change ESXi Server Password e2eFunctionalTest
\ ${license}= Run govc license.ls
\ Check License Features
Set Environment Variable GOVC_URL ${vc1-ip}
Set Environment Variable GOVC_USERNAME administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin!23
${license}= Run govc license.ls
# First VC cluster
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create ha-datacenter
Should Be Empty ${out}
Log To Console Create a cluster on the VC
${out}= Run govc cluster.create cls
Should Be Empty ${out}
Log To Console Add ESX host to the VC
:FOR ${ip} IN ${esx1-ip} ${esx2-ip} ${esx3-ip}
\ Log To Console Adding ${ip} to VC
\ ${out}= Run govc cluster.add -hostname=${ip} -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
\ Should Contain ${out} OK
Create A Distributed Switch ha-datacenter
Create Three Distributed Port Groups ha-datacenter
Add Host To Distributed Switch /ha-datacenter/host/cls
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /ha-datacenter/host/cls
Should Be Empty ${out}
# Second VC cluster
Set Environment Variable GOVC_URL ${vc2-ip}
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create ha-datacenter
Should Be Empty ${out}
Log To Console Create a cluster on the VC
${out}= Run govc cluster.create cls
Should Be Empty ${out}
Log To Console Add ESX host to the VC
:FOR ${ip} IN @{esx-ips}
\ ${out}= Run govc cluster.add -hostname=${ip} -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
\ Should Contain ${out} OK
Create A Distributed Switch ha-datacenter
Create Three Distributed Port Groups ha-datacenter
Add Host To Distributed Switch /ha-datacenter/host/cls
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /ha-datacenter/host/cls
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable GOVC_URL ${vc1-ip}
Set Environment Variable TEST_URL_ARRAY ${vc1-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE datastore1
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
Test
Install VIC Appliance To Test Server
Run Regression Tests

View File

@@ -0,0 +1,32 @@
Test 5-4 - High Availability
=======
# Purpose:
To verify the VIC appliance works in when the vCenter appliance is using high availability
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
[2 - Managing HA Clusters](https://pubs.vmware.com/vsphere-50/index.jsp#com.vmware.wssdk.pg.doc_50/PG_Ch13_Resources.15.9.html)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with 3 ESXi hosts in a cluster
2. Enable HA on the cluster:
```govc cluster.change -drs-enabled -ha-enabled /ha-datacenter/host/cls```
3. Deploy a new VCH Appliance to the cluster
4. Run a variety of docker commands on the VCH appliance
5. Create a named volume
6. Create a container with a mounted anonymous and named volume
7. Verify that the volumes are still there using inspect before powering off the ESXi
8. Power off the ESXi host that the VCH is currently running on
9. Verify that the volumes are still there using inspect after powering off the ESXi
10. Clean up the created container (docker rm)
11. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,244 @@
# 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 5-4 - High Availability
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m High Availability Setup
Suite Teardown Nimbus Cleanup ${list}
Test Teardown Run Keyword If Test Failed Gather Logs From Test Server
*** Variables ***
${esx_number}= 3
${datacenter}= ha-datacenter
${namedVolume}= named-volume
${mntDataTestContainer}= mount-data-test
${mntTest}= /mnt/test
${mntNamed}= /mnt/named
*** Keywords ***
Run Regression Test With More Log Information
Check ImageStore
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
Check ImageStore
# Pull an image that has been pulled already
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
Check ImageStore
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} images
Should Be Equal As Integers ${rc} 0
Should Contain ${output} busybox
${rc} ${container}= Run And Return Rc And Output docker %{VCH-PARAMS} create busybox /bin/top
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${container}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} ps
Should Be Equal As Integers ${rc} 0
Should Contain ${output} /bin/top
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} stop ${container}
Should Be Equal As Integers ${rc} 0
Wait Until Container Stops ${container}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} ps -a
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Exited
${vmName}= Get VM Display Name ${container}
Wait Until Keyword Succeeds 5x 10s Check For The Proper Log Files ${vmName}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${container}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} ps -a
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} /bin/top
Check ImageStore
# Check for regression for #1265
${rc} ${container1}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it busybox /bin/top
Should Be Equal As Integers ${rc} 0
${rc} ${container2}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it busybox
Should Be Equal As Integers ${rc} 0
${shortname}= Get Substring ${container2} 1 12
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} ps -a
${lines}= Get Lines Containing String ${output} ${shortname}
Should Not Contain ${lines} /bin/top
${rc}= Run And Return Rc docker %{VCH-PARAMS} rm ${container1}
Should Be Equal As Integers ${rc} 0
Check ImageStore
${rc}= Run And Return Rc docker %{VCH-PARAMS} rm ${container2}
Should Be Equal As Integers ${rc} 0
Check ImageStore
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rmi busybox
Should Be Equal As Integers ${rc} 0
Check ImageStore
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} images
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} busybox
Scrape Logs For The Password
High Availability Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${vc}= Evaluate 'VC-' + str(random.randint(1000,9999)) + str(time.clock()) modules=random,time
${pid}= Deploy Nimbus vCenter Server Async ${vc}
Set Suite Variable ${VC} ${vc}
Log To Console \nStarting test...
&{esxes}= Deploy Multiple Nimbus ESXi Servers in Parallel 3 %{NIMBUS_USER} %{NIMBUS_PASSWORD}
@{esx_names}= Get Dictionary Keys ${esxes}
@{esx_ips}= Get Dictionary Values ${esxes}
Set Suite Variable @{list} @{esx_names}[0] @{esx_names}[1] @{esx_names}[2] %{NIMBUS_USER}-${vc}
# Finish vCenter deploy
${output}= Wait For Process ${pid}
Should Contain ${output.stdout} Overall Status: Succeeded
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc_ip}= Get IP ${vc}
Close Connection
Set Environment Variable GOVC_INSECURE 1
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin!23
Set Environment Variable GOVC_URL ${vc_ip}
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create ${datacenter}
Should Be Empty ${out}
Log To Console Create a cluster on the VC
${out}= Run govc cluster.create cls
Should Be Empty ${out}
Create A Distributed Switch ${datacenter}
Create Three Distributed Port Groups ${datacenter}
Log To Console Add ESX hosts to the cluster
:FOR ${IDX} IN RANGE ${esx_number}
\ ${out}= Run govc cluster.add -hostname=@{esx_ips}[${IDX}] -username=root -dc=${datacenter} -password=${NIMBUS_ESX_PASSWORD} -noverify=true
\ Should Contain ${out} OK
Log To Console Add all the hosts to the distributed switch
Wait Until Keyword Succeeds 5x 5min Add Host To Distributed Switch /${datacenter}/host/cls
Log To Console Enable HA and DRS on the cluster
${out}= Run govc cluster.change -drs-enabled -ha-enabled /${datacenter}/host/cls
Should Be Empty ${out}
${name} ${ip}= Deploy Nimbus NFS Datastore %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Append To List ${list} ${name}
${out}= Run govc datastore.create -mode readWrite -type nfs -name nfsDatastore -remote-host ${ip} -remote-path /store /ha-datacenter/host/cls
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc_ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Set Environment Variable TEST_RESOURCE cls
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE nfsDatastore
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
Test
Install VIC Appliance To Test Server certs=${false} vol=default
Run Regression Tests
# have a few containers running and stopped for when we
# shut down the host and HA brings it up again
# make sure we have busybox
Pull image busybox
@{running}= Create List
:FOR ${index} IN RANGE 3
\ ${rc} ${c}= Run And Return Rc And Output docker %{VCH-PARAMS} run -itd busybox
\ Should Be Equal As Integers ${rc} 0
\ Append To List ${running} ${c}
@{stopped}= Create List
:FOR ${index} IN RANGE 3
\ ${rc} ${c}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d busybox ls
\ Should Be Equal As Integers ${rc} 0
\ Append To List ${stopped} ${c}
# Speculating that this is here to add some stability if VMs vmotion immediately after power on
# If so it should be replaced with a check for active tasks running against the VM or a DRS rule to avoid it completely
Sleep 2 minutes
${curHost}= Get VM Host Name %{VCH-NAME}
${info}= Run govc vm.info \\*
Log ${info}
Log To Console \nCreate a named volume and mount it to a container (Mount Inspect Test 1 of 2 - before VCH restart)\n
${rc} ${container}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name=${namedVolume}
Should Be Equal As Integers ${rc} 0
Should Contain ${container} ${namedVolume}
${rc} ${containerMountDataTestID}= Run And Return Rc And Output docker %{VCH-PARAMS} create --name=${mntDataTestContainer} -v ${mntTest} -v ${namedVolume}:${mntNamed} busybox
Should Be Equal As Integers ${rc} 0
# Create check list for Volume Inspect
@{checkList}= Create List ${mntTest} ${mntNamed} ${namedVolume}
Verify Volume Inspect Info Before Host Power OFF ${containerMountDataTestID} ${checkList}
Power Off Host ${curHost}
${info}= Run govc vm.info \\*
Log ${info}
# It can take a while for the host to power down and for HA to kick in
Wait Until Keyword Succeeds 24x 10s VM Host Has Changed ${curHost} %{VCH-NAME}
# Wait for the VCH to come back up fully - if it's not completely reinitialized it will still report the old IP address
Wait For VCH Initialization 12x 20 seconds
${info}= Run govc vm.info \\*
Log ${info}
Verify Volume Inspect Info After Host Power OFF ${containerMountDataTestID} ${checkList}
# Remove Mount Data Test Container
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${containerMountDataTestID}
Should Be Equal As Integers ${rc} 0
Wait Until Keyword Succeeds 10x 6s Check That VM Is Removed ${containerMountDataTestID}
# check running containers are still running
:FOR ${c} IN @{running}
\ ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} inspect --format '{{.State.Status}}' ${c}
\ Should Be Equal As Integers ${rc} 0
\ Should Be Equal ${output} running
\ ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm -f ${c}
\ Log To Console ${output}
\ Should Be Equal As Integers ${rc} 0
# check stopped containers are still stopped
:FOR ${c} IN @{stopped}
\ ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} inspect --format '{{.State.Status}}' ${c}
\ Should Be Equal As Integers ${rc} 0
\ Should Be Equal ${output} exited
\ ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm -f ${c}
\ Log To Console ${output}
\ Should Be Equal As Integers ${rc} 0
Run Regression Tests
Run Regression Test With More Log Information

View File

@@ -0,0 +1,25 @@
Test 5-5 - Heterogeneous ESXi
=======
# Purpose:
To verify the VIC appliance works when the vCenter appliance is using multiple different ESXi versions
# References:
[1 - VMware vCenter Server Availability Guide](http://www.vmware.com/files/pdf/techpaper/vmware-vcenter-server-availability-guide.pdf)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with a cluster in Nimbus
2. Deploy three different ESXi hosts with build numbers(6.0.0u2, 5.5u3, 6.5RC1):
```3620759``` and ```3029944``` and ```4240417```
3. Add each host to the cluster
4. Deploy a VCH appliance to the cluster allowing DRS to manage placement
5. Run a variety of docker commands on each of the VCH appliances.
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,111 @@
# 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 5-1 - Distributed Switch
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Heterogenous ESXi Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
Heterogenous ESXi Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${vc}= Evaluate 'VC-' + str(random.randint(1000,9999)) + str(time.clock()) modules=random,time
${pid-vc}= Deploy Nimbus vCenter Server Async ${vc}
Set Suite Variable @{list} %{NIMBUS_USER}-${vc}
Run Keyword And Ignore Error Cleanup Nimbus PXE folder %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${esx1} ${esx1-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD} 3029944
Append To List ${list} ${esx1}
Run Keyword And Ignore Error Cleanup Nimbus PXE folder %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${esx2} ${esx2-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD} 5572656
Append To List ${list} ${esx2}
Run Keyword And Ignore Error Cleanup Nimbus PXE folder %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${esx3} ${esx3-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Append To List ${list} ${esx3}
# Finish vCenter deploy
${output}= Wait For Process ${pid-vc} timeout=40 minutes on_timeout=terminate
Log ${output.stdout}
Log ${output.stderr}
${status}= Run Keyword And Return Status Should Contain ${output.stdout} Overall Status: Succeeded
# Try again, if the VC failed quickly we might have enough time to try again
${pid-vc}= Run Keyword Unless ${status} Deploy Nimbus vCenter Server Async ${vc}
${output}= Run Keyword Unless ${status} Wait For Process ${pid-vc} timeout=40 minutes on_timeout=terminate
Run Keyword Unless ${status} Log ${output.stdout}
Run Keyword Unless ${status} Log ${output.stderr}
Run Keyword Unless ${status} Should Contain ${output.stdout} Overall Status: Succeeded
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc-ip}= Get IP ${vc}
Close Connection
Set Environment Variable GOVC_INSECURE 1
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin!23
Set Environment Variable GOVC_URL ${vc-ip}
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create ha-datacenter
Should Be Empty ${out}
Log To Console Create a cluster on the VC
${out}= Run govc cluster.create cls
Should Be Empty ${out}
Log To Console Add ESX host to the VC
Add Host To VCenter ${esx1-ip} root ha-datacenter e2eFunctionalTest
Add Host To VCenter ${esx2-ip} root ha-datacenter e2eFunctionalTest
${vc-ver}= Run govc about | grep Version:
${vc-ver}= Fetch From Right ${vc-ver} ${SPACE}
Run Keyword If '${vc-ver}' == '6.5.0' Add Host To VCenter ${esx3-ip} root ha-datacenter e2eFunctionalTest
Create A Distributed Switch ha-datacenter
Create Three Distributed Port Groups ha-datacenter
Add Host To Distributed Switch /ha-datacenter/host/cls
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /ha-datacenter/host/cls
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
${name} ${ip}= Deploy Nimbus NFS Datastore %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Append To List ${list} ${name}
${out}= Run govc datastore.create -mode readWrite -type nfs -name nfsDatastore -remote-host ${ip} -remote-path /store /ha-datacenter/host/cls
Should Be Empty ${out}
Set Environment Variable TEST_DATASTORE nfsDatastore
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server certs=${false} vol=default
Run Regression Tests

View File

@@ -0,0 +1,23 @@
Test 5-6-1 - VSAN-Simple
=======
# Purpose:
To verify the VIC appliance works with VMware Virtual SAN
# References:
[1 - VMware Virtual SAN](http://www.vmware.com/products/virtual-san.html)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter in Nimbus:
```--testbedName test-vpx-4esx-virtual-fullInstall-vcva-8gbmem```
2. Deploy VCH Appliance to the new vCenter
3. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
* None

View File

@@ -0,0 +1,72 @@
# 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 5-6-1 - VSAN-Simple
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Simple VSAN Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
Simple VSAN Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${name}= Evaluate 'vic-vsan-' + str(random.randint(1000,9999)) modules=random
Set Suite Variable ${user} %{NIMBUS_USER}
${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --plugin testng --vcfvtBuildPath /dbc/pa-dbc1111/mhagen/ --noSupportBundles --vcvaBuild ${VC_VERSION} --esxPxeDir ${ESX_VERSION} --esxBuild ${ESX_VERSION} --testbedName vic-vsan-simple-pxeBoot-vcva --runName ${name}
Should Contain ${out} "deployment_result"=>"PASS"
${out}= Split To Lines ${out}
:FOR ${line} IN @{out}
\ ${status}= Run Keyword And Return Status Should Contain ${line} .vcva-${VC_VERSION}' is up. IP:
\ ${ip}= Run Keyword If ${status} Fetch From Right ${line} ${SPACE}
\ Run Keyword If ${status} Set Suite Variable ${vc-ip} ${ip}
\ Exit For Loop If ${status}
Set Suite Variable @{list} ${user}-${name}.vcva-${VC_VERSION} ${user}-${name}.esx.0 ${user}-${name}.esx.1 ${user}-${name}.esx.2 ${user}-${name}.esx.3 ${user}-${name}.nfs.0 ${user}-${name}.iscsi.0
Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23
Add Host To Distributed Switch /vcqaDC/host/cls
Log To Console Enable DRS and VSAN on the cluster
${out}= Run govc cluster.change -drs-enabled /vcqaDC/host/cls
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE vsanDatastore
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 15m
*** Test Cases ***
Simple VSAN
${out}= Run govc datastore.vsan.dom.ls -ds %{TEST_DATASTORE} -l -o
Should Be Empty ${out}
Custom Testbed Keepalive /dbc/pa-dbc1111/mhagen
Install VIC Appliance To Test Server
Run Regression Tests
Cleanup VIC Appliance On Test Server
${out}= Run govc datastore.vsan.dom.ls -ds %{TEST_DATASTORE} -l -o
Should Be Empty ${out}

View File

@@ -0,0 +1,23 @@
Test 5-6-2 - VSAN-Complex
=======
# Purpose:
To verify the VIC appliance works with VMware Virtual SAN
# References:
[1 - VMware Virtual SAN](http://www.vmware.com/products/virtual-san.html)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a complex test bed in Nimbus:
```--testbedName test-vpx-4esx-virtual-fullInstall-vcva-8gbmem```
2. Deploy VCH Appliance to the new vCenter
3. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
* None

View File

@@ -0,0 +1,73 @@
# 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 5-6-2 - VSAN-Complex
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m VSAN Complex Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
VSAN Complex Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${name}= Evaluate 'vic-vsan-complex-' + str(random.randint(1000,9999)) modules=random
Set Suite Variable ${user} %{NIMBUS_USER}
${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --plugin testng --vcfvtBuildPath /dbc/pa-dbc1111/mhagen/ --noSupportBundles --vcvaBuild ${VC_VERSION} --esxPxeDir ${ESX_VERSION} --esxBuild ${ESX_VERSION} --testbedName vic-vsan-complex-pxeBoot-vcva --runName ${name}
Should Contain ${out} "deployment_result"=>"PASS"
${out}= Split To Lines ${out}
:FOR ${line} IN @{out}
\ ${status}= Run Keyword And Return Status Should Contain ${line} .vcva-${VC_VERSION}' is up. IP:
\ ${ip}= Run Keyword If ${status} Fetch From Right ${line} ${SPACE}
\ Run Keyword If ${status} Set Suite Variable ${vc-ip} ${ip}
\ Exit For Loop If ${status}
Set Suite Variable @{list} ${user}-${name}.vcva-${VC_VERSION} ${user}-${name}.esx.0 ${user}-${name}.esx.1 ${user}-${name}.esx.2 ${user}-${name}.esx.3 ${user}-${name}.esx.4 ${user}-${name}.esx.5 ${user}-${name}.esx.6 ${user}-${name}.esx.7 ${user}-${name}.nfs.0 ${user}-${name}.iscsi.0
Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23
Wait Until Keyword Succeeds 5x 5min Add Host To Distributed Switch /vcqaDC/host/cluster-vsan-1
Log To Console Enable DRS and VSAN on the cluster
${out}= Run govc cluster.change -drs-enabled /vcqaDC/host/cluster-vsan-1
Should Be Empty ${out}
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
${datastore}= Run govc ls -t Datastore host/cluster-vsan-1/* | grep -v local | cut -d '/' -f 6 | sort | uniq | grep vsan
Set Environment Variable TEST_DATASTORE "${datastore}"
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_RESOURCE cluster-vsan-1
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
Complex VSAN
${out}= Run govc datastore.vsan.dom.ls -ds %{TEST_DATASTORE} -l -o
Should Be Empty ${out}
Custom Testbed Keepalive /dbc/pa-dbc1111/mhagen
Install VIC Appliance To Test Server
Run Regression Tests
Cleanup VIC Appliance On Test Server
${out}= Run govc datastore.vsan.dom.ls -ds %{TEST_DATASTORE} -l -o
Should Be Empty ${out}

View File

@@ -0,0 +1,75 @@
Test 5-7 - NSX
=======
# Purpose:
To verify the VIC appliance works when the vCenter is using NSX-v networking
# References:
[1 - VMware NSX](http://www.vmware.com/products/nsx.html)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy NSX
`/mts/git/bin/nimbus-vsmdeploy --nics 1 --vsmBuild ob-5007049 vic-3-nsxv-mgr`
2. Deploy VC + VSAN
`/mts/git/bin/nimbus-testbeddeploy --noSupportBundles --vcvaBuild 4944578 --esxPxeDir 4887370 --esxBuild 4887370 --testbedName vcqa-vsan- simple-pxeBoot-vcva --runName vsan`
3. Register NSX-v to VC from Manage vCenter Registration, to add the VC info (NSX Credential: admin/default).
4. Assign NSXv License in VC from Assets → Solutions → All Actions → Assign License → Add License → Select the new added license → OK
5. Create a Distributed Switch
- Edit the new added DVS MTU value of DVS from default 1500 to 9000
- Select the new added DVS and Add all hosts in the cluster
- Assign vmnic1 for this switch per host (remain vmnic0 with vSwitch0 to get the external IP)
6. Prepare IP of NSX Controller
- Select one host which will create NSX controller in.
- Login the host via ssh, get host's network info 1). Netmask 2). Gateway.
- `esxcli network ip interface ipv4 get`
7. Install a NSX Controller from Networking & Security
- Add Name, select dc, cluster, datastore as usual
- Modify to VM Network rather than Distributed Port Group. Because Controller need to get an external IP
- Go to IP Pool Select New IP Pool
- Define Gateway, Prefix Length got from #VC Preparation section
- In Static IP Pool part, add <unused-IP>-<unused-IP>. For example: 10.162.57.43-10.162.57.43
- Click ok to create the controller.
8. Install NSX components on ESX from Home, Networking & Security, Installation, Host Preparation to all the host in cluster.
9. Configure VXLAN
- Click Not Configured in VXLAN column → Keep value as default except 'VMKNic IP Addressing'
`Default MTU is 1600, make sure the MTU of DVS is larger than this one (set as 9000 manually previously)`
- For 'VMKNic IP Addressing' field, default is 'Use DHCP', change it to 'Use IP Pool'.
- Choose 'New IP Pool', add new ip pool info.
- `It's recommended to define an internal IP pool in order to isolate from management network`
- `Example: Name → internel-vxlan-ip-pool, Gateway → 192.168.0.254, Prefix Legth → 24`
- `Static IP Pool → 192.168.0.1-192.168.0.10 (Depends on how many host this VXLAN managed, length of IP pool > num of hosts)`
- Check VXLAN is installed on ESX (vmk1 is newly created)
- Show the vmknic info of VXLAN from Web Client: ( Installation → Logical Network Preparation → VXLAN Transport)
- Check the network settings from the host
- `esxcli network ip interface list`
- `net-vdl2 -l`
- Check vmknic created by VXLAN among all hosts are ping-able
- `esxcli network ip interface ipv4 get`
10. Create Logical Switch
- Go to Home → Networking & Security → Installation → Logical Network Preparation
- Remain info in 'VXLAN Transport' as default
- Go to 'Segment ID' → Edit → Add the value of 'Segment ID pool', for example '5001-50000'
- Go to 'Transport Zones' → Click Add → Create a Transport Zone → Add Name / Description properly,
- `Remain Replication mode as 'Unicast', Select cluster that will be part of this Transport Zones`
11. Deploy VCH Appliance to the new vCenter
12. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,86 @@
# 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 5-7 - NSX
Resource ../../resources/Util.robot
Force Tags nsx
*** Keywords ***
NSX Install VIC Appliance To Test Server
[Arguments] ${vic-machine}=bin/vic-machine-linux ${appliance-iso}=bin/appliance.iso ${bootstrap-iso}=bin/bootstrap.iso ${certs}=${true} ${vol}=default ${cleanup}=${true} ${debug}=1 ${additional-args}=${EMPTY}
Set Test Environment Variables
# disable firewall
Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc host.esxcli network firewall set -e false
# Attempt to cleanup old/canceled tests
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling VMs On Test Server
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Datastore On Test Server
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling Networks On Test Server
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling vSwitches On Test Server
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling Containers On Test Server
Run Keyword If ${cleanup} Run Keyword And Ignore Error Cleanup Dangling Resource Pools On Test Server
# Install the VCH now
Log To Console \nInstalling VCH to test server...
${output}= NSX Run VIC Machine Command ${vic-machine} ${appliance-iso} ${bootstrap-iso} ${certs} ${vol} ${debug} ${additional-args}
Log ${output}
Should Contain ${output} Installer completed successfully
Get Docker Params ${output} ${certs}
Log To Console Installer completed successfully: %{VCH-NAME}...
[Return] ${output}
NSX Run VIC Machine Command
[Tags] secret
[Arguments] ${vic-machine} ${appliance-iso} ${bootstrap-iso} ${certs} ${vol} ${debug} ${additional-args}
${output}= Run Keyword If ${certs} Run ${vic-machine} create --debug ${debug} --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --image-store=%{TEST_DATASTORE} --appliance-iso=${appliance-iso} --bootstrap-iso=${bootstrap-iso} --password=%{TEST_PASSWORD} --force=true --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} --compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT} --insecure-registry harbor.ci.drone.local --volume-store=%{TEST_DATASTORE}/%{VCH-NAME}-VOL:${vol} ${vicmachinetls} ${additional-args}
Run Keyword If ${certs} Should Contain ${output} Installer completed successfully
Return From Keyword If ${certs} ${output}
${output}= Run Keyword Unless ${certs} Run ${vic-machine} create --debug ${debug} --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --image-store=%{TEST_DATASTORE} --appliance-iso=${appliance-iso} --bootstrap-iso=${bootstrap-iso} --password=%{TEST_PASSWORD} --force=true --bridge-network=%{BRIDGE_NETWORK} --public-network=%{PUBLIC_NETWORK} --compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT} --insecure-registry harbor.ci.drone.local --volume-store=%{TEST_DATASTORE}/%{VCH-NAME}-VOL:${vol} --no-tlsverify ${additional-args}
Run Keyword Unless ${certs} Should Contain ${output} Installer completed successfully
[Return] ${output}
*** Test Cases ***
Test
Log To Console \nWait until Nimbus is at least available...
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS2_USER} %{NIMBUS2_PASSWORD}
${out}= Execute Command nimbus-ctl --lease 5 extend_lease '*'
Log ${out}
Close Connection
Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL 10.160.21.102
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY 10.160.21.102
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK vxw-dvs-53-virtualwire-1-sid-5001-nsx-switch
Set Environment Variable PUBLIC_NETWORK 'VM Network'
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE vsanDatastore
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
NSX Install VIC Appliance To Test Server certs=${false} vol=default
Run Regression Tests
Cleanup VIC Appliance On Test Server

View File

@@ -0,0 +1,24 @@
Test 5-8 - DRS
=======
# Purpose:
To verify the VIC appliance detects when DRS should be enabled and fuctions properly when used with DRS
# References:
[1 - Managing DRS Clusters](https://pubs.vmware.com/vsphere-50/index.jsp?topic=%2Fcom.vmware.wssdk.pg.doc_50%2FPG_Ch13_Resources.15.8.html)
# Environment:
This test requires access to VMWare Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with 3 ESXi hosts in a cluster but with DRS disabled
2. Attempt to install a VCH appliance into the cluster
3. Enable DRS on the cluster
4. Re-attempt to install a VCH appliance into the cluster
5. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The first VCH appliance install should provide an error indicating that DRS must be enabled, the second VCH appliance install should deploy without error and each of the docker commands executed against it should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,92 @@
# 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 5-8 - DRS
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m DRS Setup
Suite Teardown Nimbus Cleanup ${list}
*** Keywords ***
DRS Setup
[Timeout] 110 minutes
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${esx1} ${esx1-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable ${ESX1} ${esx1}
${esx2} ${esx2-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable ${ESX2} ${esx2}
${esx3} ${esx3-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable ${ESX3} ${esx3}
${vc} ${vc-ip}= Deploy Nimbus vCenter Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable ${VC} ${vc}
Set Suite Variable @{list} ${esx1} ${esx2} ${esx3} ${vc}
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create ha-datacenter
Should Be Empty ${out}
Log To Console Create a cluster on the VC
${out}= Run govc cluster.create cls
Should Be Empty ${out}
Log To Console Add ESX host to the VC
${out}= Wait Until Keyword Succeeds 5x 15 seconds Run govc cluster.add -hostname=${esx1-ip} -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
${out}= Wait Until Keyword Succeeds 5x 15 seconds Run govc cluster.add -hostname=${esx2-ip} -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
${out}= Wait Until Keyword Succeeds 5x 15 seconds Run govc cluster.add -hostname=${esx3-ip} -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
Log To Console Create a distributed switch
${out}= Run govc dvs.create -dc=ha-datacenter test-ds
Should Contain ${out} OK
Log To Console Create three new distributed switch port groups for management and vm network traffic
${out}= Run govc dvs.portgroup.add -nports 12 -dc=ha-datacenter -dvs=test-ds management
Should Contain ${out} OK
${out}= Run govc dvs.portgroup.add -nports 12 -dc=ha-datacenter -dvs=test-ds vm-network
Should Contain ${out} OK
${out}= Run govc dvs.portgroup.add -nports 12 -dc=ha-datacenter -dvs=test-ds bridge
Should Contain ${out} OK
Log To Console Add all the hosts to the distributed switch
Wait Until Keyword Succeeds 5x 5min Add Host To Distributed Switch /ha-datacenter/host/cls
Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE datastore1
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
Test
Log To Console \nStarting test...
${status} ${message}= Run Keyword And Ignore Error Install VIC Appliance To Test Server certs=${false} vol=default
Should Contain ${message} DRS must be enabled to use VIC
Should Be Equal As Strings ${status} FAIL
Log To Console Enable DRS on the cluster
${out}= Run govc cluster.change -drs-enabled /ha-datacenter/host/cls
Should Be Empty ${out}
Install VIC Appliance To Test Server certs=${false} vol=default
Run Regression Tests

View File

@@ -0,0 +1,28 @@
Test 5-9 - Private Registry
=======
# Purpose:
To verify the VIC appliance can pull an image from a private registry
# References:
[1 - Docker Registry](https://hub.docker.com/_/registry/)
# Environment:
This test requires access to a vSphere Server
# Test Steps:
1. Install a new VCH appliance into the vSphere Server
2. Start the docker registry locally:
```docker run -d -p 5000:5000 --name registry registry```
3. Pull an image and tag it for the new local registry:
```docker tag busybox localhost:5000/busybox:latest```
4. Push the tagged image to the registry:
```docker push localhost:5000/busybox```
5. Attempt to pull the local registry image using the VCH appliance:
```docker pull %{VCH-PARAMS} 172.17.0.1:5000/busybox```
# Expected Outcome:
The VCH appliance should be able to successfully pull the image from a local registry without error
# Possible Problems:
The default network on VCH containers is in the 172.17.0.x space, but this could potentially change. If you are having issues running the tests make sure that the container has an IP address in that network space.

View File

@@ -0,0 +1,64 @@
# 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 5-9 - Private Registry
Resource ../../resources/Util.robot
#Suite Setup Private Registry Setup
#Suite Teardown Private Registry Cleanup
*** Keywords ***
Private Registry Setup
[Timeout] 110 minutes
${dockerHost}= Get Environment Variable DOCKER_HOST ${SPACE}
Remove Environment Variable DOCKER_HOST
${rc} ${output}= Run And Return Rc And Output docker run -d -p 5000:5000 --name registry registry
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker pull busybox
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker tag busybox localhost:5000/busybox:latest
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker push localhost:5000/busybox
Should Be Equal As Integers ${rc} 0
Set Environment Variable DOCKER_HOST ${dockerHost}
Private Registry Cleanup
${dockerHost}= Get Environment Variable DOCKER_HOST ${SPACE}
Remove Environment Variable DOCKER_HOST
${rc} ${output}= Run And Return Rc And Output docker rm -f registry
Should Be Equal As Integers ${rc} 0
Set Environment Variable DOCKER_HOST ${dockerHost}
Pull image
[Arguments] ${image}
Log To Console \nRunning docker pull ${image}...
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull ${image}
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Digest:
Should Contain ${output} Status:
Should Not Contain ${output} No such image:
*** Test Cases ***
Pull an image from non-default repo
Pass Execution This test needs to be re-written
Install VIC Appliance To Test Server vol=default --insecure-registry 172.17.0.1:5000
Wait Until Keyword Succeeds 5x 15 seconds Pull image 172.17.0.1:5000/busybox
Cleanup VIC Appliance On Test Server
Pull image from non-whitelisted repo
Pass Execution This test needs to be re-written
Install VIC Appliance To Test Server vol=default
${rc} ${output}= Run And Return Rc And Output docker ${params} pull 172.17.0.1:5000/busybox
Should Contain ${output} Error response from daemon: Head https://172.17.0.1:5000/v2/: http: server gave HTTP response to HTTPS client

View File

@@ -0,0 +1,54 @@
Group 5 - Functional Tests
=======
[Test 5-1 - Distributed Switch](5-1-Distributed-Switch.md)
-
[Test 5-2 - Cluster](5-2-Cluster.md)
-
[Test 5-3 - Enhanced Linked Mode](5-3-Enhanced-Linked-Mode.md)
-
[Test 5-4 - High Availability](5-4-High-Availability.md)
-
[Test 5-5 - Heterogeneous ESXi](5-5-Heterogeneous-ESXi.md)
-
[Test 5-6 - VSAN](5-6-VSAN.md)
-
[Test 5-7 - NSX](5-7-NSX.md)
-
[Test 5-8 - DRS](5-8-DRS.md)
-
[Test 5-9 - Private Registry](5-9-Private-Registry.md)
-
[Test 5-10 - Multiple Datacenter](5-10-Multiple-Datacenter.md)
-
[Test 5-11 - Multiple Cluster](5-11-Multiple-Cluster.md)
-
[Test 5-12 - Multiple VLAN](5-12-Multiple-VLAN.md)
-
[Test 5-13 - Invalid ESXi Install](5-13-Invalid-ESXi-Install.md)
-
[Test 5-14 - Remove Container OOB](5-14-Remove-Container-OOB.md)
-
[Test 5-15 - NFS Datastore](5-15-NFS-Datastore.md)
-
[Test 5-16 - iSCSI Datastore](5-16-iSCSI-Datastore.md)
-
[Test 5-17 - FC Datastore](5-17-FC-Datastore.md)
-
[Test 5-18 - Datastore Cluster SDRS](5-18-Datastore-Cluster-SDRS.md)
-
[Test 5-19 - ROBO SKU](5-19-ROBO-SKU.md)
-
[Test 5-21 - Datastore Path](5-21-Datastore-Path.md)
-
[Test 5-22 - NFS Volume](5-22-NFS-Volume.md)
-
[Test 5-24 - Non vSphere Local Cluster](5-24-Non-vSphere-Local-Cluster.md)
-
[Test 5-25 - OPS User Grant](5-25-OPS-User-Grant.md)
-
[Test 5-26 - Static IP Address](5-26-Static-IP-Address.md)
-