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

124
vendor/github.com/vmware/vic/tests/README.md generated vendored Normal file
View File

@@ -0,0 +1,124 @@
# VIC Engine Integration & Functional Test Suite
To run the integration tests locally:
## Automatic with defaults
Use ./local-integration-test.sh
## Manually configure local Drone
* Create a `test.secrets` file containing secrets in KEY=VALUE format which includes:
```
GITHUB_AUTOMATION_API_KEY=<token from https://github.com/settings/tokens>
TEST_BUILD_IMAGE=""
TEST_URL_ARRAY=<IP address of your test server>
TEST_USERNAME=<username you use to login to test server>
TEST_PASSWORD=<password you use to login to test server>
TEST_RESOURCE=<resource pool, e.g. /ha-datacenter/host/localhost.localdomain/Resources>
TEST_DATASTORE=<datastore name, e.g. datastore1>
TEST_TIMEOUT=60s
VIC_ESX_TEST_DATASTORE=<datastore path, e.g. /ha-datacenter/datastore/datastore1>
VIC_ESX_TEST_URL=<user:password@IP address of your test server>
DOMAIN=<domain for TLS cert generation, may be blank>
```
If you are using a vSAN environment or non-default ESX install, then you can also specify the two networks to use with the following command (make sure to add them to the yaml file in Step 2 below as well):
```
BRIDGE_NETWORK=bridge
PUBLIC_NETWORK=public
```
If you want to use an existing VCH to run a test (e.g. any of the group 1 tests) on, add the following secret to the secrets file:
```
TARGET_VCH=<name of an existing VCH>
```
The above TARGET_VCH is best used for tests where you do not want to exercise vic-machine's create/delete operations. The Group 1 tests is a great example. Their main goal is to test docker commands.
If TARGET_VCH is not specified, and you have a group initializer and cleanup file (see the group 1 tests), there is another variable to control whether use a shared VCH.
```
MULTI_VCH=<1 for enable>
```
Enabling MULTI_VCH forces each suite to install a new VCH and cleans it up at the end of the test. If the test is in 'single vch' mode, it will respect the group initializer and cleanup file. If the initializer creates the shared VCH, then all tests will use that shared VCH. If TARGET_VCH exist, MULTI_VCH is ignored.
```
DEBUG_VCH=<1 to enable>
```
Enabling DEBUG_VCH will log existing docker images and containers on a VCH at the start of a test suite.
* Execute Drone from the project root directory:
Drone will run based on `.drone.local.yml` - defaults should be fine, edit as needed. Set secrets as env variables:
* To run only the regression tests:
```
drone exec .drone.local.yml
```
* To run the full suite:
```
drone exec --repo-name "vmware/vic" .drone.local.yml
```
## Test a specific .robot file
* Set environment in robot.sh
* Run robot.sh with the desired .robot file
From the project root directory:
```
./tests/robot.sh tests/test-cases/Group6-VIC-Machine/6-04-Create-Basic.robot
```
## Run Docker command tests via makefile target
There exists a makefile target for developers to run the docker command tests locally (not in CI environment) against a pre-deployed VCH. This is a fast way for contributors to test their potential code chages, against the CI tests locally, before pushing the commit. There is another benefit gained from using the makefile target, the way it is setup, logs from the run are written out to vic/ci-results, even if the tests fail. The method described above, to run the tests locally with drone, has the weakness that a failure in the test can sometimes result in no written logs to help debug the failure.
There are a few requirements before using this makefile target.
1. A VCH must be pre-deployed before calling this makefile target
2. The makefile target relies on a script that looks for a few more secrets variable. When running the script directly, these secrets variables may be passed into the script via commandline arguments, environment variables, or via a secrets file. When running the makefile target via make, the secrets must be defined in environment variables.
To run these tests using the makefile target,
```
make local-ci-test
SECRETS_FILE=test.secrets.esx make local-ci-test
DOCKER_TEST=Group1-Docker-Commands/1-01-Docker-Info.robot make local-ci-test
```
In the above example, the first command assumes all environment variables are defined. The second command defines one environment variable, SECRETS_FILE, before calling the make target. This allows calling the make target with all the necessary secrets variable defined in the secrets file instead of in environment variables. The third command defines a specific test to run using the environment variable, DOCKER_TEST.
Currently, only the Group1 tests are setup to use an existing VCH so this makefile target only works on the group 1 tests.
It is also possible to run the docker command tests, without using make, by calling the internal script itself. The script is located at "infra/scripts/local-ci.sh". As stated above, the scripts also allows command line arguments to be passed directly into the script.
A helpful tip is to create different secrets files for different environments. For instance, test.secrets.esx and test.secrets.vc for an ESX host and VC cluster, respectively.
## Find the documentation for each of the tests here:
* [Automated Test Suite Documentation](test-cases/TestGroups.md)
* [Manual Test Suite Documentation](manual-test-cases/TestGroups.md)
## Tips on running tests more efficiently
Here are some recommendations that will make running tests more effective.
1. If a group of tests do not need an independent VCH to run on, there is a facility to use a single VCH for the entire group. The Group 1 tests utilizes this facility. To utilize this in a group (a folder of robot files),
- Add an __init__.robot file as the first robot file in your group. This special init file should install the VCH and save the VCH-NAME to environment variable REUSE-VCH. The bootrap file also needs to save the VCH to the removal exception list.
- Every robot file should neither assume a group-wide VCH. It should install and remove a VCH for it's own use. This allows the single robot file to be properly targeted for testing as a single test or as part of a group of test (with group-wide VCH). When a group wide VCH is in use, the exception list will bypass the per-robot file VCH install and removal.
- Write individual tests within a robot file with NO assumption of a standalone VCH. Assume a shared VCH. This will allow the
tests to run in either shared VCH or standalone VCH mode.
- Add a cleanup.robot file that handles cleaning up the group-wide VCH. It needs to remove the group-wide VCH-NAME from the cleanup exception list.
2. Write all tests within robot file with the assumption that the VCH is in shared mode. Don't assume there are no previously created containers and images. If a robot file needs this precondition, make sure the suite setup cleans out the VCH before running any test.
3. If there is an existing VCH available, it is possible to bypass the VCH installation/deletion by adding a TARGET_VCH into the list of test secrets.

23
vendor/github.com/vmware/vic/tests/ci-env.sh generated vendored Normal file
View File

@@ -0,0 +1,23 @@
#!/bin/bash
# Copyright 2016 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.
set -e
# check if DRONE_MACHINE is available
if [ -z "${DRONE_MACHINE}" ]; then
echo "WARN: DRONE_MACHINE is not set";
else
echo "DRONE_MACHINE is set to '$DRONE_MACHINE'";
fi

View File

@@ -0,0 +1,17 @@
# Concurrent
Concurrent is a simple tool to create/start/stop/destroy container vms. It doesn't use persona or portlayer but entartains the same code.
# Usage
Requires a VCH to be present and also requires busybox image to be in the image store.
```
# VIC_MAX_IN_FLIGHT=32 ./concurrent -service "username:password@VC_OR_ESXI" -datacenter DATACENTER -datastore DATASTORE -resource-pool RP -cluster CLUSTER -vch VCH -concurrency 256 -memory-mb 64
Concurrent testing...
Creating 100% [===================================================================================================================================] 9s
Destroying 100% [=================================================================================================================================] 25s
```

View File

@@ -0,0 +1,385 @@
// 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.
package main
import (
"context"
"flag"
"fmt"
"log"
"math/rand"
"net/url"
"path"
"strings"
"sync"
"time"
"github.com/sethgrid/multibar"
"github.com/vmware/govmomi/object"
"github.com/vmware/govmomi/task"
"github.com/vmware/govmomi/vim25/soap"
"github.com/vmware/govmomi/vim25/types"
"github.com/vmware/vic/lib/guest"
"github.com/vmware/vic/lib/spec"
"github.com/vmware/vic/pkg/version"
"github.com/vmware/vic/pkg/vsphere/datastore"
"github.com/vmware/vic/pkg/vsphere/session"
"github.com/vmware/vic/pkg/vsphere/tasks"
"github.com/vmware/vic/pkg/vsphere/vm"
)
const (
// concurrency
DefaultConcurrency = 16
// busybox leaf image name
parent = "c33a7c3535692e8ca015bebc3a01f7a72b14cc013918c09c40d808efe1505c62"
DefaultService = "root:password@somehost"
DefaultResourcePool = "/dc1/host/cluster1/Resources"
DefaultCluster = "/dc1/host/cluster1"
DefaultDatacenter = "/dc1"
DefaultDatastore = "vsanDatastore"
DefaultVCH = "ZzZ"
DefaultMemoryMB = 512
)
type Config struct {
Service string
Concurrency int
Start bool
RP bool
Datacenter string
Cluster string
ResourcePool string
Datastore string
MemoryMB int64
VCH string
}
var (
config = Config{}
)
func init() {
flag.StringVar(&config.Service, "service", DefaultService, "Service")
flag.IntVar(&config.Concurrency, "concurrency", DefaultConcurrency, "Concurrency")
flag.Int64Var(&config.MemoryMB, "memory-mb", DefaultMemoryMB, "Memory")
flag.StringVar(&config.Datacenter, "datacenter", DefaultDatacenter, "DataCenter")
flag.StringVar(&config.Cluster, "cluster", DefaultCluster, "Cluster")
flag.StringVar(&config.ResourcePool, "resource-pool", DefaultResourcePool, "ResourcePool")
flag.StringVar(&config.Datastore, "datastore", DefaultDatastore, "Datastore")
flag.StringVar(&config.VCH, "vch", DefaultVCH, "VCH")
flag.BoolVar(&config.Start, "start", false, "Start/Stop")
flag.BoolVar(&config.RP, "rp", false, "force 2 Resource Pool")
flag.Parse()
rand.Seed(time.Now().UnixNano())
}
func IsNotFoundError(err error) bool {
if soap.IsSoapFault(err) {
fault := soap.ToSoapFault(err).VimFault()
if _, ok := fault.(types.ManagedObjectNotFound); ok {
return true
}
}
return false
}
func IsConcurrentAccessError(err error) bool {
if soap.IsSoapFault(err) {
fault := soap.ToSoapFault(err).VimFault()
if _, ok := fault.(types.ConcurrentAccess); ok {
return true
}
// sometimes we get this wrong type with correct error
return soap.ToSoapFault(err).String == "vim.fault.ConcurrentAccess"
}
return false
}
func main() {
ctx := context.Background()
// session
c := &session.Config{
Service: config.Service,
Insecure: true,
Keepalive: 30 * time.Minute,
DatacenterPath: config.Datacenter,
ClusterPath: config.Cluster,
PoolPath: config.ResourcePool,
DatastorePath: config.Datastore,
UserAgent: version.UserAgent("vic-engine"),
}
s, err := session.NewSession(c).Connect(ctx)
if err != nil {
log.Panic(err)
}
defer s.Logout(ctx)
if s, err = s.Populate(ctx); err != nil {
log.Panic(err)
}
helper := datastore.NewHelperFromSession(ctx, s)
p, err := datastore.PathFromString(fmt.Sprintf("[%s] %s/", config.Datastore, config.VCH))
if err != nil {
log.Panic(err)
}
helper.RootURL = *p
var vapp *object.VirtualApp
var pool *object.ResourcePool
if s.IsVC() && !config.RP {
// vapp
vapp, err = s.Finder.VirtualApp(ctx, fmt.Sprintf("%s/%s", config.ResourcePool, config.VCH))
if err != nil {
log.Panic(err)
}
} else {
// pool
pool, err = s.Finder.ResourcePool(ctx, config.ResourcePool)
if err != nil {
log.Panic(err)
}
}
// image store path
image, err := url.Parse(config.VCH)
if err != nil {
log.Panic(err)
}
// VIC/<id>/images
rres, err := helper.LsDirs(ctx, "VIC")
if err != nil {
log.Panic(err)
}
r := rres.HostDatastoreBrowserSearchResults
STORE := ""
for i := range r {
if strings.Contains(r[i].File[0].GetFileInfo().Path, "-") {
STORE = r[i].File[0].GetFileInfo().Path
break
}
}
// VCH/*-bootstrap.iso
res, err := helper.Ls(ctx, "")
if err != nil {
log.Panic(err)
}
ISO := ""
for i := range res.File {
if strings.HasSuffix(res.File[i].GetFileInfo().Path, "-bootstrap.iso") {
ISO = res.File[i].GetFileInfo().Path
break
}
}
if ISO == "" {
log.Panic("Failed to find ISO file")
}
// bars
progressBars, err := multibar.New()
if err != nil {
log.Panic(err)
}
progressBars.Printf("\nConcurrent testing...\n\n")
create := progressBars.MakeBar(config.Concurrency-1, fmt.Sprintf("%16s", "Creating"))
start := func(progress int) {}
stop := func(progress int) {}
if config.Start {
start = progressBars.MakeBar(config.Concurrency-1, fmt.Sprintf("%16s", "Starting"))
stop = progressBars.MakeBar(config.Concurrency-1, fmt.Sprintf("%16s", "Stopping"))
}
destroy := progressBars.MakeBar(config.Concurrency-1, fmt.Sprintf("%16s", "Destroying"))
for i := range progressBars.Bars {
progressBars.Bars[i].ShowTimeElapsed = false
}
go progressBars.Listen()
var mu sync.Mutex
var vms []*vm.VirtualMachine
wrap := func(f func(i int) error, p multibar.ProgressFunc) {
var wg sync.WaitGroup
errs := make(chan error, config.Concurrency)
for i := 0; i < config.Concurrency; i++ {
wg.Add(1)
go func(i int) {
defer wg.Done()
errs <- f(i)
}(i)
}
go func() {
wg.Wait()
close(errs)
}()
idx := 0
for err := range errs {
if err != nil {
progressBars.Printf("ERROR: %s", err)
}
p(idx)
idx++
}
}
createFunc := func(i int) error {
name := fmt.Sprintf("%d-vm", i)
specconfig := &spec.VirtualMachineConfigSpecConfig{
NumCPUs: 1,
MemoryMB: config.MemoryMB,
ID: name,
Name: name,
VMFullName: name,
ParentImageID: parent,
BootMediaPath: fmt.Sprintf("[%s] %s/%s", config.Datastore, config.VCH, ISO),
VMPathName: fmt.Sprintf("[%s]", config.Datastore),
ImageStoreName: STORE,
ImageStorePath: image,
}
// Create a linux guest
linux, err := guest.NewLinuxGuest(ctx, s, specconfig)
if err != nil {
return err
}
h := linux.Spec().Spec()
var res *types.TaskInfo
if s.IsVC() && !config.RP {
res, err = tasks.WaitForResult(ctx, func(ctx context.Context) (tasks.Task, error) {
return vapp.CreateChildVM(ctx, *h, nil)
})
if err != nil {
return err
}
} else {
res, err = tasks.WaitForResult(ctx, func(ctx context.Context) (tasks.Task, error) {
return s.VMFolder.CreateVM(ctx, *h, pool, nil)
})
if err != nil {
return err
}
}
mu.Lock()
vms = append(vms, vm.NewVirtualMachine(ctx, s, res.Result.(types.ManagedObjectReference)))
mu.Unlock()
return nil
}
wrap(createFunc, create)
if config.Start {
startFunc := func(i int) error {
_, err := tasks.WaitForResult(ctx, func(ctx context.Context) (tasks.Task, error) {
return vms[i].PowerOn(ctx)
})
return err
}
wrap(startFunc, start)
stopFunc := func(i int) error {
_, err := tasks.WaitForResult(ctx, func(ctx context.Context) (tasks.Task, error) {
return vms[i].PowerOff(ctx)
})
return err
}
wrap(stopFunc, stop)
}
destroyFunc := func(i int) error {
v, err := vms[i].VMPathName(ctx)
if err != nil {
return err
}
concurrent := false
// if DeleteExceptDisks succeeds on VC, it leaves the VM orphan so we need to call Unregister
// if DeleteExceptDisks succeeds on ESXi, no further action needed
// if DeleteExceptDisks fails, we should call Unregister and only return an error if that fails too
// Unregister sometimes can fail with ManagedObjectNotFound so we ignore it
_, err = tasks.WaitForResult(ctx, func(ctx context.Context) (tasks.Task, error) {
return vms[i].DeleteExceptDisks(ctx)
})
if err != nil {
switch f := err.(type) {
case task.Error:
switch f.Fault().(type) {
case *types.ConcurrentAccess:
log.Printf("DeleteExceptDisks failed for %d with ConcurrentAccess error. Ignoring it", i)
concurrent = true
}
// err but not concurrent
if !concurrent {
return err
}
}
}
if concurrent && vms[i].IsVC() {
if err := vms[i].Unregister(ctx); err != nil {
if !IsNotFoundError(err) && !IsConcurrentAccessError(err) {
return err
}
}
}
fm := s.Datastore.NewFileManager(s.Datacenter, true)
// remove from datastore
if err := fm.Delete(ctx, path.Dir(v)); err != nil {
return err
}
return nil
}
wrap(destroyFunc, destroy)
}

20
vendor/github.com/vmware/vic/tests/get_test_url.sh generated vendored Executable file
View File

@@ -0,0 +1,20 @@
#!/bin/bash
# Copyright 2016 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.
DRONE_BUILD_NUMBER=${DRONE_BUILD_NUMBER:=0}
unit_test_array=($TEST_URL_ARRAY)
arrLen=${#unit_test_array[@]}
echo $TEST_USERNAME:$TEST_PASSWORD@${unit_test_array[$(($DRONE_BUILD_NUMBER % $arrLen))]}

92
vendor/github.com/vmware/vic/tests/integration-test.sh generated vendored Executable file
View File

@@ -0,0 +1,92 @@
#!/bin/bash
# Copyright 2016-2018 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -x
gsutil version -l
set +x
dpkg -l > package.list
set -x
buildinfo=$(drone build info vmware/vic $DRONE_BUILD_NUMBER)
prNumber=$(drone build info --format "{{ .Ref }}" vmware/vic $DRONE_BUILD_NUMBER | cut -f 3 -d'/')
set +x
prBody=$(curl https://api.github.com/repos/vmware/vic/pulls/$prNumber?access_token=$GITHUB_AUTOMATION_API_KEY | jq -r ".body")
if (echo $prBody | grep -q "\[fast fail\]"); then
export FAST_FAILURE=1
else
export FAST_FAILURE=0
fi
if [[ $DRONE_BRANCH == "master" || $DRONE_BRANCH == "releases/"* ]] && [[ $DRONE_REPO == "vmware/vic" ]] && [[ $DRONE_BUILD_EVENT == "push" ]]; then
echo "Running full CI for $DRONE_BUILD_EVENT on $DRONE_BRANCH"
pybot --removekeywords TAG:secret --exclude skip tests/test-cases
elif [[ $DRONE_BRANCH == *"refs/tags"* ]] && [[ $DRONE_REPO == "vmware/vic" ]] && [[ $DRONE_BUILD_EVENT == "tag" ]]; then
echo "Running only Group11-Upgrade and 7-01-Regression for $DRONE_BUILD_EVENT on $DRONE_BRANCH"
pybot --removekeywords TAG:secret --suite Group11-Upgrade --suite 7-01-Regression tests/test-cases
elif (echo $prBody | grep -q "\[full ci\]"); then
echo "Running full CI as per commit message"
pybot --removekeywords TAG:secret --exclude skip tests/test-cases
elif (echo $prBody | grep -q "\[specific ci="); then
echo "Running specific CI as per commit message"
buildtype=$(echo $prBody | grep "\[specific ci=")
testsuite=$(echo $buildtype | awk -F"\[specific ci=" '{sub(/\].*/,"",$2);print $2}')
pybot --removekeywords TAG:secret --suite $testsuite --suite 7-01-Regression tests/test-cases
else
echo "Running regressions"
pybot --removekeywords TAG:secret --exclude skip --include regression tests/test-cases
fi
rc="$?"
timestamp=$(date +%s)
outfile="integration_logs_"$DRONE_BUILD_NUMBER"_"$DRONE_COMMIT".zip"
zip -9 -j $outfile output.xml log.html report.html package.list *container-logs*.zip *.log /var/log/vic-machine-server/vic-machine-server.log *.debug
# GC credentials
keyfile="/root/vic-ci-logs.key"
botofile="/root/.boto"
echo -en $GS_PRIVATE_KEY > $keyfile
chmod 400 $keyfile
echo "[Credentials]" >> $botofile
echo "gs_service_key_file = $keyfile" >> $botofile
echo "gs_service_client_id = $GS_CLIENT_EMAIL" >> $botofile
echo "[GSUtil]" >> $botofile
echo "content_language = en" >> $botofile
echo "default_project_id = $GS_PROJECT_ID" >> $botofile
if [ -f "$outfile" ]; then
gsutil cp $outfile gs://vic-ci-logs
source "$(dirname "${BASH_SOURCE[0]}")/save-test-results.sh"
echo "----------------------------------------------"
echo "View test logs:"
echo "https://vic-logs.vcna.io/$DRONE_BUILD_NUMBER/"
echo "Download test logs:"
echo "https://console.cloud.google.com/m/cloudstorage/b/vic-ci-logs/o/$outfile?authuser=1"
echo "----------------------------------------------"
else
echo "No log output file to upload"
fi
if [ -f "$keyfile" ]; then
rm -f $keyfile
fi
exit $rc

102
vendor/github.com/vmware/vic/tests/local-integration-test.sh generated vendored Executable file
View File

@@ -0,0 +1,102 @@
#!/bin/bash -e
# Copyright 2016-2018 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Run robot integration tests locally, no .yml files required.
# Set GITHUB_TOKEN once and switch environments just by changing GOVC_URL
cmd="pybot"
while getopts t: flag
do
case $flag in
# run a specific test
t)
cmd="$cmd --exclude skip -t \"$OPTARG\""
;;
esac
done
shift $((OPTIND-1))
if [ -z "$GITHUB_TOKEN" ] || [ -z "$GOVC_URL" ]; then
echo "usage: GITHUB_TOKEN=... GOVC_URL=... $0 test.robot..."
exit 1
fi
# check if govc env command works as expected
if ! govc version -require 0.9.0; then
echo "govc version must be updated"
exit 1
fi
if [ -z "$DOMAIN" ]; then
echo "DOMAIN not set, using --no-tlsverify for all tests"
fi
cd "$(git rev-parse --show-toplevel)"
tests=${*#${PWD}/}
# Create a temp drone.yml file
tempfile() {
# tempprefix=$(basename "$0")
# mktemp /tmp/${tempprefix}.yml
mktemp .tmp.drone.XXXXX.yml
# $(mktemp .tmp.drone.`date +%s`.yml)
}
cleanup() {
echo "removing temp file $tmpYml"
rm -f $tmpYml
}
tmpYml=$(tempfile)
#cleanup temp file on exit
trap cleanup EXIT
cat > $tmpYml <<CONFIG
---
workspace:
base: /go
path: src/github.com/vmware/vic
pipeline:
clone:
image: plugins/git
tags: true
# dont clone submodules
recursive: false
vic-integration-test-on-pr:
image: gcr.io/eminent-nation-87317/vic-integration-test:1.44
pull: true
environment:
GITHUB_AUTOMATION_API_KEY: $GITHUB_TOKEN
TEST_URL_ARRAY: $(govc env -x GOVC_URL_HOST)
TEST_USERNAME: $(govc env GOVC_USERNAME)
TEST_PASSWORD: $(govc env GOVC_PASSWORD)
TEST_DATASTORE: ${GOVC_DATASTORE:-$(basename "$(govc ls datastore | head -1)")}
TEST_RESOURCE: ${GOVC_RESOURCE_POOL:-$(govc ls host/*/Resources)}
BRIDGE_NETWORK: $BRIDGE_NETWORK
PUBLIC_NETWORK: $PUBLIC_NETWORK
DOMAIN: $DOMAIN
BIN: bin
GOPATH: /go
SHELL: /bin/bash
TEST_TIMEOUT: 60s
GOVC_INSECURE: true
commands:
- $cmd ${tests:-tests/test-cases}
CONFIG
drone exec --local $tmpYml

View File

@@ -0,0 +1,18 @@
# Copyright 2017-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
FROM longevity-base
ENV GOVC_URL=bart.eng.vmware.com
ENV TEST_URL_ARRAY=bart.eng.vmware.com
ENV STATIC_VCH_OPTIONS="--insecure-registry=vic-executor1.vcna.io --public-network-ip 10.17.109.6/24 --public-network-gateway 10.17.109.253 --dns-server 10.118.81.1"

View File

@@ -0,0 +1,23 @@
# Copyright 2017-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
FROM longevity-base
ENV GOVC_URL=10.133.146.15
ENV TEST_URL_ARRAY=10.133.146.15
ENV GOVC_DATASTORE=CPBU_2TB_01
ENV TEST_DATASTORE=CPBU_2TB_01
ENV BRIDGE_NETWORK=vxw-dvs-3444-virtualwire-1-sid-5000-VCH-LS-1
ENV PUBLIC_NETWORK=DPortGroup
ENV TEST_DATACENTER=/Datacenter
ENV STATIC_VCH_OPTIONS="--insecure-registry=vic-executor1.vcna.io --public-network-ip 10.197.37.210/23 --public-network-gateway 10.197.37.253 --dns-server 10.142.7.21"

View File

@@ -0,0 +1,25 @@
# Copyright 2017-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
FROM gcr.io/eminent-nation-87317/vic-integration-test:1.44
RUN mkdir -p /go/src/github.com/vmware/vic
COPY secrets /go/src/github.com/vmware/vic
ENV LONGEVITY=1
ENV GOVC_INSECURE=1
ENV GOVC_USERNAME=administrator@vsphere.local
ENV TEST_USERNAME=administrator@vsphere.local
ENV TEST_TIMEOUT=3m
ENV TEST_RESOURCE=Cluster
ENV DOMAIN=
ENV DOCKER_API_VERSION=1.23

View File

@@ -0,0 +1,44 @@
# Copyright 2017-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
#!/bin/bash
set -e
if [ $# -ne 1 ]; then
echo "Usage: $0 harbor-version"
exit 1
fi
version=$1
[ -e harbor ] \
&& echo "harbor exists. Delete it if you want to install a newer version and re-run $0" \
&& pushd harbor && docker-compose start && popd && exit 0
echo "Pulling down version ${version} of Harbor..."
wget https://github.com/vmware/harbor/releases/download/v${version}/harbor-online-installer-v${version}.tgz -qO - | tar xz
echo "Configuring Harbor"
sed -i 's/hostname = reg.mydomain.com/hostname = vic-executor1.vcna.io/g' harbor/harbor.cfg
echo "Installing & starting Harbor"
sudo ./harbor/install.sh
echo "Preparing Harbor..."
echo "Logging in..."
docker login vic-executor1.vcna.io --username=admin --password="Harbor12345"
echo "Pulling some images to put in Harbor and putting them in Harbor.."
pushd tests/resources
for image in $(python -c "vars=__import__('dynamic-vars'); print(\" \".join(vars.images))"); do
docker pull $image
docker tag $image vic-executor1.vcna.io/library/${image}
docker push vic-executor1.vcna.io/library/${image}
done
popd

View File

@@ -0,0 +1,35 @@
#!/bin/bash
# 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.
cd ~/vic
git clean -fd
git fetch https://github.com/vmware/vic master
git pull
cp ~/secrets .
tests/longevity-tests/run-longevity.bash $1
id=`docker ps -lq`
echo $id
docker logs -f $id
docker cp $id:/tmp $id
tar -cvzf $id.tar.gz $id
gsutil cp $id.tar.gz gs://vic-longevity-results/
echo $id
rc=`docker inspect --format='{{.State.ExitCode}}' $id`
exit $rc

View File

@@ -0,0 +1,128 @@
# Copyright 2017-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
#!/bin/bash
set -e
while getopts ":d:s:h:" opt; do
case $opt in
s)
syslogAddress=$OPTARG
;;
h)
harborVersion=$OPTARG
;;
d)
debugLevel=$OPTARG
;;
\?)
echo "Usage: $0 [-d <debug level>] [-s <syslog endpoint>] [-h <harbor version>] target-cluster"
exit 1
;;
:)
echo "Usage: $0 [-d <debug level>] [-s <syslog endpoint>] [-h <harbor version>] target-cluster"
exit 1
;;
esac
done
shift $((OPTIND-1))
if [ $# -ne 1 ]; then
echo "Usage: $0 [-s <syslog endpoint>] [-h <harbor version>] target-cluster"
exit 1
fi
if [[ $1 != "6.0" && $1 != "6.5" ]]; then
echo "Please specify a target cluster. One of: 6.0, 6.5"
exit 1
fi
if [[ ! $(grep dns /etc/docker/daemon.json) ]]; then
echo "NOTE: /etc/docker/daemon.json should contain
{
\"dns\": [\"10.118.81.1\", \"10.16.188.210\"]
}
in order for this script to function behind VMW's firewall.
If the file does not exist, create it & restart the docker daemon before
attempting to run this script
"
exit 1
fi
target="$1"
# set an output directory
odir=$PWD"-longevity-test-output-$(date -Iminute | sed 's/:/_/g')"
# set up harbor if necessary
if [[ $(docker ps | grep harbor) == "" ]]; then
if [[ ${harborVersion} != "" ]]; then
hversion=${harborVersion}
else
hversion="1.2.0"
echo "No Harbor version specified. Using default $hversion"
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
$DIR/get-and-start-harbor.bash $hversion
fi
echo "Building container images...."
pushd tests/longevity-tests
docker build -q -t longevity-base -f Dockerfile.foundation .
docker build -q -t tests-"$target" -f Dockerfile."${target}" .
popd
if [[ ${debugLevel} != "" ]]; then
debugVchLevel="${debugLevel}"
else
debugVchLevel="1"
fi
if [[ ${syslogAddress} != "" ]]; then
syslogVchOption="--syslog-address ${syslogAddress}"
fi
input=$(gsutil ls -l gs://vic-engine-builds/vic_* | grep -v TOTAL | sort -k2 -r | head -n1 | xargs | cut -d ' ' -f 3 | cut -d '/' -f 4)
echo "Downloading VIC build $input..."
rm -rf bin
mkdir -p bin
wget -P bin https://storage.googleapis.com/vic-engine-builds/$input -qO - | tar xz -C bin
mv bin/vic/* bin
rmdir bin/vic
echo "Creating container..."
testsContainer=$(docker create --rm -it\
-w /go/src/github.com/vmware/vic/ \
-v "$odir":/tmp/ -e SYSLOG_VCH_OPTION="${syslogVchOption}" -e DEBUG_VCH_LEVEL="${debugVchLevel}" \
tests-"$target" \
bash -c \
". secrets && pybot -d /tmp/ /go/src/github.com/vmware/vic/tests/manual-test-cases/Group14-Longevity/14-1-Longevity.robot; rc=$?;\
mv *-container-logs.zip /tmp/ 2>/dev/null; \
mv VCH-*-vmware.log /tmp/ 2>/dev/null; \
mv vic-machine.log /tmp/ 2>/dev/null; \
mv index.html* /tmp/ 2>/dev/null; \
mv VCH-* /tmp/ 2>/dev/null; \
exit $rc")
echo "Copying code and binaries into container...."
cd ..
docker cp vic $testsContainer:/go/src/github.com/vmware/
echo "Running tests.."
echo "Run docker attach $testsContainer to interact with the container or use docker logs -f to simply view test output as the tests run"
docker start $testsContainer
echo "Output can be found in $odir"

View File

@@ -0,0 +1,20 @@
# 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
#!/bin/bash
export DRONE_TOKEN=
export GITHUB_AUTOMATION_API_KEY=
export SLACK_URL=
export TEST_PASSWORD=
export GOVC_PASSWORD=

View File

@@ -0,0 +1,21 @@
Test 11-1 - VIC Install Stress
=======
# Purpose:
To verify the VIC appliance works when stressing the install component of the system
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. In a loop, install and delete a VCH appliance as rapidly as possible 100 times
2. After the last install, run a variety of docker commands on the VCH appliance
# Expected Outcome:
The VCH appliance should deploy without error each time and each of the docker commands executed against the last install should return without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

View File

@@ -0,0 +1,28 @@
# 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 11-1-VIC-Install-Stress
Resource ../../resources/Util.robot
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
VIC Install Stress
:FOR ${idx} IN RANGE 0 100
\ Log To Console \nLoop ${idx+1}
\ Install VIC Appliance To Test Server vol=default %{STATIC_VCH_OPTIONS}
\ Cleanup VIC Appliance On Test Server
Install VIC Appliance To Test Server vol=default %{STATIC_VCH_OPTIONS}
Run Regression Tests

View File

@@ -0,0 +1,23 @@
Test 11-2 - Container Boot Storm
=======
# Purpose:
To verify the VIC appliance works when stressing the container start component of the system
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. Create 100 container on the new VCH appliance
3. In parallel, attempt to start all 100 containers at once
4. After the boot storm, run a variety of docker commands on the VCH appliance
# Expected Outcome:
Each of the containers should start without error and at the end, the variety of docker commands run should work without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

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 11-2-Container-Boot-Storm
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Container Boot Storm
${containers}= Create List
${pids}= Create List
${out}= Run docker %{VCH-PARAMS} pull busybox
Log To Console \nCreate 100 containers
:FOR ${idx} IN RANGE 0 100
\ ${id}= Run docker %{VCH-PARAMS} create busybox /bin/top
\ Append To List ${containers} ${id}
Log To Console \nRapidly start each container
:FOR ${id} IN @{containers}
\ ${pid}= Start Process docker %{VCH-PARAMS} start ${id} shell=True
\ Append To List ${pids} ${pid}
Log To Console \nWait for them to finish and check their RC
:FOR ${pid} IN @{pids}
\ Log To Console \nWaiting for ${pid}
\ ${res}= Wait For Process ${pid}
\ Should Be Equal As Integers ${res.rc} 0
Run Regression Tests

View File

@@ -0,0 +1,22 @@
Test 11-3 - Many Containers
=======
# Purpose:
To verify the VIC appliance works when stressing the appliance with a lot of containers
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. In a loop, create 1000 containers using docker run busybox date
3. After the last iteration, run a variety of docker commands on the VCH appliance
# Expected Outcome:
Each of the containers should start without error and at the end, the variety of docker commands run should work without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

View File

@@ -0,0 +1,36 @@
# 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 11-3-Many-Containers
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Docker run 1000 containers rapidly
${pids}= Create List
Log To Console \nRun 1000 containers rapidly
:FOR ${idx} IN RANGE 0 1000
\ ${pid}= Start Process docker %{VCH-PARAMS} run busybox date shell=True
\ Append To List ${pids} ${pid}
Log To Console \nWait for them to finish and check their RC
:FOR ${pid} IN @{pids}
\ Log To Console \nWaiting for ${pid}
\ ${res}= Wait For Process ${pid}
\ Should Be Equal As Integers ${res.rc} 0
Run Regression Tests

View File

@@ -0,0 +1,22 @@
Test 11-4 - Many Volumes
=======
# Purpose:
To verify the VIC appliance works when stressing the appliance with a lot of volumes
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. In a loop, create 1000 small volumes
3. After the last iteration, run a variety of docker commands on the VCH appliance including creating a container that uses one of the volumes created in the loop
# Expected Outcome:
Each of the volume create commands should return without error and at the end, the variety of docker commands run should work without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

View File

@@ -0,0 +1,36 @@
# 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 11-4-Many-Volumes
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Docker volume create 1000 volumes rapidly
${pids}= Create List
Log To Console \nCreate 1000 volumes rapidly
:FOR ${idx} IN RANGE 0 1000
\ ${pid}= Start Process docker %{VCH-PARAMS} volume create --name\=multiple${idx} --opt Capacity\=32MB shell=True
\ Append To List ${pids} ${pid}
Log To Console \nWait for them to finish and check their RC
:FOR ${pid} IN @{pids}
\ Log To Console \nWaiting for ${pid}
\ ${res}= Wait For Process ${pid}
\ Should Be Equal As Integers ${res.rc} 0
Run Regression Tests

View File

@@ -0,0 +1,22 @@
Test 11-5 - Many Networks
=======
# Purpose:
To verify the VIC appliance works when stressing the appliance with a lot of networks
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. In a loop, create 1000 networks
3. After the last iteration, run a variety of docker commands on the VCH appliance including creating a container that uses one of the networks created in the loop
# Expected Outcome:
Each of the volume create commands should return without error and at the end, the variety of docker commands run should work without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

View File

@@ -0,0 +1,34 @@
# 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 11-5-Many-Networks
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Many Networks
Log To Console Create 1000 networks
:FOR ${idx} IN RANGE 0 1000
\ Log To Console \nCreate network ${idx}
\ ${rc}= Run And Return Rc docker %{VCH-PARAMS} network create net${idx}
\ Should Be Equal As Integers ${rc} 0
${out}= Run docker %{VCH-PARAMS} pull busybox
${container}= Run docker %{VCH-PARAMS} create --net=net999 busybox ping -C2 google.com
${out}= Run docker %{VCH-PARAMS} start ${container}
Should Contain ${out} 2 packets transmitted, 2 received
Run Regression Tests

View File

@@ -0,0 +1,23 @@
Test 11-6 - Stop Storm
=======
# Purpose:
To verify the VIC appliance works when stressing the appliance with a lot of stop commands at once
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. Create 100 containers that keep running
3. In parallel, attempt to stop each of the containers as quickly as possible
4. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
Each of the volume stop commands should return without error and at the end, the variety of docker commands run should work without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

View File

@@ -0,0 +1,44 @@
# 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 11-6-Stop-Storm
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Stop Storm
${containers}= Create List
${pids}= Create List
${out}= Run docker %{VCH-PARAMS} pull busybox
Log To Console \nCreate 100 containers
:FOR ${idx} IN RANGE 0 100
\ Log To Console \nCreating container ${idx}
\ ${id}= Run docker %{VCH-PARAMS} run busybox /bin/top
\ Append To List ${containers} ${id}
Log To Console \nRapidly stop each container
:FOR ${id} IN @{containers}
\ ${pid}= Start Process docker %{VCH-PARAMS} stop ${id} shell=True
\ Append To List ${pids} ${pid}
Log To Console \nWait for them to finish and check their RC
:FOR ${pid} IN @{pids}
\ Log To Console \nWaiting for ${pid}
\ ${res}= Wait For Process ${pid}
\ Should Be Equal As Integers ${res.rc} 0
Run Regression Tests

View File

@@ -0,0 +1,23 @@
Test 11-7 - Remove Storm
=======
# Purpose:
To verify the VIC appliance works when stressing the appliance with a lot of rm commands at once
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. Create 100 containers
3. In parallel, attempt to rm each of the containers as quickly as possible
4. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
Each of the volume rm commands should return without error and at the end, the variety of docker commands run should work without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

View File

@@ -0,0 +1,44 @@
# 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 11-7-Remove-Storm
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Remove Storm
${containers}= Create List
${pids}= Create List
${out}= Run docker %{VCH-PARAMS} pull busybox
Log To Console \nCreate 100 containers
:FOR ${idx} IN RANGE 0 100
\ Log To Console \nCreating container ${idx}
\ ${id}= Run docker %{VCH-PARAMS} create busybox /bin/top
\ Append To List ${containers} ${id}
Log To Console \nRapidly rm each container
:FOR ${id} IN @{containers}
\ ${pid}= Start Process docker %{VCH-PARAMS} rm ${id} shell=True
\ Append To List ${pids} ${pid}
Log To Console \nWait for them to finish and check their RC
:FOR ${pid} IN @{pids}
\ Log To Console \nWaiting for ${pid}
\ ${res}= Wait For Process ${pid}
\ Should Be Equal As Integers ${res.rc} 0
Run Regression Tests

View File

@@ -0,0 +1,22 @@
Test 11-8 - Image Pull Stress
=======
# Purpose:
To verify the VIC appliance works when stressing the appliance with a lot of image pull commands at once
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. Pull 100 images all at once, with at least 10 of the images pulled being the same image
3. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
Each of the image pull commands should return without error and at the end, the variety of docker commands run should work without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

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 11-8-Image-Pull-Stress
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Image Pull Stress
${pids}= Create List
Log To Console \nRapidly pull images
:FOR ${idx} IN RANGE 0 50
\ ${pid}= Start Process docker %{VCH-PARAMS} pull busybox shell=True
\ Append To List ${pids} ${pid}
Log To Console \nRapidly pull images
:FOR ${idx} IN RANGE 0 25
\ ${pid}= Start Process docker %{VCH-PARAMS} pull alpine shell=True
\ Append To List ${pids} ${pid}
Log To Console \nRapidly pull images
:FOR ${idx} IN RANGE 0 25
\ ${pid}= Start Process docker %{VCH-PARAMS} pull ubuntu shell=True
\ Append To List ${pids} ${pid}
Log To Console \nWait for them to finish and check their RC
:FOR ${pid} IN @{pids}
\ Log To Console \nWaiting for ${pid}
\ ${res}= Wait For Process ${pid}
\ Should Be Equal As Integers ${res.rc} 0
Run Regression Tests

View File

@@ -0,0 +1,23 @@
Test 11-9 - Container Disk Stress
=======
# Purpose:
To verify the VIC appliance works when stressing the appliance with a lot of disk operations
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. Create a container with a 10GB volume attached
3. Within the container, execute bonnie++ disk stress test
4. Run a variety of docker commands on the VCH appliance
# Expected Outcome:
The bonnie++ command should return without error and at the end, the variety of docker commands run should work without error
# Possible Problems:
If you exhaust the resources of the vSphere server, it is not necessarily a failure as long as the VCH appliance continues to function and behave as expected

View File

@@ -0,0 +1,29 @@
# 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 11-9-Container-Disk-Stress
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Container Disk Stress
${out}= Run docker %{VCH-PARAMS} pull busybox
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run ubuntu bash -c "apt-get update; apt-get install bonnie++; bonnie++ -u root;"
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Delete files in random order...done.
Run Regression Tests

View File

@@ -0,0 +1,22 @@
Group 11 - Stress
=======
[Test 11-1 - VIC Install Stress](11-1-VIC-Install-Stress.md)
-
[Test 11-2 - Container Boot Storm](11-2-Container-Boot-Storm.md)
-
[Test 11-3 - Many Containers](11-3-Many-Containers.md)
-
[Test 11-4 - Many Volumes](11-4-Many-Volumes.md)
-
[Test 11-5 - Many Networks](11-5-Many-Networks.md)
-
[Test 11-6 - Stop Storm](11-6-Stop-Storm.md)
-
[Test 11-7 - Remove Storm](11-7-Remove-Storm.md)
-
[Test 11-8 - Image Pull Stress](11-8-Image-Pull-Stress.md)
-
[Test 11-9 - Container Disk Stress](11-9-Container-Disk-Stress.md)
-

View File

@@ -0,0 +1,26 @@
Test 12-1 VIC Machine Maintenance Mode
=======
# Purpose:
To verify the VIC appliance provides a reasonable error message when installing or deleting it from a host in maintenance mode
# References:
[1- VMware Maintenance Mode](https://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp?topic=/com.vmware.vsphere.resourcemanagement.doc_41/using_drs_clusters_to_manage_resources/c_using_maintenance_mode.html)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Put the vSphere server into maintenance mode
2. Issue a vic-machine create command to attempt to install VIC into the server while it is in maintenance mode
3. Instruct the vSphere server to exit maintenance mode
4. Issue a vic-machine create command to install VIC into the server
5. Instruct the vSphere server to enter maintenance mode
6. Issue a vic-machine delete command to attempt to delete VIC from the server while it is in maintenance mode
# Expected Outcome:
* For Step 2, the VCH appliance should deploy with an error that indicates the reason why it cannot install into a server in maintenance mode
* For Step 6, the vic-machine delete command should return with an error indicating the reason why it cannot delete the VCH while the server is in maintenance mode
# Possible Problems:
None

View File

@@ -0,0 +1,22 @@
Test 12-2 Docker Commands Maintenance Mode
=======
#Purpose:
To verify the VIC appliance provides reasonable behavior when the host it is running on has been placed in maintenance mode
#References:
[1- VMware Maintenance Mode](https://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp?topic=/com.vmware.vsphere.resourcemanagement.doc_41/using_drs_clusters_to_manage_resources/c_using_maintenance_mode.html)
#Environment:
This test requires that a vSphere server is running and available
#Test Steps:
1. Install a new VIC appliance on the vSphere server
2. After the install, place the host into maintenance mode
3. Issue a variety of docker commands to the VIC appliance while the host is in maintenance mode
#Expected Outcome:
The VCH appliance should deploy without error and the docker commands should return an error that is reasonable and indicates that it cannot complete due to the host being in maintenance mode
#Possible Problems:
None

View File

@@ -0,0 +1,8 @@
Group 12 - Maintenance Mode
=======
[Test 12-1 - VIC Machine Maintenance Mode](12-1-VIC-Machine-Maintenance-Mode.md)
-
[Test 12-2 - Docker Commands Maintenance Mode](12-2-Docker-Commands-Maintenance-Mode.md)
-

View File

@@ -0,0 +1,32 @@
Test 13-1 vMotion VCH Appliance
=======
# Purpose:
To verify the VCH appliance continues to function properly after being vMotioned to a new host
# References:
[1- vMotion A Powered On Virtual Machine](http://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp?topic=/com.vmware.vsphere.dcadmin.doc_41/vsp_dc_admin_guide/migrating_virtual_machines/t_migrate_a_powered-on_virtual_machine_with_vmotion.html)
# Environment:
This test requires that a vCenter server is running and available
# Test Steps:
1. Install a new VCH appliance onto one of the hosts within the vCenter server
2. Power down the VCH appliance
3. vMotion the VCH appliance to a new host
4. Power on the VCH appliance and run a variety of docker commands
5. Delete the VCH appliance
6. Install a new VCH appliance onto one of the hosts within the vCenter server
7. While the VCH appliance is powered on, vMotion the VCH appliance to a new host
8. Run a variety of docker commands on the VCH appliance after it has moved
9. Delete the VCH appliance
10. Install a new VCH appliance onto on the hosts within the vCenter server
11. Create several containers on the new VCH appliance that are in the following states: created but not started, started and running, started and stopped, stopped after running and being attached to, running after being attached to but currently not attached to, running and currently attached to
12. vMotion the VCH appliance to a new host
13. Complete the life cycle of the containers created in Step 11, including getting docker logs and re-attaching to containers that are running
# Expected Outcome:
In each scenario, the VCH appliance should continue to work as expected after being vMotioned and all docker commands should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,104 @@
# 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 13-1 - vMotion VCH Appliance
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Create a VSAN Cluster vic-vmotion-13-1
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
Test Teardown Gather Logs From Test Server
*** Test Cases ***
#Step 1-5
# ${status}= Get State Of Github Issue 701
# Run Keyword If '${status}' == 'closed' Fail Test 13-1-vMotion-VCH-Appliance.robot needs to be updated now that Issue #701 has been resolved
# Log Issue \#701 is blocking implementation WARN
# Install VIC Appliance To Test Server
# Run Regression Tests
# ${host}= Get VM Host Name %{VCH-NAME}
# Power Off VM OOB %{VCH-NAME}
# ${status}= Run Keyword And Return Status Should Contain ${host} ${esx1-ip}
# Run Keyword If ${status} Run govc vm.migrate -host cls/${esx2-ip} -pool cls/Resources %{VCH-NAME}
# Run Keyword Unless ${status} Run govc vm.migrate -host cls/${esx1-ip} -pool cls/Resources %{VCH-NAME}
# Set Environment Variable VCH-NAME "%{VCH-NAME} (1)"
# ${rc} ${output}= Run And Return Rc And Output govc vm.power -on %{VCH-NAME}
# Should Be Equal As Integers ${rc} 0
# Log To Console Waiting for VM to power on ...
# :FOR ${idx} IN RANGE 0 30
# \ ${ret}= Run govc vm.info %{VCH-NAME}
# \ ${status}= Run Keyword And Return Status Should Contain ${ret} poweredOn
# \ Exit For Loop If ${status}
# \ Sleep 1
# Log To Console Getting VCH IP ...
# ${new-vch-ip}= Get VM IP %{VCH-NAME}
# Log To Console New VCH IP is ${new-vch-ip}
# Replace String %{VCH-PARAMS} %{VCH-IP} ${new-vch-ip}
# Wait Until Keyword Succeeds 20x 5 seconds Run Docker Info %{VCH-PARAMS}
# Run Regression Tests
#TODO
#This does not work currently, as the VM has been migrated out of the vApp
Step 6-9
Set Test Variable ${user} %{NIMBUS_USER}
Set Suite Variable @{list} ${user}-vic-vmotion-13-1.vcva-${VC_VERSION} ${user}-vic-vmotion-13-1.esx.0 ${user}-vic-vmotion-13-1.esx.1 ${user}-vic-vmotion-13-1.esx.2 ${user}-vic-vmotion-13-1.esx.3 ${user}-vic-vmotion-13-1.nfs.0 ${user}-vic-vmotion-13-1.iscsi.0
Install VIC Appliance To Test Server
Run Regression Tests
${host}= Get VM Host Name %{VCH-NAME}
${status}= Run Keyword And Return Status Should Contain ${host} ${esx1-ip}
Run Keyword If ${status} Run govc vm.migrate -host cls/${esx2-ip} %{VCH-NAME}
Run Keyword Unless ${status} Run govc vm.migrate -host cls/${esx1-ip} %{VCH-NAME}
Run Regression Tests
Step 10-13
Install VIC Appliance To Test Server
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
${rc} ${container1}= Run And Return Rc And Output docker %{VCH-PARAMS} create busybox /bin/top
Should Be Equal As Integers ${rc} 0
${rc} ${container2}= 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 ${container2}
Should Be Equal As Integers ${rc} 0
${rc} ${container3}= Run And Return Rc And Output docker %{VCH-PARAMS} create busybox ls
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${container3}
Should Be Equal As Integers ${rc} 0
${host}= Get VM Host Name %{VCH-NAME}
${status}= Run Keyword And Return Status Should Contain ${host} ${esx1-ip}
Run Keyword If ${status} Run govc vm.migrate -host cls/${esx2-ip} %{VCH-NAME}
Run Keyword Unless ${status} Run govc vm.migrate -host cls/${esx1-ip} %{VCH-NAME}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${container1}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} stop ${container1}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${container1}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} stop ${container2}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${container2}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} logs ${container3}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${container3}
Should Be Equal As Integers ${rc} 0

View File

@@ -0,0 +1,23 @@
Test 13-2 vMotion Container
=======
# Purpose:
To verify the VCH appliance continues to function properly after some or all of it's related containers are vMotioned
# References:
[1- vMotion A Powered On Virtual Machine](http://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp?topic=/com.vmware.vsphere.dcadmin.doc_41/vsp_dc_admin_guide/migrating_virtual_machines/t_migrate_a_powered-on_virtual_machine_with_vmotion.html)
# Environment:
This test requires that a vCenter server is running and available
# Test Steps:
1. Install a new VCH appliance onto one of the hosts within the vCenter server
2. Create several containers on the new VCH appliance that are in the following states: created but not started, started and running, started and stopped, stopped after running and being attached to, running after being attached to but currently not attached to, running and currently attached to
3. vMotion each of the containers to a new host within the vCenter server
4. Complete the life cycle of the containers created in Step 2, including getting docker logs and re-attaching to containers that are running
# Expected Outcome:
In each scenario, the VCH appliance should continue to work as expected after being vMotioned and all docker commands should return without error
# Possible Problems:
None

View File

@@ -0,0 +1,65 @@
# 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 13-2 - vMotion Container
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Create a VSAN Cluster vic-vmotion-13-2
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
Test Teardown Cleanup VIC Appliance On Test Server
*** Test Cases ***
Test
Set Test Variable ${user} %{NIMBUS_USER}
Set Suite Variable @{list} ${user}-vic-vmotion-13-2.vcva-${VC_VERSION} ${user}-vic-vmotion-13-2.esx.0 ${user}-vic-vmotion-13-2.esx.1 ${user}-vic-vmotion-13-2.esx.2 ${user}-vic-vmotion-13-2.esx.3 ${user}-vic-vmotion-13-2.nfs.0 ${user}-vic-vmotion-13-2.iscsi.0
Install VIC Appliance To Test Server
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
${rc} ${container1}= Run And Return Rc And Output docker %{VCH-PARAMS} create busybox /bin/top
Should Be Equal As Integers ${rc} 0
${rc} ${container2}= 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 ${container2}
Should Be Equal As Integers ${rc} 0
${rc} ${container3}= Run And Return Rc And Output docker %{VCH-PARAMS} create busybox ls
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${container3}
Should Be Equal As Integers ${rc} 0
${vmName1}= Get VM display name ${container1}
${vmName2}= Get VM display name ${container2}
${vmName3}= Get VM display name ${container3}
vMotion A VM ${vmName1}
vMotion A VM ${vmName2}
vMotion A VM ${vmName3}
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${container1}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} stop ${container1}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${container1}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} stop ${container2}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${container2}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} logs ${container3}
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} rm ${container3}
Should Be Equal As Integers ${rc} 0

View File

@@ -0,0 +1,8 @@
Group 13 - vMotion
=======
[Test 13-1 - vMotion VCH Appliance](13-1-vMotion-VCH-Appliance.md)
-
[Test 13-2 - vMotion Container](13-2-vMotion-Container.md)
-

View File

@@ -0,0 +1,24 @@
Test 14-1 - Longevity
=======
# Purpose:
To verify that VIC appliance can run for prolonged periods of time without leaking or causing system instability
# References:
None
# Environment:
This test requires that a vSphere server is running, isolated, and available for long periods of time
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Execute a random loop of 10-50 iterations of the regression suite
3. Issue vic-machine delete to cleanup the VCH
4. Repeat Steps 1-3 48 times alternating between using TLS certificates and not on each install.
# Expected Outcome:
* VIC appliance should install correctly and cleanup after itself each time
* Each iteration of the regression suite should pass without error
# Possible Problems:
None

View File

@@ -0,0 +1,40 @@
# 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 14-1 - Longevity
Resource ../../resources/Util.robot
Test Teardown Run Keyword If Test Failed Longevity cleanup
*** Keywords ***
Longevity cleanup
Run Keyword And Continue On Failure Post Message To Slack Channel mwilliamson-staff Longevity has failed on %{GOVC_URL}
Run Keyword And Continue On Failure Gather Logs From Test Server
Run Keyword And Continue On Failure Run govc logs.download
*** Test Cases ***
Longevity
# Each loop should take between 1 and 2 hours
:FOR ${idx} IN RANGE 0 48
\ ${rand}= Evaluate random.randint(10, 50) modules=random
\ Log To Console \nLoop: ${idx}
\ Install VIC Appliance To Test Server debug=%{DEBUG_VCH_LEVEL} additional-args=%{STATIC_VCH_OPTIONS} %{SYSLOG_VCH_OPTION}
\ Repeat Keyword ${rand} times Run Regression Tests
\ Cleanup VIC Appliance On Test Server
\ ${rand}= Evaluate random.randint(10, 50) modules=random
\ Install VIC Appliance To Test Server debug=%{DEBUG_VCH_LEVEL} certs=${true} additional-args=%{STATIC_VCH_OPTIONS} %{SYSLOG_VCH_OPTION}
\ Repeat Keyword ${rand} times Run Regression Tests
\ Cleanup VIC Appliance On Test Server
Post Message To Slack Channel mwilliamson-staff Longevity has passed on %{GOVC_URL}

View File

@@ -0,0 +1,27 @@
Test 14-2 - Longevity - Single - VCH
=======
# Purpose:
To verify that a single VIC appliance can run for prolonged periods of time without leaking or causing system instability
# References:
None
# Environment:
This test requires that a vSphere server is running, isolated, and available for long periods of time
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Execute a loop of the regression suite for up to 2 days
3. Issue vic-machine delete to cleanup the VCH
4. Install another VCH
5. Execute a single iteration of the regression suite
6. Issue vic-machine delete to cleanup the VCH
# Expected Outcome:
* VIC appliance should install correctly and cleanup after itself each time
* Each iteration of the regression suite should pass without error
* The VCH installed after the long loop should install correctly, function as expected and cleanup after itself
# Possible Problems:
None

View File

@@ -0,0 +1,39 @@
# 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 14-2 - Longevity - Single - VCH
Resource ../../resources/Util.robot
Test Teardown Run Keyword If Test Failed Longevity cleanup
*** Keywords ***
Longevity cleanup
Run Keyword And Continue On Failure Post Message To Slack Channel mwilliamson-staff Longevity has failed on %{GOVC_URL}
Run Keyword And Continue On Failure Run govc logs.download
*** Test Cases ***
Longevity - Single - VCH
# Just install with certs, as it is our most common expected install path
Install VIC Appliance To Test Server debug=0 certs=${true} additional-args=%{STATIC_VCH_OPTIONS}
# Each regression test takes about 1-2 minutes, so round down and call it a minute
# 2880 is the number of minutes in 2 days
:FOR ${idx} IN RANGE 0 2880
\ Log To Console \nLoop: ${idx}
\ Run Regression Tests
Cleanup VIC Appliance On Test Server
Install VIC Appliance To Test Server debug=0 certs=${true} additional-args=%{STATIC_VCH_OPTIONS}
Run Regression Tests
Cleanup VIC Appliance On Test Server

View File

@@ -0,0 +1,8 @@
Group 14 - Longevity
=======
[Test 14-1 - Longevity](14-1-Longevity.md)
-
[Test 14-2 - Longevity - Single - VCH](14-2-Longevity-Single-VCH.md)
-

View File

@@ -0,0 +1,26 @@
Test 15-1 Drone Continuous Integration
=======
# Purpose:
To verify the VCH appliance can be used as the docker engine replacement for a drone continuous integration environment
# References:
[1- Drone Server Setup](http://readme.drone.io/setup/overview/)
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a new VCH appliance into the vSphere server
2. Clone the latest git repo code of VIC
3. Execute the following command in the VIC repo:
```
drone exec --docker-host <VCH-IP>:2375 --trusted -E secrets.yml -yaml .drone.yml
```
# Expected Outcome:
VIC should build properly and execute each of the unit and integration tests properly from within the drone environment.
# Possible Problems:
None

View File

@@ -0,0 +1,55 @@
# 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 15-1 - Drone Continuous Integration
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server Without TLS
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Install VIC Appliance To Test Server Without TLS
[Arguments] ${vic-machine}=bin/vic-machine-linux ${appliance-iso}=bin/appliance.iso ${bootstrap-iso}=bin/bootstrap.iso ${vol}=default
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 And Ignore Error Cleanup Dangling VMs On Test Server
Run Keyword And Ignore Error Cleanup Datastore On Test Server
Run Keyword And Ignore Error Cleanup Dangling Networks On Test Server
Run Keyword And Ignore Error Cleanup Dangling vSwitches On Test Server
# Install the VCH now
Log To Console \nInstalling VCH to test server...
${output}= No TLS VIC Install ${vic-machine} ${appliance-iso} ${bootstrap-iso} ${vol}
Log ${output}
Should Contain ${output} Installer completed successfully
Get Docker Params ${output} ${false}
Log To Console Installer completed successfully: %{VCH-NAME}...
No TLS VIC Install
[Tags] secret
[Arguments] ${vic-machine} ${appliance-iso} ${bootstrap-iso} ${vol}
${output}= Run ${vic-machine} create --debug 1 --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} --volume-store=%{TEST_DATASTORE}/%{VCH-NAME}-VOL:${vol} --no-tls
Should Contain ${output} Installer completed successfully
[Return] ${output}
*** Test Cases ***
Drone CI
${output}= Run git clone https://github.com/vmware/vic.git drone-ci
Log ${output}
${result}= Run Process drone exec --docker-host %{VCH-IP}:2375 --trusted -e .drone.sec -yaml .drone.yml shell=True cwd=drone-ci
Log ${result.stderr}
Log ${result.stdout}
Log ${result.rc}

View File

@@ -0,0 +1,39 @@
# 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 15-2 - Basic Harbor
Resource ../../resources/Util.robot
Test Teardown Harbor Test Cleanup
*** Keywords ***
Harbor Test Cleanup
Cleanup VIC Appliance On Test Server
${out}= Run govc vm.destroy harbor
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 ***
Basic Harbor Install
Install Harbor To Test Server
Install VIC Appliance To Test Server vol=default --insecure-registry %{HARBOR_IP}
Wait Until Keyword Succeeds 5x 15 seconds Pull image %{HARBOR_IP}/library/photon:1.0

View File

@@ -0,0 +1,33 @@
Test 15-03 - Appliance and Network Settings
# Purpose:
To verify that the guest OS deployed using built ova has user specified appliance and network settings
# Environment:
This test requires that a vCenter and a vSphere server are running and available
# Test Steps:
1. Deploy Unified OVA to vCenter with provided network parameters
2. For loop on a GOVC command to query guest network information until returned result is not null or maximum retry reached
3. Issue a GOVC command to get the IP addresses for "VM Network"
4. Issue a GOVC command to get the subnet netmask for the first IP address in "VM Network"
5. Issue a GOVC command to get the dhcp option for guest os
6. Issue a GOVC command to get the dns address for guest os
7. Issue a GOVC command to get the dns searchdomains for guest os
8. Issue a GOVC command to check disk size('disk-1000-1') for guest os
9. Issue a GOVC command to resize disk-1000-1 and assure the resizing works
10. Remove deployed Unified OVA, Redeploy Unified OVA to vCenter without network parameters(dhcp by default)
11. Issue a GOVC command to make sure the first ip address under "VM Network" is an IPv4 address(including three '.' in address)
# Expected Outcome:
* Step 2 should exit for loop on a non-null network information
* Step 3 should result in an output where 'ips' contains '${ova_network_ip0}'
* Step 4 should result in an output where 'netmask' should be 24
* Step 5 should result in an output where 'dhcp' should be false
* Step 6 should result in an output where 'dns' should be '${ova_network_dns}'
* Step 7 should result in an output where 'search_domains' should be 'ova_network_searchpath'
* Step 8 should result in an output where 'size' should be '${ova_default_disk_size_inKB}'
* Step 9 should successfully resize 'disk-1000-1' and result in an output where 'size' being '${ova_adjusted_disk_size_inKB}'
# Possible Problems:
* Step 2 exit for loop when maximum retry reached, meaning guest network has not been configured yet, which will fail this test

View File

@@ -0,0 +1,101 @@
# 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 15-03 - Appliance and Network basic settings
Resource ../../resources/Util.robot
Suite Setup Setup Suite Environment
Suite Teardown Cleanup Suite Environment
*** Variables ***
${dhcp} True
${not_collect_log} False
${esx_number} 1
${network} False
${maximum_retry} 10
*** Keywords ***
Setup Suite Environment
@{vms}= Create A Simple VC Cluster datacenter cls ${esx_number} ${network}
${vm_num}= Evaluate ${esx_number}+1
${vm-names}= Get Slice From List ${vms} 0 ${vm_num}
${vm-ips}= Get Slice From List ${vms} ${vm_num}
Set Suite Variable ${vc-ip} @{vm-ips}[${esx_number}]
Set Suite Variable ${vm-names} ${vm-names}
Set Suite Variable ${vm-ips} ${vm-ips}
${size}= Evaluate 50*1024*1024
Set Suite Variable ${ova_default_disk_size_inKB} ${size}
${size}= Evaluate 80*1024*1024
Set Suite Variable ${ova_adjusted_disk_size_inKB} ${size}
GOVC Use VC Environment
Cleanup Suite Environment
Nimbus Cleanup ${vm-names} ${not_collect_log}
Check VCH VM Disk Size
[Arguments] ${target_size}
${size}= Run govc device.info -json -vm ${ova_target_vm_name} disk-1000-1 | jq .Devices[].CapacityInKB
Should Be Equal As Integers ${size} ${target_size}
Resize VCH VM Disk
[Arguments] ${target_size}
Run govc vm.disk.change -vm=${ova_target_vm_name} -disk.name "disk-1000-1" -size=${target_size}KB
GOVC Use VC Environment
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23
GOVC Use ESXi Environment
Set Environment Variable GOVC_URL @{vm-ips}[0]
Set Environment Variable GOVC_USERNAME root
Set Environment Variable GOVC_PASSWORD ${NIMBUS_ESX_PASSWORD}
*** Test Cases ***
Check VCH VM Network Settings
[Setup] Deploy VIC-OVA To Test Server
${ip}= Run govc vm.ip -n ethernet-0 -v4 ${ova_target_vm_name}
Should Be Equal ${ip} ${ova_network_ip0}
${netmasks}= Run govc vm.info -json ${ova_target_vm_name} | jq -r '.VirtualMachines[].Guest.Net[] | select(.Network == "VM Network").IpConfig.IpAddress[].PrefixLength'
@{netmasks}= Split To Lines ${netmasks}
${netmask}= Convert To Integer @{netmasks}[0]
Should Be Equal As Integers ${netmask} 24
${dhcp}= Run govc vm.info -json ${ova_target_vm_name} | jq -r '.VirtualMachines[].Guest.IpStack[].DnsConfig.Dhcp'
Should Be Equal ${dhcp} false
${dns}= Run govc vm.info -json ${ova_target_vm_name} | jq -r '.VirtualMachines[].Guest.IpStack[].DnsConfig.IpAddress[]'
Should Be Equal ${dns} ${ova_network_dns}
${search_domains}= Run govc vm.info -json ${ova_target_vm_name} | jq -r '.VirtualMachines[].Guest.IpStack[].DnsConfig.SearchDomain[]'
@{search_domains}= Split String ${search_domains} ,
@{search_domains_setting}= Split String ${ova_network_searchpath} ,
${length}= Get Length ${search_domains}
Length Should Be ${search_domains_setting} ${length}
:For ${index} IN RANGE ${length}
\ Should Be Equal @{search_domains}[${index}] @{search_domains_setting}[${index}]
Check VCH VM Disk Repartition
Check VCH VM Disk Size ${ova_default_disk_size_inKB}
Resize VCH VM Disk ${ova_adjusted_disk_size_inKB}
Check VCH VM Disk Size ${ova_adjusted_disk_size_inKB}
[Teardown] Cleanup VIC-OVA On Test Server
# If the first ipaddress for VM Network is an IPv4 ipaddress, then dhcp is assumed to be successful
Check VCH VM Network DHCP Settings
[Setup] Deploy VIC-OVA To Test Server ${dhcp}
${ips}= Run govc vm.info -json ${ova_target_vm_name} | jq -r '.VirtualMachines[].Guest.Net[] | select(.Network == "VM Network").IpConfig.IpAddress[].IpAddress'
@{ips}= Split To Lines ${ips}
${ip_dot_number}= Run echo @{ips}[0] | awk '{print gsub(/\\\./, "")}'
${ip_dot_number}= Convert To Integer ${ip_dot_number}
Should Be Equal As Integers ${ip_dot_number} 3
[Teardown] Cleanup VIC-OVA On Test Server

View File

@@ -0,0 +1,7 @@
Group 15 - Dogfood
=======
[Test 15-1 - Drone Continuous Integration](15-1-Drone-Continuous-Integration.md)
[Test 15-2 - Basic Harbor](15-2-Basic-Harbor.md)
[Test 15-3 - OVA](15-3-OVA.md)
-

View File

@@ -0,0 +1,26 @@
Test 16-1 Windows VCH Install
=======
# Purpose:
To verify the VCH appliance can be installed and used from a windows based client
# References:
* vic-machine-windows.exe -h
# Environment:
This test requires that a vSphere server is running and available and a windows client
# Test Steps:
1. From the windows client, download the latest VIC release
2. From within the release package, run vic-machine-windows.exe to install the VCH into the vSphere server with TLS enabled
3. Run a variety of docker commands on the new VCH
4. Delete the VCH
5. Install a new VCH server with TLS disabled
6. Run a variety of docker commands on the new VCH
7. Delete the VCH
# Expected Outcome:
Each VCH should install properly and all docker commands executed should complete without error
# Possible Problems:
None

View File

@@ -0,0 +1,53 @@
# 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 16-1 - Windows VIC Machine
Resource ../../resources/Util.robot
Test Setup Set Test Environment Variables
*** Variables ***
${ver} 8351
*** Keywords ***
Cleanup Folders
${output}= Execute Command rm -Recurse -Force vic*
${output}= Execute Command rm *.pem
*** Test Cases ***
Install VCH With TLS
Open Connection %{WINDOWS_URL} prompt=>
Login %{WINDOWS_USERNAME} %{WINDOWS_PASSWORD}
Cleanup Folders
${output}= Execute Command wget https://storage.googleapis.com/vic-engine-builds/vic_${ver}.tar.gz -OutFile vic.tar.gz
${output}= Execute Command 7z x vic.tar.gz
${output}= Execute Command 7z x vic.tar
${output}= Execute Command ./vic/vic-machine-windows.exe create --target %{TEST_URL} --user %{TEST_USERNAME} --password %{TEST_PASSWORD}
Get Docker Params ${output} ${true}
Run Regression Tests
${output}= Execute Command ./vic/vic-machine-windows.exe delete --target %{TEST_URL} --user %{TEST_USERNAME} --password %{TEST_PASSWORD}
Cleanup Folders
Install VCH Without TLS
Open Connection %{WINDOWS_URL} prompt=>
Login %{WINDOWS_USERNAME} %{WINDOWS_PASSWORD}
Cleanup Folders
${output}= Execute Command wget https://storage.googleapis.com/vic-engine-builds/vic_${ver}.tar.gz -OutFile vic.tar.gz
${output}= Execute Command 7z x vic.tar.gz
${output}= Execute Command 7z x vic.tar
${output}= Execute Command ./vic/vic-machine-windows.exe create --target %{TEST_URL} --user %{TEST_USERNAME} --password %{TEST_PASSWORD} --no-tls
Get Docker Params ${output} ${false}
Run Regression Tests
${output}= Execute Command ./vic/vic-machine-windows.exe delete --target %{TEST_URL} --user %{TEST_USERNAME} --password %{TEST_PASSWORD}
Cleanup Folders

View File

@@ -0,0 +1,6 @@
Group 16 - Windows Client
=======
[Test 16-1 - Windows VIC Machine](16-1-Windows-VIC-Machine.md)
-

View File

@@ -0,0 +1,24 @@
Test 17-1 - TTY Tests
=======
# Purpose:
To verify that docker commands using TTY work with VIC
# References:
# Environment:
This test requires that a vSphere server is running and available
# Test Cases
1. Deploy VIC appliance to vSphere server
2. Issue docker run -it busybox date to the new VCH
3. Issue docker run -it busybox df to the new VCH
4. Issue docker run -it busybox top to the new VCH
5. Issue docker create -it busybox /bin/top to VIC appliance
6. Issue docker start -ai <containerID> from previous step
7. Issue commands to make container stuck in starting status, and then test docker stop can stop the container
8. Issue commands to test the second start works after docker run with -it
### Expected Outcome:
* Steps 1-8 should all succeed and return the expected output from those commands

View File

@@ -0,0 +1,194 @@
# 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 17-1 - TTY Tests
Resource ../../resources/Util.robot
Suite Setup Install VIC Appliance To Test Server
Suite Teardown Cleanup VIC Appliance On Test Server
*** Keywords ***
Make sure container starts
:FOR ${idx} IN RANGE 0 30
\ ${out}= Run docker %{VCH-PARAMS} ps
\ ${status}= Run Keyword And Return Status Should Contain ${out} /bin/top
\ Exit For Loop If ${status}
\ Sleep 1
Make Fifo
${rc} ${tmpdir}= Run And Return Rc And Output mktemp -d
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output mkfifo ${tmpdir}/fifo
Should Be Equal As Integers ${rc} 0
[Return] ${tmpdir}/fifo
*** Test Cases ***
Docker run -it date
${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} run -it busybox date
Should Be Equal As Integers ${rc} 0
Should Contain ${out} UTC
Docker run -it df
${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} run -it busybox df
Should Be Equal As Integers ${rc} 0
Should Contain ${out} Filesystem
Docker run -it command that doesn't stop
${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} ps -aq | xargs -n1 docker %{VCH-PARAMS} rm -f
${result}= Start Process docker %{VCH-PARAMS} run -itd busybox /bin/top shell=True alias=top
Make sure container starts
${containerID}= Run docker %{VCH-PARAMS} ps -q
${out}= Run docker %{VCH-PARAMS} logs ${containerID}
Should Contain ${out} Mem:
Should Contain ${out} CPU:
Should Contain ${out} Load average:
Docker run with -i
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -i busybox /bin/ash -c "dmesg;echo END_OF_THE_TEST"
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} END_OF_THE_TEST
Docker run with -it
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -it busybox /bin/ash -c "dmesg;echo END_OF_THE_TEST"
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} END_OF_THE_TEST
Hello world with -i
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -i hello-world
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} https://docs.docker.com/engine/userguide/
Hello world with -it
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -it hello-world
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} https://docs.docker.com/engine/userguide/
Start with attach and interactive
${fifo}= Make Fifo
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} Error
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it busybox /bin/top
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} Error:
Start Process docker %{VCH-PARAMS} start -ai ${output} < ${fifo} shell=True alias=custom
Sleep 3
Run echo q > ${fifo}
${ret}= Wait For Process custom
Should Be Equal As Integers ${ret.rc} 0
Should Not Contain ${ret.stdout} Error:
Should Not Contain ${ret.stderr} Error:
Start a container after docker run
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
${name}= Generate Random String 15
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -it --name ${name} busybox /bin/date
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${name}
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} Error:
Attach with custom detach keys
${status}= Get State Of Github Issue 5723
Run Keyword If '${status}' == 'closed' Fail Test 17-1-TTY-Tests.robot needs to be updated now that Issue #5723 has been resolved
Log Issue \#5723 is blocking implementation WARN
# ${fifo}= Make Fifo
# ${out}= Run docker %{VCH-PARAMS} pull busybox
# ${rc} ${containerID}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it busybox /bin/top
# Should Be Equal As Integers ${rc} 0
# ${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${containerID}
# Should Be Equal As Integers ${rc} 0
# Start Process docker %{VCH-PARAMS} attach --detach-keys\=a ${containerID} < ${fifo} shell=True alias=custom
# Sleep 3
# Run echo a > ${fifo}
# ${ret}= Wait For Process custom
# Should Be Equal As Integers ${ret.rc} 0
# Should Be Empty ${ret.stdout}
# Should Be Empty ${ret.stderr}
Reattach to container
${status}= Get State Of Github Issue 5723
Run Keyword If '${status}' == 'closed' Fail Test 17-1-TTY-Tests.robot needs to be updated now that Issue #5723 has been resolved
Log Issue \#5723 is blocking implementation WARN
# ${fifo}= Make Fifo
# ${out}= Run docker %{VCH-PARAMS} pull busybox
# ${rc} ${containerID}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it busybox /bin/top
# Should Be Equal As Integers ${rc} 0
# ${rc} ${out}= Run And Return Rc And Output docker %{VCH-PARAMS} start ${containerID}
# Should Be Equal As Integers ${rc} 0
# Start Process docker %{VCH-PARAMS} attach --detach-keys\=a ${containerID} < ${fifo} shell=True alias=custom
# Sleep 3
# Run echo a > ${fifo}
# ${ret}= Wait For Process custom
# Should Be Equal As Integers ${ret.rc} 0
# Should Be Empty ${ret.stdout}
# Should Be Empty ${ret.stderr}
# Start Process docker %{VCH-PARAMS} attach --detach-keys\=a ${containerID} < ${fifo} shell=True alias=custom2
# Sleep 3
# Run echo a > ${fifo}
# ${ret}= Wait For Process custom2
# Should Be Equal As Integers ${ret.rc} 0
# Should Be Empty ${ret.stdout}
# Should Be Empty ${ret.stderr}
Exec Echo -it
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} Error
${rc} ${id}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d busybox /bin/top -d 600
Should Be Equal As Integers ${rc} 0
:FOR ${idx} IN RANGE 0 5
\ ${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec -it ${id} /bin/echo "I find your lack of faith disturbing."
\ Should Be Equal As Integers ${rc} 0
\ Should Be Equal As Strings ${output} I find your lack of faith disturbing.
Exec Sort -it
${fifo}= Make Fifo
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} Error
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d busybox /bin/top -d 600
Should Be Equal As Integers ${rc} 0
:FOR ${idx} IN RANGE 0 5
\ Start Process docker %{VCH-PARAMS} exec -it ${output} /bin/sort < ${fifo} shell=True alias=custom
\ Run echo one > ${fifo}
\ ${ret}= Wait For Process custom
\ Log ${ret.stderr}
\ Should Be Equal ${ret.stderr} the input device is not a TTY
\ Should Be Equal As Integers ${ret.rc} 1
\ Should Be Empty ${ret.stdout}
Run rm -rf $(dirname ${fifo})
Exec Sort -i
${fifo}= Make Fifo
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} Error
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d busybox /bin/top -d 600
Should Be Equal As Integers ${rc} 0
:FOR ${idx} IN RANGE 0 5
\ Start Process docker %{VCH-PARAMS} exec -i ${output} /bin/sort < ${fifo} shell=True alias=custom
\ Run echo one > ${fifo}
\ ${ret}= Wait For Process custom
\ Log ${ret.stderr}
\ Should Be Equal ${ret.stdout} one
\ Should Be Equal As Integers ${ret.rc} 0
\ Should Be Empty ${ret.stderr}
Run rm -rf $(dirname ${fifo})

View File

@@ -0,0 +1,6 @@
Group 17 - Manual TTY Tests
=======
[Test 17-1 - TTY Tests](17-1-TTY-Tests.md)
-

View File

@@ -0,0 +1,32 @@
Test 18-1 - VIC UI Installation
======
# Purpose:
To test all possible installation failures and success scenarios on VCSA
# References:
# Environment:
* Testing VIC UI requires a working VCSA setup with VCH installed
* Target VCSA has Bash enabled for the root account
# Test Steps:
1. Check if the configs file exists
2. Ensure UI plugin is not registered with VC before testing
3. Try installing UI without the configs file
4. Try installing UI with vsphere-client-serenity folder missing
5. Try installing UI with vCenter IP missing
6. Try installing UI with invalid vCenter IP
7. Try installing UI with wrong vCenter credentials
8. [SKIP] Try installing UI with wrong vCenter root password
9. Try installing UI with Bash disabled
10. Install UI successfully without a web server
11. Try installing UI when it is already installed
12. Install UI successfully with the --force flag when the plugin is already registered
13. Try installing UI with a web server and an invalid URL to the plugin zip file
# Expected Outcome:
* Each step should return success
# Possible Problems:
Attempting to `ssh` into VCSA with a wrong root password three times locks the account for a certain amount of time. For this reason Step 8 is skipped.

View File

@@ -0,0 +1,76 @@
# 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 18-1 - VIC UI Installation
Resource ../../resources/Util.robot
Resource ./vicui-common.robot
Test Teardown Cleanup Installer Environment
Suite Setup Check Config And Install VCH remove
Suite Teardown Uninstall VCH ${TRUE}
*** Test Cases ***
Attempt To Install With Configs File Missing
# Rename the configs file and run the installer script to see if it fails in an expected way
Move File ${UI_INSTALLER_PATH}/configs ${UI_INSTALLER_PATH}/configs_renamed
${rc} ${output}= Run And Return Rc And Output ${INSTALLER_SCRIPT_PATH}
Run Keyword And Continue On Failure Should Contain ${output} Configs file is missing
Move File ${UI_INSTALLER_PATH}/configs_renamed ${UI_INSTALLER_PATH}/configs
Attempt To Install With Manifest Missing
Move File ${UI_INSTALLER_PATH}/../plugin-manifest ${UI_INSTALLER_PATH}/../plugin-manifest-a
${rc} ${output}= Run And Return Rc And Output cd ${UI_INSTALLER_PATH} && ${INSTALLER_SCRIPT_PATH}
Run Keyword And Continue On Failure Should Contain ${output} manifest was not found
Move File ${UI_INSTALLER_PATH}/../plugin-manifest-a ${UI_INSTALLER_PATH}/../plugin-manifest
Attempt To Install To A Non vCenter Server
Install Fails not-a-vcenter-server admin password ${TRUE}
${output}= OperatingSystem.GetFile install.log
${passed}= Run Keyword And Return Status Should Contain ${output} vCenter Server was not found
Run Keyword Unless ${passed} Move File install.log install-fail-attempt-to-a-non-vcenter-server.log
Should Be True ${passed}
Attempt To Install With Wrong Vcenter Credentials
Set Fileserver And Thumbprint In Configs
Append To File ${UI_INSTALLER_PATH}/configs BYPASS_PLUGIN_VERIFICATION=1\n
Install Fails ${TEST_VC_IP} ${TEST_VC_USERNAME}_nope ${TEST_VC_PASSWORD}_nope ${FALSE} %{VC_FINGERPRINT}
${output}= OperatingSystem.GetFile install.log
${passed}= Run Keyword And Return Status Should Contain ${output} Cannot complete login due to an incorrect user name or password
Run Keyword Unless ${passed} Move File install.log install-fail-attempt-to-install-with-wrong-vcenter-credentials.log
Should Be True ${passed}
Attempt to Install With Unmatching Fingerprint
Append To File ${UI_INSTALLER_PATH}/configs BYPASS_PLUGIN_VERIFICATION=1\n
Install Fails ${TEST_VC_IP} ${TEST_VC_USERNAME} ${TEST_VC_PASSWORD} ${FALSE} ff:ff:ff
${output}= OperatingSystem.GetFile install.log
${passed}= Run Keyword And Return Status Should Contain ${output} does not match
Run Keyword Unless ${passed} Move File install.log install-fail-attempt-to-install-with-unmatching-fingerprint.log
Should Be True ${passed}
Attempt To Install With Wrong OVA Fileserver URL
Set Fileserver And Thumbprint In Configs ${TRUE}
Install Fails ${TEST_VC_IP} ${TEST_VC_USERNAME} ${TEST_VC_PASSWORD} ${TRUE}
${output}= OperatingSystem.GetFile install.log
${passed}= Run Keyword And Return Status Should Contain ${output} Error
Run Keyword Unless ${passed} Move File install.log install-fail-attempt-to-install-with-wrong-ova-fileserver-url.log
Should Be True ${passed}
Install Plugin Successfully
Set Fileserver And Thumbprint In Configs
Append To File ${UI_INSTALLER_PATH}/configs BYPASS_PLUGIN_VERIFICATION=1\n
Install Plugin Successfully ${TEST_VC_IP} ${TEST_VC_USERNAME} ${TEST_VC_PASSWORD} ${TRUE}
${output}= OperatingSystem.GetFile install.log
${passed}= Run Keyword And Return Status Should Contain ${output} exited successfully
Run Keyword Unless ${passed} Move File install.log install-fail-ensure-vicui-is-installed-before-testing.log
Should Be True ${passed}

View File

@@ -0,0 +1,26 @@
Test 18-2 - VIC UI Uninstallation
======
# Purpose:
To test all possible uninstallation failures and success scenarios on VCSA
# References:
# Environment:
* Testing VIC UI requires a working VCSA setup with VCH installed
* Target VCSA has Bash enabled for the root account
# Test Steps:
1. Check if the configs file exists
2. Ensure UI plugin is already registered with VC before testing
3. Try uninstalling UI without the configs file
4. Try uninstalling UI with vsphere-client-serenity folder missing
5. Try uninstalling UI with vCenter IP missing
6. Try uninstalling UI with wrong vCenter credentials
7. Uninstall UI successfully
8. Try uninstalling UI when it's already uninstalled
# Expected Outcome:
* Each step should return success
# Possible Problems:

View File

@@ -0,0 +1,67 @@
# 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 18-2 - VIC UI Uninstallation
Resource ../../resources/Util.robot
Resource ./vicui-common.robot
Test Teardown Cleanup Installer Environment
Suite Setup Check Config And Install VCH install
Suite Teardown Uninstall VCH ${TRUE}
*** Test Cases ***
Attempt To Uninstall With Configs File Missing
# Rename the configs file and run the uninstaller script to see if it fails in an expected way
Move File ${UI_INSTALLER_PATH}/configs ${UI_INSTALLER_PATH}/configs_renamed
${rc} ${output}= Run And Return Rc And Output ${UNINSTALLER_SCRIPT_PATH}
Run Keyword And Continue On Failure Should Contain ${output} Configs file is missing
Move File ${UI_INSTALLER_PATH}/configs_renamed ${UI_INSTALLER_PATH}/configs
Attempt To Uninstall With Plugin Manifest Missing
Move File ${UI_INSTALLER_PATH}/../plugin-manifest ${UI_INSTALLER_PATH}/../plugin-manifest-a
${rc} ${output}= Run And Return Rc And Output cd ${UI_INSTALLER_PATH} && ${UNINSTALLER_SCRIPT_PATH}
Run Keyword And Continue On Failure Should Contain ${output} manifest was not found
Move File ${UI_INSTALLER_PATH}/../plugin-manifest-a ${UI_INSTALLER_PATH}/../plugin-manifest
Attempt To Uninstall From A Non vCenter Server
Uninstall Fails not-a-vcenter-server admin password
${output}= OperatingSystem.GetFile uninstall.log
${passed}= Run Keyword And Return Status Should Contain ${output} vCenter Server was not found
Run Keyword Unless ${passed} Move File uninstall.log uninstall-fail-attempt-to-uninstall-from-a-non-vcenter-server.log
Should Be True ${passed}
Attempt To Uninstall With Wrong Vcenter Credentials
Set Fileserver And Thumbprint In Configs
Uninstall Fails ${TEST_VC_IP} ${TEST_VC_USERNAME}_nope ${TEST_VC_PASSWORD}_nope
${output}= OperatingSystem.GetFile uninstall.log
${passed}= Run Keyword And Return Status Should Contain ${output} Cannot complete login due to an incorrect user name or password
Run Keyword Unless ${passed} Move File uninstall.log uninstall-fail-attempt-to-uninstall-with-wrong-vcenter-credentials.log
Should Be True ${passed}
Uninstall Successfully
Set Fileserver And Thumbprint In Configs
Uninstall Vicui ${TEST_VC_IP} ${TEST_VC_USERNAME} ${TEST_VC_PASSWORD}
${output}= OperatingSystem.GetFile uninstall.log
${passed}= Run Keyword And Return Status Should Match Regexp ${output} exited successfully
Run Keyword Unless ${passed} Move File uninstall.log uninstall-fail-uninstall-successfully.log
Should Be True ${passed}
Attempt To Uninstall Plugin That Is Already Gone
Set Fileserver And Thumbprint In Configs
Uninstall Vicui ${TEST_VC_IP} ${TEST_VC_USERNAME} ${TEST_VC_PASSWORD}
${output}= OperatingSystem.GetFile uninstall.log
${passed}= Run Keyword And Return Status Should Contain ${output} 'com.vmware.vic.ui' is not registered
${passed2}= Run Keyword And Return Status Should Contain ${output} 'com.vmware.vic' is not registered
Run Keyword Unless (${passed} and ${passed2}) Move File uninstall.log uninstall-fail-attempt-to-uninstall-plugin-that-is-already-gone.log
Should Be True ${passed}

View File

@@ -0,0 +1,57 @@
Test 18-3 - VIC UI NGC Tests
======
# Purpose:
To test user interactions with VIC UI in vSphere Web Client
# References:
# Environment:
* Testing VIC UI requires a working VCSA setup with VCH installed
# Test Steps:
1. Check if provider properties files exist
2. Ensure UI plugin is already registered with VC before testing
3. Run the NGC tests
- Test 1: Verify if the VIC UI plugin is installed correctly
- Open a browser
- Log in as admin user
- Navigate to Administration -> Client Plug-Ins
- Verify if item “VicUI” exists
- Test 2.1: Verify if VCH VM Portlet exists
- Open a browser
- Log in as admin user
- Navigate to the VCH VM Summary tab
- Verify if property id `dockerApiEndpoint` exists
- Test 2.2: Verify if VCH VM Portlet displays correct information while VM is OFF
- Ensure the vApp is off
- Open a browser
- Log in as admin user
- Navigate to the VCH VM Summary tab
- Verify if `dockerApiEndpoint` equals the placeholder value `-`
- Test 2.3: Verify if VCH VM Portlet displays correct information while VM is ON
- Ensure the vApp is on
- Open a browser
- Log in as admin user
- Navigate to the VCH VM Summary tab
- Verify if `dockerApiEndpoint` does not equal the placeholder value `-`
- Test 3: Verify if Container VM Portlet exists
- Open a browser
- Log in as admin user
- Navigate to the Container VM Summary tab
- Verify if property id `containerName` exists
# Expected Outcome:
* Each step should return success
# Possible Problems:
1. NGC automated testing is not available on VC 5.5, so if the tests were to run against a box with VC 5.5 Step 3 above would be skipped. However, you can manually run the NGC tests by following the steps above.
2. Some Selenium Web Drivers are known to have bugs that slow down or even crash the tests
- 64 bit version of the Internet Explorer Driver has an issue with text input speed where it takes about 4-5 seconds per keystroke. (using the 32 bit version solves the issue)
- When run with the Chrome Driver, tests fail at the login page of the vSphere Web Client; browser hangs and does not automatically enter username and password
- Firefox driver has been the most stable and thus was set as the default browser for testing
- The findings were made using the latest non-beta release of Selenium (v2.53.1) and the latest browser drivers on a Nimbus-based Windows 7 VM

View File

@@ -0,0 +1,179 @@
# 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 18-3 - VIC UI NGC tests
Resource ../../resources/Util.robot
Resource ../../resources/Docker-Util.robot
Resource ./vicui-common.robot
Test Teardown Clean Up Testbed Config Files
Suite Setup Check Config And Install VCH
Suite Teardown Uninstall VCH ${TRUE}
*** Test Cases ***
Check Prerequisites
Set Suite Variable ${VCH_VM_NAME} %{VCH_VM_NAME}
${pwd}= Run pwd
Run Keyword If %{TEST_VSPHERE_VER} == 60 Should Exist ${pwd}/../../../ui/vic-uia/flex-automation-test/uia/vic-uia
Run Keyword If %{TEST_VSPHERE_VER} == 60 Set Suite Variable ${NGC_TESTS_PATH} ${pwd}/../../../ui/vic-uia/flex-automation-test/uia/vic-uia
Set Suite Variable ${use_existing_container_vm} False
Log To Console Checking if Selenium Grid is reachable at %{SELENIUM_SERVER_IP}...
${ping_rc}= Run And Return Rc nc -zv %{SELENIUM_SERVER_IP} 4444 -w 3
Run Keyword If ${ping_rc} > 0 Fatal Error Seleinum Grid %{SELENIUM_SERVER_IP} is not reachable!
# check if the files required by the ngc automation tests exist
Run Keyword If %{TEST_VSPHERE_VER} == 60 Should Exist ${NGC_TESTS_PATH}/resources/browservm.tpl.properties
Run Keyword If %{TEST_VSPHERE_VER} == 60 Should Exist ${NGC_TESTS_PATH}/resources/commonTestbedProvider.tpl.properties
Run Keyword If %{TEST_VSPHERE_VER} == 60 Should Exist ${NGC_TESTS_PATH}/resources/hostProvider.tpl.properties
Run Keyword If %{TEST_VSPHERE_VER} == 60 Should Exist ${NGC_TESTS_PATH}/resources/vicEnvProvider.tpl.properties
Ensure Vicui Is Installed
# ensure vicui is installed before running ngc automation tests
Force Install Vicui Plugin
Cleanup Installer Environment
Reboot vSphere Client
Run Ngc Tests Project
# create a container and get its name-id which is essentially the name of the vm
Run Keyword If ${use_existing_container_vm} == True Log To Console \nUsing the container specified in vicui-common.robot ELSE Create And Run Test Container
Log To Console Using container ${CONTAINER_VM_TRUNCATED_NAME}\n
# given the information in vicui-common.robot edit the above properties files
Run Keyword If %{TEST_VSPHERE_VER} == 60 Set Up Testbed Config Files ELSE Set Up Testbed For HSUIA
# start running ngc tests and expect the output does not include words 'BUILD FAILURE'
Run Keyword If '${TEST_VC_VERSION}'=='5.5' Skip Ngc Tests ELSE Start Ngc Tests
*** Keywords ***
Is vSphere Client Ready
Run Keyword If %{TEST_VSPHERE_VER} == 60 Log To Console Waiting until vSphere Web Client is up and ready... ELSE Log To Console Waiting until vSphere Client is up and ready...
${out}= Run Keyword If %{TEST_VSPHERE_VER} == 60 Run curl -sL https://${TEST_VC_IP}/vsphere-client/ -k ELSE Run curl -sL https://${TEST_VC_IP}/ui/ -k
${out_len}= Get Length ${out}
Should Be True ${out_len} > 0
Should Not Contain ${out} Service Unavailable
Should Not Contain ${out} is still initializing
Reboot vSphere Client
# reboot vsphere (web) client after installing the plugin
Open Connection ${TEST_VC_IP} prompt=#
Login root vmware
Run Keyword If %{TEST_VSPHERE_VER} == 60 Execute Command service vsphere-client stop ELSE Execute Command service-control --stop vsphere-ui
Run Keyword If %{TEST_VSPHERE_VER} == 60 Execute Command service vsphere-client start ELSE Execute Command service-control --start vsphere-ui
# wait until vsphere-client/ui server is up and running
Wait Until Keyword Succeeds 20x 30s Is vSphere Client Ready
Run Keyword If %{TEST_VSPHERE_VER} == 60 Log To Console vSphere Web Client has booted. ELSE Log To Console vSphere Client has booted.
Close connection
Set Up Testbed For HSUIA
${testbed-prep-args-65}= Set Variable VC_IP=%{TEST_VC_IP} VC_ADMIN_USERNAME=Administrator VC_ADMIN_DOMAIN=vsphere.local VC_ADMIN_PW=%{TEST_PASSWORD} HOST_IP=%{ESX_HOST_IP} HOST_DATASTORE_NAME=%{TEST_DATASTORE} H5C_IP=%{TEST_VC_IP} H5C_PORT=443 SELENIUM_IP=%{SELENIUM_SERVER_IP} SELENIUM_PORT=4444 BROWSER=%{SELENIUM_BROWSER} VCH_NAME=%{VCH_VM_NAME} VCH_IP=%{VCH-IP} CONTAINER_NAME=${CONTAINER_VM_TRUNCATED_NAME}
${rc} ${out}= Run And Return Rc And Output bash -c "cd ../../../ui/vic-ui-h5c/uia/h5-plugin-tests ; ${testbed-prep-args-65} ./prepare-testbed.sh"
Log To Console testbed provisioning result ::: ${rc} ${out}
Set Up Testbed Config Files
# set up common testbed provider, host provider and vicenvprovider configurations here according to the content of vicui-common.robot
${browservm}= OperatingSystem.GetFile ${NGC_TESTS_PATH}/resources/browservm.tpl.properties
${commontestbed}= OperatingSystem.GetFile ${NGC_TESTS_PATH}/resources/commonTestbedProvider.tpl.properties
${host}= OperatingSystem.GetFile ${NGC_TESTS_PATH}/resources/hostProvider.tpl.properties
${vicenv}= OperatingSystem.GetFile ${NGC_TESTS_PATH}/resources/vicEnvProvider.tpl.properties
# make original copies
Set Suite Variable ${browservm_original} ${browser_vm}
Set Suite Variable ${commontestbed_original} ${commontestbed}
Set Suite Variable ${host_original} ${host}
Set Suite Variable ${vicenv_original} ${vicenv}
# populate browservm props
${browservm}= Replace String Using Regexp ${browservm} (?<!\#)testbed\.seleniumServer=.* testbed\.seleniumServer=${SELENIUM_SERVER_IP}
${browservm}= Replace String Using Regexp ${browservm} (?<!\#)testbed\.seleniumServerPort=.* testbed\.seleniumServerPort=${SELENIUM_SERVER_PORT}
${browservm}= Replace String Using Regexp ${browservm} (?<!\#)testbed\.seleniumBrowser=.* testbed\.seleniumBrowser=*%{SELENIUM_BROWSER}
# populate common test provider props
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.datacenter=.* testbed\.datacenter=${DATACENTER_NAME}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.pass=.* testbed.pass=${TEST_VC_PASSWORD}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.host=.* testbed.host=${ESX_HOST_IP}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.name=.* testbed.name=${TEST_VC_IP}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.vsc\.url=.* testbed\.vsc\.url=https\:\/\/${TEST_VC_IP}\/vsphere-client\/
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.cluster=.* testbed\.cluster=${CLUSTER_NAME}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.endpoint=.* testbed\.endpoint=${TEST_VC_IP}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.datastore\.type=.* testbed\.datastore\.type=${DATASTORE_TYPE}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.datastore=.* testbed\.datastore=${DATASTORE_NAME}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.host\.datastore\.name=.* testbed\.host\.datastore\.name=${TEST_DATASTORE}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.datastore\.ip=.* testbed\.datastore\.ip=${DATASTORE_IP}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.host\.password=.* testbed\.host\.password=${ESX_HOST_PASSWORD}
${commontestbed}= Replace String Using Regexp ${commontestbed} (?<!\#)testbed\.user=.* testbed\.user=${TEST_VC_USERNAME}
# populate host provider props
${host}= Replace String Using Regexp ${host} (?<!\#)testbed\.endpoint=.* testbed\.endpoint=${ESX_HOST_IP}
${host}= Replace String Using Regexp ${host} (?<!\#)testbed\.local\.datastore\.name=.* testbed\.local\.datastore\.name=${TEST_DATASTORE}
${host}= Replace String Using Regexp ${host} (?<!\#)testbed\.pass=.* testbed\.pass=${ESX_HOST_PASSWORD}
# populate vicenv provider props
${vicenv}= Replace String Using Regexp ${vicenv} (?<!\#)testbed\.vc_version=.* testbed\.vc_version=${TEST_VC_VERSION}
${vicenv}= Replace String Using Regexp ${vicenv} (?<!\#)testbed\.vch_vm_name=.* testbed\.vch_vm_name=${VCH_VM_NAME}
${vicenv}= Replace String Using Regexp ${vicenv} (?<!\#)testbed\.container_vm_name=.* testbed\.container_vm_name=${CONTAINER_VM_TRUNCATED_NAME}
${vicenv}= Replace String Using Regexp ${vicenv} (?<!\#)testbed\.user=.* testbed\.user=${TEST_VC_USERNAME}
${vicenv}= Replace String Using Regexp ${vicenv} (?<!\#)testbed\.pass=.* testbed\.pass=${TEST_VC_PASSWORD}
${vicenv}= Replace String Using Regexp ${vicenv} (?<!\#)testbed\.endpoint=.* testbed\.endpoint=${TEST_VC_IP}
Create File ${NGC_TESTS_PATH}/resources/browservm.properties ${browservm}
Create File ${NGC_TESTS_PATH}/resources/commonTestbedProvider.properties ${commontestbed}
Create File ${NGC_TESTS_PATH}/resources/hostProvider.properties ${host}
Create File ${NGC_TESTS_PATH}/resources/vicEnvProvider.properties ${vicenv}
Remove Files ${NGC_TESTS_PATH}/resources/*.tpl.properties
Revert Config Files
# revert the properties files to their original template files
Remove Files ${NGC_TESTS_PATH}/resources/*.properties
Create File ${NGC_TESTS_PATH}/resources/browservm.tpl.properties ${browservm_original}
Create File ${NGC_TESTS_PATH}/resources/commonTestbedProvider.tpl.properties ${commontestbed_original}
Create File ${NGC_TESTS_PATH}/resources/hostProvider.tpl.properties ${host_original}
Create File ${NGC_TESTS_PATH}/resources/vicEnvProvider.tpl.properties ${vicenv_original}
Create And Run Test Container
Log To Console \nCreating a busybox container...
${rc}= Run And Return Rc docker %{VCH-PARAMS} pull busybox
Should Be Equal As Integers ${rc} 0
${rc} ${container_id}= Run And Return Rc And Output docker %{VCH-PARAMS} create -t busybox /bin/top
Should Be Equal As Integers ${rc} 0
${rc}= Run And Return Rc docker %{VCH-PARAMS} start ${container_id}
Should Be Equal As Integers ${rc} 0
${rc} ${container_name}= Run And Return Rc And Output docker %{VCH-PARAMS} inspect ${container_id} | jq '.[0].Name' | sed 's/[\"\/]//g'
Should Be Equal As Integers ${rc} 0
${short_container_id}= Get container shortID ${container_id}
Set Suite Variable ${CONTAINER_VM_TRUNCATED_NAME} ${container_name}-${short_container_id}
Start Ngc Tests
# run mvn test and make sure tests are successful. timeout is applied inside the custom library not here
[Timeout] NONE
Run Keyword If %{TEST_VSPHERE_VER} == 60 Log To Console Starting Flex tests... ELSE Log To Console Starting HSUIA tests...
Log To Console Selenium server is running at ${SELENIUM_SERVER_IP}
${log_file}= Set Variable ngc_tests.log
Run Keyword If %{TEST_VSPHERE_VER} == 60 Run Ngc Tests ${TEST_VC_USERNAME} ${TEST_VC_PASSWORD} ${log_file} ELSE Run HSUIA Tests ${log_file}
${output}= OperatingSystem.GetFile ${log_file}
${cond1}= Run Keyword And Return Status Should Contain ${output} BUILD SUCCESS
${cond2}= Run Keyword And Return Status Should Not Contain ${output} BUILD FAILURE
Run Keyword Unless ${cond1} and ${cond2} Move File ${log_file} FAIL-${log_file}
Log To Console checking log
Log To Console ${output}
Should Be True ${cond1} and ${cond2}
Skip Ngc Tests
Log To Console Target VC is 5.5 which is not supported by NGC automation test framework. Skipping...
Clean Up Testbed Config Files
@{files}= Run Keyword If %{TEST_VSPHERE_VER} == 60 OperatingSystem.List Directory ${NGC_TESTS_PATH}/resources *tpl.properties
${num_tpl_files}= Get Length ${files}
Run Keyword If %{TEST_VSPHERE_VER} == 60 and ${num_tpl_files} == 0 Revert Config Files

View File

@@ -0,0 +1,10 @@
Group 18 - VIC UI
=======
[Test 18-1 - VIC UI Installation](18-1-VIC-UI-Installer.md)
-
[Test 18-2 - VIC UI Uninstallation](18-2-VIC-UI-Uninstaller.md)
-
[Test 18-3 - VIC UI NGC Tests](18-3-VIC-UI-NGC-tests.md)
-

View File

@@ -0,0 +1,161 @@
# 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
import os.path
import pexpect
import time
class VicUiInstallPexpectLibrary(object):
TIMEOUT_LIMIT = 180
NGC_TESTS_TIMEOUT_LIMIT = 1800
with open('testbed-information', 'r') as f:
testbed_information = f.read().splitlines()
IS_TESTING_VSPHERE65 = 'TEST_VSPHERE_VER=65' in testbed_information[0]
INSTALLER_PATH = os.path.join(os.path.dirname(
__file__), '../../..', 'ui', 'installer', 'VCSA')
NGC_TESTS_PATH = os.path.join(os.path.dirname(__file__), '../../..', 'ui', 'vic-ui-h5c/uia/h5-plugin-tests/ui-automation/vic-uia') if IS_TESTING_VSPHERE65 else os.path.join(
os.path.dirname(__file__), '../../..', 'ui', 'vic-uia/flex-automation-test/uia/vic-uia')
def _prepare_and_spawn(self, operation, callback, flags=None):
try:
executable = os.path.join(
VicUiInstallPexpectLibrary.INSTALLER_PATH, operation + '.sh ' + (flags if flags is not None else ''))
self._f = open(operation + '.log', 'wb')
self._pchild = pexpect.spawn(
executable, cwd=VicUiInstallPexpectLibrary.INSTALLER_PATH, timeout=VicUiInstallPexpectLibrary.TIMEOUT_LIMIT)
self._pchild.logfile = self._f
callback()
self._f.close()
except IOError as e:
return 'Error: ' + e.value
def _common_prompts(
self, vcenter_ip, vcenter_user, vcenter_password,
trust_fingerprint, manual_entry):
self._pchild.expect('Enter IP to target vCenter Server: ')
self._pchild.sendline(vcenter_ip)
self._pchild.expect('Enter your vCenter Administrator Username: ')
self._pchild.sendline(vcenter_user)
self._pchild.expect('Enter your vCenter Administrator Password: ')
self._pchild.sendline(vcenter_password)
def install_fails(
self, vcenter_ip, vcenter_user, vcenter_password,
trust_fingerprint=True, manual_entry=None):
def commands():
self._common_prompts(
vcenter_ip, vcenter_user, vcenter_password, trust_fingerprint, manual_entry)
# self._pchild.interact()
idx = self._pchild.expect([
'.*Are you sure you trust the authenticity of this host (yes/no)?.*', '.*Error.*'])
if idx is 1:
self._pchild.expect(pexpect.EOF)
else:
if trust_fingerprint is True:
self._pchild.sendline('yes')
else:
self._pchild.sendline('no')
self._pchild.expect(
'.*Enter SHA-1 thumbprint of target VC:.*')
self._pchild.sendline(manual_entry)
self._pchild.expect('.*Error.*')
self._pchild.expect(pexpect.EOF)
self._prepare_and_spawn('install', commands)
def install_plugin_successfully(
self, vcenter_ip, vcenter_user, vcenter_password,
trust_fingerprint=True, manual_entry=None, force=False):
def commands():
self._common_prompts(
vcenter_ip, vcenter_user, vcenter_password, trust_fingerprint, manual_entry)
self._pchild.expect(
'.*Are you sure you trust the authenticity of this host (yes/no)?.*')
self._pchild.sendline('yes')
self._pchild.expect('.*exited successfully')
self._pchild.expect(pexpect.EOF)
if force is True:
self._prepare_and_spawn('install', commands, '--force')
else:
self._prepare_and_spawn('install', commands)
def uninstall_fails(
self, vcenter_ip, vcenter_user, vcenter_password,
trust_fingerprint=True, manual_entry=None):
def commands():
self._common_prompts(
vcenter_ip, vcenter_user, vcenter_password, trust_fingerprint, manual_entry)
# self._pchild.interact()
idx = self._pchild.expect([
'.*Are you sure you trust the authenticity of this host (yes/no)?.*', '.*Error.*'])
if idx is 1:
self._pchild.expect(pexpect.EOF)
else:
if trust_fingerprint is True:
self._pchild.sendline('yes')
else:
self._pchild.sendline('no')
self._pchild.expect(
'.*Enter SHA-1 thumbprint of target VC:.*')
self._pchild.sendline(manual_entry)
self._pchild.expect('.*Error.*')
self._pchild.expect(pexpect.EOF)
self._prepare_and_spawn('uninstall', commands)
def uninstall_vicui(
self, vcenter_ip, vcenter_user, vcenter_password,
trust_fingerprint=True, manual_entry=None):
def commands():
self._common_prompts(
vcenter_ip, vcenter_user, vcenter_password, trust_fingerprint, manual_entry)
self._pchild.expect(
'.*Are you sure you trust the authenticity of this host (yes/no)?.*')
self._pchild.sendline('yes')
self._pchild.expect(
['.*exited successfully', 'Error! Could not unregister.*'])
# self._pchild.interact()
self._pchild.expect(pexpect.EOF)
self._prepare_and_spawn('uninstall', commands)
def run_ngc_tests(self, vcenter_user, vcenter_password):
try:
self._f = open('ngc_tests.log', 'wb')
self._pchild = pexpect.spawn('mvn test -Denv.VC_ADMIN_USERNAME=' + vcenter_user + ' -Denv.VC_ADMIN_PASSWORD=' + vcenter_password,
cwd=VicUiInstallPexpectLibrary.NGC_TESTS_PATH, timeout=VicUiInstallPexpectLibrary.NGC_TESTS_TIMEOUT_LIMIT)
self._pchild.logfile = self._f
self._pchild.expect(pexpect.EOF)
self._f.close()
except IOError as e:
return 'Error: ' + e.value
def run_hsuia_tests(self):
try:
self._f = open('ngc_tests.log', 'wb')
self._pchild = pexpect.spawn('mvn clean compile exec:exec -e -Dhsuia.runlist=work/runlists/default.runlist',
cwd=VicUiInstallPexpectLibrary.NGC_TESTS_PATH, timeout=VicUiInstallPexpectLibrary.NGC_TESTS_TIMEOUT_LIMIT)
self._pchild.logfile = self._f
self._pchild.expect(pexpect.EOF)
self._f.close()
except IOError as e:
return 'Error: ' + e.value

View File

@@ -0,0 +1,267 @@
# 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 Set up testbed before running the UI tests
Resource ../../resources/Util.robot
*** Variables ***
${MACOS_SELENIUM_IP} 10.20.121.192
${UBUNTU_SELENIUM_IP} 10.20.121.145
*** Keywords ***
Check If Nimbus VMs Exist
# remove testbed-information if it exists
${ti_exists}= Run Keyword And Return Status OperatingSystem.Should Exist testbed-information
Run Keyword If ${ti_exists} Remove File testbed-information
${nimbus_machines}= Set Variable %{NIMBUS_USER}-UITEST-*
Log To Console \nFinding Nimbus machines for UI tests
Open Connection %{NIMBUS_GW}
Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${out}= Execute Command nimbus-ctl list | grep -i "${nimbus_machines}"
@{out}= Split To Lines ${out}
${out_len}= Get Length ${out}
Close connection
Run Keyword If ${out_len} == 0 Setup Testbed ELSE Load Testbed ${out}
Create File testbed-information TEST_VSPHERE_VER=%{TEST_VSPHERE_VER}\nSELENIUM_SERVER_IP=%{SELENIUM_SERVER_IP}\nTEST_ESX_NAME=%{TEST_ESX_NAME}\nESX_HOST_IP=%{ESX_HOST_IP}\nESX_HOST_PASSWORD=%{ESX_HOST_PASSWORD}\nTEST_VC_NAME=%{TEST_VC_NAME}\nTEST_VC_IP=%{TEST_VC_IP}\nTEST_URL_ARRAY=%{TEST_URL_ARRAY}\nTEST_USERNAME=%{TEST_USERNAME}\nTEST_PASSWORD=%{TEST_PASSWORD}\nTEST_DATASTORE=datastore1\nEXTERNAL_NETWORK=%{EXTERNAL_NETWORK}\nTEST_TIMEOUT=%{TEST_TIMEOUT}\nGOVC_INSECURE=%{GOVC_INSECURE}\nGOVC_USERNAME=%{GOVC_USERNAME}\nGOVC_PASSWORD=%{GOVC_PASSWORD}\nGOVC_URL=%{GOVC_URL}\n
Destroy Testbed
[Arguments] ${name}
Log To Console Destroying VM(s) ${name}
Run Keyword And Ignore Error Kill Nimbus Server %{NIMBUS_USER} %{NIMBUS_PASSWORD} ${name}
Load Testbed
[Arguments] ${list}
Log To Console Retrieving VMs information for UI testing...\n
${len}= Get Length ${list}
@{browservm-found}= Create List
@{esx-found}= Create List
@{vcsa-found}= Create List
${browservm-requested}= Run Keyword If '%{TEST_OS}' == 'Ubuntu' Set Variable BROWSERVM-UBUNTU ELSE Set Variable BROWSERVM-WINDOWS
:FOR ${vm} IN @{list}
\ @{vm_items}= Split String ${vm} :
\ ${is_esx}= Run Keyword And Return Status Should Match Regexp @{vm_items}[1] (?i)esx%{TEST_VSPHERE_VER}
\ ${is_vcsa}= Run Keyword And Return Status Should Match Regexp @{vm_items}[1] (?i)vc%{TEST_VSPHERE_VER}
\ ${is_browservm}= Run Keyword And Return Status Should Match Regexp @{vm_items}[1] (?i)${browservm-requested}
\ Run Keyword If ${is_browservm} Set Test Variable @{browservm-found} @{vm_items} ELSE IF ${is_esx} Set Test Variable @{esx-found} @{vm_items} ELSE IF ${is_vcsa} Set Test Variable @{vcsa-found} @{vm_items}
${browservm_len}= Get Length ${browservm-found}
${esx_len}= Get Length ${esx-found}
${vcsa_len}= Get Length ${vcsa-found}
Run Keyword If ${browservm_len} > 0 Extract BrowserVm Info @{browservm-found} ELSE Deploy BrowserVm
Run Keyword If (${esx_len} == 0 and ${vcsa_len} > 0) or (${esx_len} > 0 and ${vcsa_len} == 0) Run Keywords Destroy Testbed '%{NIMBUS_USER}-UITEST-VC%{TEST_VSPHERE_VER}*' AND Destroy Testbed '%{NIMBUS_USER}-UITEST-ESX%{TEST_VSPHERE_VER}*' AND Deploy Esx AND Deploy Vcsa
Run Keyword If ${esx_len} == 0 and ${vcsa_len} == 0 Run Keywords Deploy Esx AND Deploy Vcsa
Run Keyword If ${esx_len} > 0 and ${vcsa_len} > 0 Run Keywords Extract Esx Info @{esx-found} AND Extract Vcsa Info @{vcsa-found}
Extract BrowserVm Info
[Arguments] @{vm_fields}
Open Connection %{NIMBUS_GW}
Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vm_name}= Evaluate '@{vm_fields}[1]'.strip()
${out}= Execute Command NIMBUS=@{vm_fields}[0] nimbus-ctl ip ${vm_name} | grep -i ".*: %{NIMBUS_USER}-.*"
@{out}= Split String ${out} :
${vm_ip}= Evaluate '@{out}[2]'.strip()
Run Keyword If '%{TEST_OS}' == 'Mac' Set Environment Variable SELENIUM_SERVER_IP ${MACOS_SELENIUM_IP} ELSE IF '%{TEST_OS}' == 'Ubuntu' Set Environment Variable SELENIUM_SERVER_IP ${UBUNTU_SELENIUM_IP} ELSE Set Environment Variable SELENIUM_SERVER_IP ${vm_ip}
Close Connection
Extract Esx Info
[Arguments] @{vm_fields}
Open Connection %{NIMBUS_GW}
Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vm_name}= Evaluate '@{vm_fields}[1]'.strip()
${out}= Execute Command NIMBUS=@{vm_fields}[0] nimbus-ctl ip ${vm_name} | grep -i ".*: %{NIMBUS_USER}-.*"
@{out}= Split String ${out} :
${vm_ip}= Evaluate '@{out}[2]'.strip()
Set Environment Variable TEST_ESX_NAME ${vm_name}
Set Environment Variable ESX_HOST_IP ${vm_ip}
Set Environment Variable ESX_HOST_PASSWORD e2eFunctionalTest
Close Connection
Extract Vcsa Info
[Arguments] @{vm_fields}
Open Connection %{NIMBUS_GW}
Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vm_name}= Evaluate '@{vm_fields}[1]'.strip()
${out}= Execute Command NIMBUS=@{vm_fields}[0] nimbus-ctl ip ${vm_name} | grep -i ".*: %{NIMBUS_USER}-.*"
@{out}= Split String ${out} :
${vm_ip}= Evaluate '@{out}[2]'.strip()
Set Environment Variable TEST_VC_NAME ${vm_name}
Set Environment Variable TEST_VC_IP ${vm_ip}
Set Environment Variable TEST_URL_ARRAY ${vm_ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable EXTERNAL_NETWORK vm-network
Set Environment Variable TEST_TIMEOUT 30m
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 ${vm_ip}
Close Connection
Deploy BrowserVm
# deploy a browser vm
${browservm} ${browservm-ip}= Run Keyword If '%{TEST_OS}' == 'Mac' No Operation ELSE IF '%{TEST_OS}' == 'Ubuntu' No Operation ELSE Deploy Nimbus BrowserVm For NGC Testing %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Run Keyword If '%{TEST_OS}' == 'Mac' Set Environment Variable SELENIUM_SERVER_IP ${MACOS_SELENIUM_IP} ELSE IF '%{TEST_OS}' == 'Ubuntu' Set Environment Variable SELENIUM_SERVER_IP ${UBUNTU_SELENIUM_IP} ELSE Set Environment Variable SELENIUM_SERVER_IP ${browservm-ip}
Deploy Esx
# deploy an esxi server
${name}= Evaluate 'UITEST-ESX%{TEST_VSPHERE_VER}-' + str(random.randint(1000,9999)) modules=random
${buildnum}= Run Keyword If %{TEST_VSPHERE_VER} == 60 Set Variable 3620759 ELSE Set Variable 5310538
${out}= Deploy Nimbus ESXi Server Async ${name} ${buildnum}
${result}= Wait For Process ${out}
Log ${result.stdout}
Log ${result.stderr}
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${esx1-ip}= Get IP ${name}
Remove Environment Variable GOVC_PASSWORD
Remove Environment Variable GOVC_USERNAME
Set Environment Variable GOVC_INSECURE 1
Set Environment Variable GOVC_URL root:@${esx1-ip}
${out}= Run govc host.account.update -id root -password e2eFunctionalTest
Should Be Empty ${out}
Log To Console Successfully deployed %{NIMBUS_USER}-${name}. IP: ${esx1-ip}
Close Connection
Set Environment Variable TEST_ESX_NAME %{NIMBUS_USER}-${name}
Set Environment Variable ESX_HOST_IP ${esx1-ip}
Set Environment Variable ESX_HOST_PASSWORD e2eFunctionalTest
Deploy Vcsa
# deploy a vcsa
${name}= Evaluate 'UITEST-VC%{TEST_VSPHERE_VER}-' + str(random.randint(1000,9999)) modules=random
${buildnum}= Run Keyword If %{TEST_VSPHERE_VER} == 60 Set Variable 3634791 ELSE Set Variable 5318154
${out}= Deploy Nimbus vCenter Server Async ${name} --useQaNgc ${buildnum}
${result}= Wait For Process ${out}
Log ${result.stdout}
Log ${result.stderr}
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 2 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc-ip}= Get IP ${name}
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 Successfully deployed %{NIMBUS_USER}-${name}. IP: ${vc-ip}
Close Connection
# create a datacenter
Log To Console Create a datacenter on the VC
${out}= Run govc datacenter.create Datacenter
Should Be Empty ${out}
# make a cluster
Log To Console Create a cluster on the datacenter
${out}= Run govc cluster.create -dc=Datacenter Cluster
Should Be Empty ${out}
${out}= Run govc cluster.change -dc=Datacenter -drs-enabled=true /Datacenter/host/Cluster
Should Be Empty ${out}
# add the esx host to the cluster
Log To Console Add ESX host to Cluster
${out}= Run govc cluster.add -dc=Datacenter -cluster=/Datacenter/host/Cluster -username=root -password=e2eFunctionalTest -noverify=true -hostname=%{ESX_HOST_IP}
Should Contain ${out} OK
# create a distributed switch
Log To Console Create a distributed switch
${out}= Run govc dvs.create -dc=Datacenter test-ds
Should Contain ${out} OK
# make three port groups
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 network
Should Contain ${out} OK
Log To Console Add the ESXi hosts to the portgroups
${out}= Run govc dvs.add -dvs=test-ds -pnic=vmnic1 -host.ip=%{ESX_HOST_IP} %{ESX_HOST_IP}
Should Contain ${out} OK
Set Environment Variable TEST_VC_NAME %{NIMBUS_USER}-${name}
Set Environment Variable TEST_VC_IP ${vc-ip}
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 EXTERNAL_NETWORK vm-network
Set Environment Variable TEST_TIMEOUT 30m
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}
Setup Testbed
Deploy BrowserVm
Deploy Esx
Deploy Vcsa
Deploy Nimbus BrowserVm For NGC Testing
[Arguments] ${user} ${password}
# for Mac & Ubuntu this keyword will never be called
# ${os}= Run Keyword If '%{TEST_OS}' == 'Ubuntu' Set Variable UBUNTU ELSE Set Variable WINDOWS
# ${vm-template}= Run Keyword If '%{TEST_OS}' == 'Ubuntu' Set Variable hsuia-seleniumNode-ubuntu --memory 2048 ELSE Set Variable ngc-testvm-3
${os}= Set Variable WINDOWS
${vm-template}= Set Variable ngc-testvm-3
${name}= Evaluate 'UITEST-BROWSERVM-${os}-' + str(random.randint(1000,9999)) modules=random
Log To Console \nDeploying Browser VM: ${name}
Open Connection %{NIMBUS_GW}
Login ${user} ${password}
${out}= Execute Command nimbus-genericdeploy --type ${vm-template} ${name} --lease 3
# Make sure the deploy actually worked
Should Contain ${out} To manage this VM use
# Now grab the IP address and return the name and ip for later use
@{out}= Split To Lines ${out}
:FOR ${item} IN @{out}
\ ${status} ${message}= Run Keyword And Ignore Error Should Contain ${item} IP is
\ Run Keyword If '${status}' == 'PASS' Set Suite Variable ${line} ${item}
@{gotIP}= Split String ${line} ${SPACE}
${ip}= Remove String @{gotIP}[5] ,
Log To Console Successfully deployed new Browser VM - ${user}-${name}
Close connection
[Return] ${user}-${name} ${ip}
*** Test Cases ***
Check Variables
${isset_SHELL}= Run Keyword And Return Status Environment Variable Should Be Set SHELL
${isset_DRONE_SERVER}= Run Keyword And Return Status Environment Variable Should Be Set DRONE_SERVER
${isset_DRONE_TOKEN}= Run Keyword And Return Status Environment Variable Should Be Set DRONE_TOKEN
${isset_NIMBUS_USER}= Run Keyword And Return Status Environment Variable Should Be Set NIMBUS_USER
${isset_NIMBUS_PASSWORD}= Run Keyword And Return Status Environment Variable Should Be Set NIMBUS_PASSWORD
${isset_NIMBUS_GW}= Run Keyword And Return Status Environment Variable Should Be Set NIMBUS_GW
${isset_TEST_DATASTORE}= Run Keyword And Return Status Environment Variable Should Be Set TEST_DATASTORE
${isset_TEST_RESOURCE}= Run Keyword And Return Status Environment Variable Should Be Set TEST_RESOURCE
${isset_GOVC_INSECURE}= Run Keyword And Return Status Environment Variable Should Be Set GOVC_INSECURE
Log To Console \nChecking environment variables
Log To Console SHELL ${isset_SHELL}
Log To Console DRONE_SERVER ${isset_DRONE_SERVER}
Log To Console DRONE_TOKEN ${isset_DRONE_TOKEN}
Log To Console NIMBUS_USER ${isset_NIMBUS_USER}
Log To Console NIMBUS_PASSWORD ${isset_NIMBUS_PASSWORD}
Log To Console NIMBUS_GW ${isset_NIMBUS_GW}
Log To Console TEST_DATASTORE ${isset_TEST_DATASTORE}
Log To Console TEST_RESOURCE ${isset_TEST_RESOURCE}
Log To Console GOVC_INSECURE ${isset_GOVC_INSECURE}
Log To Console TEST_VSPHERE_VER %{TEST_VSPHERE_VER}
Should Be True ${isset_SHELL} and ${isset_DRONE_SERVER} and ${isset_DRONE_TOKEN} and ${isset_NIMBUS_USER} and ${isset_NIMBUS_GW} and ${isset_TEST_DATASTORE} and ${isset_TEST_RESOURCE} and ${isset_GOVC_INSECURE} and %{TEST_VSPHERE_VER}
Check Nimbus Machines
Check If Nimbus VMs Exist

View File

@@ -0,0 +1,171 @@
# 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 Common keywords used by VIC UI installation & uninstallation test suites
Resource ../../resources/Util.robot
Library VicUiInstallPexpectLibrary.py
*** Variables ***
${TEST_VC_VERSION} 6.0
${TEST_VC_ROOT_PASSWORD} vmware
${TIMEOUT} 10 minutes
${SELENIUM_SERVER_PORT} 4444
${DATACENTER_NAME} Datacenter
${CLUSTER_NAME} Cluster
${DATASTORE_TYPE} NFS
${DATASTORE_NAME} fake
${DATASTORE_IP} 1.1.1.1
${CONTAINER_VM_NAME} sharp_feynman-d39db0a231f2f639a073814c2affc03e4737d9ad361649069eb424e6c4e09b52
${TEST_OS} %{TEST_OS}
${vic_macmini_fileserver_url} https://10.20.121.192:3443/vsphere-plugins/
${vic_macmini_fileserver_thumbprint} BE:64:39:8B:BD:98:47:4D:E8:3B:2F:20:A5:21:8B:86:5F:AD:79:CE
*** Keywords ***
Set Fileserver And Thumbprint In Configs
[Arguments] ${fake}=${FALSE}
${fileserver_url}= Run Keyword If ${fake} == ${TRUE} Set Variable 256.256.256.256 ELSE Set Variable ${vic_macmini_fileserver_url}
${fileserver_thumbprint}= Run Keyword If ${fake} == ${TRUE} Set Variable ab:cd:ef ELSE Set Variable ${vic_macmini_fileserver_thumbprint}
${results}= Replace String Using Regexp ${configs} VIC_UI_HOST_URL=.* VIC_UI_HOST_URL=\"${fileserver_url}\"
${results}= Replace String Using Regexp ${results} VIC_UI_HOST_THUMBPRINT=.* VIC_UI_HOST_THUMBPRINT=\"${fileserver_thumbprint}\"
Create File ${UI_INSTALLER_PATH}/configs ${results}
Load Nimbus Testbed Env
Should Exist testbed-information
${envs}= OperatingSystem.Get File testbed-information
@{envs}= Split To Lines ${envs}
:FOR ${item} IN @{envs}
\ @{kv}= Split String ${item} =
\ Set Environment Variable @{kv}[0] @{kv}[1]
\ Set Suite Variable \$@{kv}[0] @{kv}[1]
Set Suite Variable ${TEST_VC_USERNAME} %{TEST_USERNAME}
Set Suite Variable ${TEST_VC_PASSWORD} %{TEST_PASSWORD}
Install VIC Appliance For VIC UI
[Arguments] ${vic-machine}=ui-nightly-run-bin/vic-machine-linux ${appliance-iso}=ui-nightly-run-bin/appliance.iso ${bootstrap-iso}=ui-nightly-run-bin/bootstrap.iso ${certs}=${true} ${vol}=default
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 And Ignore Error Cleanup Dangling VMs On VIC UI Test Server
Run Keyword And Ignore Error Cleanup Datastore On Test Server
Run Keyword And Ignore Error Cleanup Dangling Networks On Test Server
Run Keyword And Ignore Error Cleanup Dangling vSwitches On Test Server
# Install the VCH now
Log To Console \nInstalling VCH to test server...
${output}= Run VIC Machine Command ${vic-machine} ${appliance-iso} ${bootstrap-iso} ${certs} ${vol} ${EMPTY}
Log ${output}
Should Contain ${output} Installer completed successfully
Get Docker Params ${output} ${certs}
Log To Console Installer completed successfully: %{VCH-NAME}...
Cleanup Dangling VMs On VIC UI Test Server
${out}= Run govc ls vm
${vms}= Split To Lines ${out}
:FOR ${vm} IN @{vms}
\ ${vm}= Fetch From Right ${vm} /
\ ${build}= Split String ${vm} -
\ # Skip any VM that is not associated with integration tests
\ Continue For Loop If '@{build}[0]' != 'VCH'
\ # Skip any VM that is still running
\ ${state}= Get State Of Drone Build @{build}[1]
\ Continue For Loop If '${state}' == 'running'
\ ${uuid}= Run govc vm.info -json\=true ${vm} | jq -r '.VirtualMachines[0].Config.Uuid'
\ Log To Console Destroying dangling VCH: ${vm}
\ ${rc} ${output}= Delete VIC Machine ${vm} ../../../ui-nightly-run-bin/vic-machine-linux
Check Config And Install VCH
[Arguments] ${plugin}=noop
Run Keyword Set Absolute Script Paths
Load Nimbus Testbed Env
Set Environment Variable DOMAIN ${EMPTY}
Install VIC Appliance For VIC UI ../../../ui-nightly-run-bin/vic-machine-linux ../../../ui-nightly-run-bin/appliance.iso ../../../ui-nightly-run-bin/bootstrap.iso
Set Environment Variable VCH_VM_NAME %{VCH-NAME}
${vc_fingerprint}= Run ../../../ui-nightly-run-bin/vic-ui-linux info --user ${TEST_VC_USERNAME} --password ${TEST_VC_PASSWORD} --target ${TEST_VC_IP} --key com.vmware.vic.noop 2>&1 | grep -o "(thumbprint.*)" | awk -F= '{print $2}' | sed 's/.$//'
Set Environment Variable VC_FINGERPRINT ${vc_fingerprint}
Run Keyword If '${plugin}' == 'install' Force Install Vicui Plugin
Run Keyword If '${plugin}' == 'remove' Force Remove Vicui Plugin
Set Absolute Script Paths
${UI_INSTALLERS_ROOT}= Run pwd
${UI_INSTALLERS_ROOT}= Join Path ${UI_INSTALLERS_ROOT} ../../../ui/installer
Set Suite Variable ${UI_INSTALLER_PATH} ${UI_INSTALLERS_ROOT}/VCSA
Should Exist ${UI_INSTALLER_PATH}
${configs_content}= OperatingSystem.GetFile ${UI_INSTALLER_PATH}/configs
Set Suite Variable ${configs} ${configs_content}
Run Keyword If %{TEST_VSPHERE_VER} == 65 Set Suite Variable ${plugin_folder} plugin-packages ELSE Set Suite Variable ${plugin_folder} vsphere-client-serenity
# set exact paths for installer and uninstaller scripts
Set Script Filename INSTALLER_SCRIPT_PATH ./install
Set Script Filename UNINSTALLER_SCRIPT_PATH ./uninstall
Set Script Filename
[Arguments] ${suite_varname} ${script_name}
${SCRIPT_FILENAME}= Set Variable ${script_name}.sh
${SCRIPT_FILENAME}= Join Path ${UI_INSTALLER_PATH} ${SCRIPT_FILENAME}
Set Suite Variable \$${suite_varname} ${SCRIPT_FILENAME}
Reset Configs
# Revert the configs file back to what it was
${results}= Replace String Using Regexp ${configs} VIC_UI_HOST_URL=.* VIC_UI_HOST_URL=\"\"
${results}= Replace String Using Regexp ${results} VIC_UI_HOST_THUMBPRINT=.* VIC_UI_HOST_THUMBPRINT=\"\"
Create File ${UI_INSTALLER_PATH}/configs ${results}
Should Exist ${UI_INSTALLER_PATH}/configs
Force Install Vicui Plugin
Set Fileserver And Thumbprint In Configs
Append To File ${UI_INSTALLER_PATH}/configs BYPASS_PLUGIN_VERIFICATION=1\n
Install Plugin Successfully ${TEST_VC_IP} ${TEST_VC_USERNAME} ${TEST_VC_PASSWORD} ${TRUE} None ${TRUE}
Reset Configs
${output}= OperatingSystem.GetFile install.log
${passed}= Run Keyword And Return Status Should Contain ${output} exited successfully
Run Keyword Unless ${passed} Copy File install.log fail-force-install-vicui-plugin.log
Remove File install.log
Should Be True ${passed}
Force Remove Vicui Plugin
${rc} ${output}= Run And Return Rc And Output ../../../ui-nightly-run-bin/vic-ui-linux remove --thumbprint %{VC_FINGERPRINT} --target ${TEST_VC_IP} --user ${TEST_VC_USERNAME} --password ${TEST_VC_PASSWORD} --key com.vmware.vic.ui
${rc} ${output}= Run And Return Rc And Output ../../../ui-nightly-run-bin/vic-ui-linux remove --thumbprint %{VC_FINGERPRINT} --target ${TEST_VC_IP} --user ${TEST_VC_USERNAME} --password ${TEST_VC_PASSWORD} --key com.vmware.vic
Rename Folder
[Arguments] ${old} ${new}
Move Directory ${old} ${new}
Should Exist ${new}
Cleanup Installer Environment
# Reverts the configs file and make sure the folder containing the UI binaries has its original name that might've been left modified due to a test failure
Reset Configs
@{folders}= OperatingSystem.List Directory ${UI_INSTALLER_PATH}/.. ${plugin_folder}*
Run Keyword If ('@{folders}[0]' != '${plugin_folder}') Rename Folder ${UI_INSTALLER_PATH}/../@{folders}[0] ${UI_INSTALLER_PATH}/../${plugin_folder}
Delete VIC Machine
[Tags] secret
[Arguments] ${vch-name} ${vic-machine}=ui-nightly-run-bin/vic-machine-linux
${rc} ${output}= Run And Return Rc And Output ${vic-machine} delete --name=${vch-name} --target=%{TEST_URL}%{TEST_DATACENTER} --user=%{TEST_USERNAME} --password=%{TEST_PASSWORD} --force=true --compute-resource=%{TEST_RESOURCE} --timeout %{TEST_TIMEOUT}
[Return] ${rc} ${output}
Uninstall VCH
[Arguments] ${remove_plugin}=${FALSE}
Log To Console Gathering logs from the test server...
Gather Logs From Test Server
Log To Console Deleting the VCH appliance...
${rc} ${output}= Delete VIC Machine %{VCH-NAME} ../../../ui-nightly-run-bin/vic-machine-linux
Check Delete Success %{VCH-NAME}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Completed successfully
${output}= Run rm -f %{VCH-NAME}-*.pem
${out}= Run Keyword If '%{HOST_TYPE}' == 'ESXi' Run govc host.portgroup.remove %{VCH-NAME}-bridge
Run Keyword If ${remove_plugin} == ${TRUE} Force Remove Vicui Plugin

View File

@@ -0,0 +1,24 @@
Test 19-1 - ROBO SKU
=======
# Purpose:
To verify that VIC works properly when a VCH is installed in a remote office branch office (ROBO) version of vSphere.
# References:
1. [vSphere Remote Office and Branch Office](http://www.vmware.com/products/vsphere/remote-office-branch-office.html)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation
# Test Steps:
1. Deploy a new vCenter with stand alone hosts
2. Add the Enterprise license to the vCenter appliance
3. Assign the ROBO SKU license to each of the hosts within the vCenter
4. Install a VCH onto a particular multi-host cluster in the vCenter
5. Run a variety of docker operations on the VCH, including the regression test suite
# Expected Outcome:
* All test steps should complete without 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-19 - ROBO SKU
Resource ../../resources/Util.robot
#Suite Setup Wait Until Keyword Succeeds 10x 10m ROBO SKU Setup
#Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
ROBO SKU 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 Add ESX host to the VC
${out}= Run govc host.add -hostname=${esx1-ip} -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
${out}= Run govc host.add -hostname=${esx2-ip} -username=root -dc=ha-datacenter -password=e2eFunctionalTest -noverify=true
Should Contain ${out} OK
${out}= Run govc host.add -hostname=${esx3-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 ${esx1-ip}
Add Host To Distributed Switch ${esx2-ip}
Add Host To Distributed Switch ${esx3-ip}
Add Vsphere License %{ROBO_LICENSE}
# Assign license to each of the ESX servers
Assign Vsphere License %{ROBO_LICENSE} ${esx1-ip}
Assign Vsphere License %{ROBO_LICENSE} ${esx2-ip}
Assign Vsphere License %{ROBO_LICENSE} ${esx3-ip}
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/${esx1-ip}/Resources
Set Environment Variable TEST_TIMEOUT 30m
*** Test Cases ***
Test
Log To Console VIC does not support ROBO SKU yet, waiting on a valid license with serial support for this to work
#Log To Console \nStarting test...
#Install VIC Appliance To Test Server
#Run Regression Tests

View File

@@ -0,0 +1,61 @@
Test 19-2 - ROBO - Container VM Limit
=======
# Purpose:
To verify that the total container VM limit feature works as expected in a vSphere ROBO Advanced environment.
# References:
1. [vSphere Remote Office and Branch Office](http://www.vmware.com/products/vsphere/remote-office-branch-office.html)
2. [Limit total allowed containerVMs per VCH](https://github.com/vmware/vic/issues/7273)
3. [vic-machine inspect to report configured containerVM limit](https://github.com/vmware/vic/issues/7284)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation. This test should be executed in the following topologies and should have vSAN enabled.
* 1 vCenter host with 3 clusters, where 1 cluster has 1 ESXi host and the other 2 clusters have 3 ESXi hosts each
* 2 vCenter hosts connected with ELM, where each vCenter host has a cluster/host/datacenter topology that emulates a customer environment (exact topology TBD)
See https://confluence.eng.vmware.com/display/CNA/VIC+ROBO for more details.
# Test Steps:
1. Deploy a ROBO Advanced vCenter testbed for both environments above
2. Install a VCH on a particular cluster in vCenter with a container VM limit of `y`
3. Use vic-machine inspect to verify the set container VM limit
4. Visit the VCH Admin page and verify the container VM limit is displayed in the VCH Info section
5. Create and run `y` (long-running) containers with the VCH
6. Create another (long-running) container so as to have `y+1` total containers, but only `y` running containers
7. Attempt to run the container created in Step 6
8. Delete one of the containers created in Step 5
9. Start the container created in Step 6
10. Create (don't run) `x` (`x` < `y`) long-running containers to have a total of `y + x` containers
11. From the `y` already-running containers, assemble a list of `x` containers (using `docker ps -q` for example)
12. Concurrently start the containers in Step 10 and concurrently delete the containers in Step 11
13. Check the number of running containers with `docker ps -q`
14. Use vic-machine configure to increase the container VM limit (new limit = `z`)
15. Use vic-machine inspect to verify the new container VM limit
16. Visit the VCH Admin page and verify the container VM limit is displayed in the VCH Info section
17. Create and run more containers and verify that up to a total of `z` containers can be run
18. Use vic-machine configure to set the limit to lower than the current number of containers running
19. Attempt to run more containers
20. Delete/stop some containers so the current container VM count is lower than the set limit
21. Attempt to create/run more containers until the set limit
22. Delete the VCH
# Expected Outcome:
* Steps 1 and 2 should succeed
* Step 3's output should indicate the limit set in Step 2
* Steps 4 and 5 should succeed
* Step 6 should succeed since the container limit applies to running containers
* Step 7 should fail since the container limit applies to running containers
* Steps 8-11 should succeed
* In Step 12, depending on the order in which operations are processed, a container should fail to start if it breaches the running container limit
* In Step 13, the number of running containers should be `<= y`, the current running container limit
* Step 14 should succeed
* Step 15's output should indicate the limit set in Step 14
* Step 16 should show the new container VM limit
* Step 17 should succeed
* Step 18 should succeed - exact behavior of existing running containers is TBD
* Step 19 should fail and should receive an error upon attempting to start "surplus" container VMs (exact behavior of existing running containers TBD)
* Steps 20-22 should succeed
# Possible Problems:
None

View File

@@ -0,0 +1,43 @@
Test 19-3 - ROBO - VM Placement
=======
# Purpose:
To verify that the VM placement feature specified works as expected in a vSphere ROBO Advanced environment without DRS.
The current placement strategy is to avoid bad host selection, instead of selecting the "best" possible host.
# References:
1. [vSphere Remote Office and Branch Office](http://www.vmware.com/products/vsphere/remote-office-branch-office.html)
2. [VM Placement without DRS](https://github.com/vmware/vic/issues/7282)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation. This test should be executed in the following topologies and should have vSAN enabled.
* 1 vCenter host with 3 clusters, where 1 cluster has 1 ESXi host and the other 2 clusters have 3 ESXi hosts each
* 2 vCenter hosts connected with ELM, where each vCenter host has a cluster/host/datacenter topology that emulates a customer environment (exact topology TBD)
In addition, this test should be run in multi-ESX-host and single-ESX-host cluster topologies.
See https://confluence.eng.vmware.com/display/CNA/VIC+ROBO for more details.
# Test Steps:
1. Deploy a ROBO Advanced vCenter testbed for both environments above
2. Install a VCH on a particular cluster on vCenter - see note in [Environment](#environment)
3. Deploy containers that will consume resources predictably (e.g. the `progrium/stress` image)
4. Measure cluster metrics and gather resource consumption
5. Create and run regular containers such as `busybox`
6. Create and run enough containers to consume all available cluster resources
7. Attempt to create and run more containers
8. Delete some containers
9. Create and run a few containers
10. Delete the VCH
# Expected Outcome:
* Step 1 should succeed
* Step 2 should succeed and the VCH should be placed on a host that satisfies the license and other feature requirements
* Steps 3-4 should succeed and containers should be placed on ESX hosts in the cluster according to the criteria defined in point 2 of [References](#references)
* Step 5 should succeed and containers should be placed on ESX hosts in the cluster that have available resources according to the criteria defined in point 2 of [References](#references). In the multi-host cluster environment, the cluster resource utilization level should be as expected given containerVM sizes, cluster capacity and placement logic.
* Step 6 should succeed
* Step 7 should fail since the available resources are exhausted
* Steps 8-10 should succeed
# Possible Problems:
None

View File

@@ -0,0 +1,32 @@
Test 19-4 - ROBO License Features
=======
# Purpose:
To verify that the license and feature checks required for a ROBO Advanced environment are displayed and updated on VCH Admin.
# References:
1. [vSphere Remote Office and Branch Office](http://www.vmware.com/products/vsphere/remote-office-branch-office.html)
2. [Provide License and Feature Check](https://github.com/vmware/vic/issues/7277)
3. [vic-admin to report on license and feature compliance](https://github.com/vmware/vic/issues/7276)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation. This test should be executed in the following topologies and should have vSAN enabled.
* 1 vCenter host with 3 clusters, where 1 cluster has 1 ESXi host and the other 2 clusters have 3 ESXi hosts each
* 2 vCenter hosts connected with ELM, where each vCenter host has a cluster/host/datacenter topology that emulates a customer environment (exact topology TBD)
See https://confluence.eng.vmware.com/display/CNA/VIC+ROBO for more details.
# Test Steps:
1. Deploy a ROBO Advanced vCenter testbed for both environments above
2. Install a VCH on vCenter
3. Visit the VCH Admin page and verify that the License and Feature Status sections show that required license and features are present
4. Assign a more restrictive license such as ROBO Standard or Standard that does not have the required features (VDS, VSPC) to vCenter
5. Assign the above license to each of the hosts within the vCenter cluster
6. Refresh the VCH Admin page and verify that the License and Feature Status sections show that required license and features are not present
7. Delete the VCH
# Expected Outcome:
* All test steps should complete without error
# Possible Problems:
None

View File

@@ -0,0 +1,41 @@
Test 19-5 - ROBO vCenter Connectivity
=======
# Purpose:
To verify that the applications deployed in containerVMs in a ROBO Advanced environment are functional when the ESXi(s) hosting the containerVMs are disconnected from the vSphere host. This test exercises the WAN connectivity and resiliency support for a ROBO environment that could represent a customer's cluster topology.
# References:
1. [vSphere Remote Office and Branch Office](http://www.vmware.com/products/vsphere/remote-office-branch-office.html)
# Environment:
This test requires access to VMware Nimbus cluster for dynamic ESXi and vCenter creation. This test should be executed in the following topologies and should have vSAN enabled.
* 1 vCenter host with 3 clusters, where 1 cluster has 1 ESXi host and the other 2 clusters have 3 ESXi hosts each
* 2 vCenter hosts connected with ELM, where each vCenter host has a cluster/host/datacenter topology that emulates a customer environment (exact topology TBD)
See https://confluence.eng.vmware.com/display/CNA/VIC+ROBO for more details.
# Test Steps:
1. Deploy a ROBO Advanced vCenter testbed for both environments above
2. Deploy the VIC appliance OVA on vCenter for testing VIC Product as well
3. Once the OVA is powered on and initialized, populate Harbor with some images
4. Install a VCH on a cluster in vCenter
5. Log in to the Admiral UI
6. Add the VCH to the default project in Admiral
7. Using Admiral, deploy some containers through the VCH
8. Create and start some container services such as nginx, wordpress or a database
9. Run a multi-container application exercising network links with docker-compose
10. To simulate a WAN link outage, _abruptly_ disconnect each ESX host in the cluster from vCenter (possibly by changing firewall rules)
11. Verify that the containers/services/applications started in Steps 7-9 are still alive and responding
12. Pull an image from Harbor
13. Create/start a container
14. Re-connect all hosts in the cluster to vCenter
15. Create/start a container
16. Delete the VCH
# Expected Outcome:
* Steps 1-12 should succeed
* Step 13 should fail since the vCenter host is disconnected from the VCH's host
* Steps 14-16 should succeed
# Possible Problems:
None

View File

@@ -0,0 +1,8 @@
Group 19 - ROBO
=======
* [Test 19-1 - ROBO-SKU](19-1-ROBO-SKU.md)
* [Test 19-2 - ROBO-Container-Limit](19-2-ROBO-Container-Limit.md)
* [Test 19-3 - ROBO-VM-Placement](19-3-ROBO-VM-Placement.md)
* [Test 19-4 - ROBO-License-Features](19-4-ROBO-License-Features.md)
* [Test 19-5 - ROBO-vCenter-Connectivity](19-5-ROBO-Vcenter-Connectivity.md)

View File

@@ -0,0 +1,23 @@
Test 20-1 - Appliance OS Security Audit
======
# Purpose:
To detect known OS security issues and warnings
# References:
[1 - Lynis Reference](https://cisofy.com/documentation/lynis/#using_lynis)
# Environment:
* requires a working VCSA setup with VCH installed
* Target VCSA has Bash enabled for the root account
# Test Steps:
1. Provision lynis and its dependencies on appliance over ssh
2. run lynis audit system # More customizations can be added in future from here
3. copy lynis log and report under /var/log/ to current directory
# Expected Outcome:
* Each step should return success
# Possible Problems:
None

View File

@@ -0,0 +1,56 @@
# Copyright 2017 VMware, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
*** Settings ***
Documentation Test 20-01 - Appliance-Audit
Suite Setup Setup Test Environment
Suite Teardown Clean up VIC Appliance And Local Binary
Resource ../../resources/Util.robot
*** Keywords ***
Setup Test Environment
[Arguments] ${version}=${EMPTY}
Run Keyword If '${version}' == '${EMPTY}' Install VIC Appliance To Test Server
Run Keyword Unless '${version}' == '${EMPTY}' Install VIC with version to Test Server ${version}
Run Keyword If '${version}' == '${EMPTY}' Enable VCH SSH
Run Keyword Unless '${version}' == '${EMPTY}' Enable VCH SSH vic/vic-machine-linux
Provision lynis
[Arguments] ${target}=%{VCH-IP} ${user}=root ${password}=%{TEST_PASSWORD}
Log To Console \nProvision lynis to vch appliance...
Open Connection ${target}
Login ${user} ${password}
${output} ${rc}= Execute Command rpm --rebuilddb return_stdout=True return_rc=True
Should Be Equal As Integers ${rc} 0
${output} ${rc}= Execute Command tdnf install -y yum return_stdout=True return_rc=True
Should Be Equal As Integers ${rc} 0
${output} ${rc}= Execute Command yum install -y awk sed git return_stdout=True return_rc=True
Should Be Equal As Integers ${rc} 0
${output} ${rc}= Execute Command cd /usr/local && git clone https://github.com/CISOfy/lynis return_stdout=True return_rc=True
Should Be Equal As Integers ${rc} 0
Lynis Audit System
[Arguments] ${target}=%{VCH-IP} ${user}=root ${password}=%{TEST_PASSWORD} ${lynis_path}=/usr/local/lynis
Log To Console \nBegin auditing appliance...
Open Connection ${target}
Login ${user} ${password}
${output} ${rc}= Execute Command cd ${lynis_path} && ./lynis audit system return_stdout=True return_rc=True
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output sshpass -p '${password}' scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null ${user}@${target}:/var/log/lynis* .
Should Be Equal As Integers ${rc} 0
*** Test Cases ***
Appliance Audit
Provision lynis
Lynis Audit System

View File

@@ -0,0 +1,5 @@
Group 20 - Security
=======
[Test 20-1 - Appliance Audit](20-1-Appliance-Audit.md)
-

View File

@@ -0,0 +1,159 @@
Test 21-01 - Whitelist Registries
=======
# Purpose:
To verify that VIC appliance can whitelist registries
# Environment:
This test requires that a vSphere server is running and available
Test Case -- Basic whitelisting
=========
##Test Steps:
1. Use ovftool to deploy two harbor server, one using HTTP, the other HTTPS
2. Deploy VIC appliance to vSphere server with vic-machine and --whitelist-registry and --registry-ca options
3. Issue docker info
4. Issue docker login against the whitelist registry
5. Issue docker pull against the whitelist registry
6. Issue docker login against the whitelist registry:443
7. Issue docker pull against the whitelist registry:443
8. Issue docker login against docker.io
9. Issue docker pull against docker.io
10. Tear down VCH
##Expected Outcome:
* Step 2 has no Warning for registry and whitelist registries are listed and were confirmed
* Step 3 have docker hub for registry and whitelist registries listed
* Step 4-5 succeeds
* Step 6-7 succeeds. VCH should not care if port is added at the end of docker operation or vic-machine creation
* Step 8-9 fails and return a message containing 'Access denied to unauthorized registry'
Test Case -- Insecure Registry Login With HTTP
=========
1. Install VCH w/o specifying the insecure registry
2. Try to log in / pull with docker -- expect failure
3. Destroy the VCH
4. Install a new VCH and specify insecure registry w/ insecure HTTP
5. Try to log in / pull with docker -- expect success
6. Destroy the VCH
Test Case -- Configure Registry CA
=========
This test ensures that we can change the registry CA cert installed on the VCH
1. Install a new VCH without specifying a registry CA
2. Try to log in (should fail)
3. Use vic-machine configure --registry-ca to add the CA to the appliance
4. Try to log in & pull (should succeed)
5. Run vic-machine configure without --registry-ca to check that no change occurs in this case
6. Try to log in and pull (should succeed)
5. Tear down VCH
Test Case -- Basic whitelisting with NO certs
=========
1. Deploy VIC appliance to vSphere server with vic-machine and --whitelist-registry and NO --registry-ca options
2. Issue docker login against the whitelist registry
3. Issue docker pull against the whitelist registry
4. Tear down VCH
##Test Steps:
* Step 1 has a warning the registry cannot be confirmed
* Step 2-3 fails
##Possible Problems:
None
Test Case -- Whitelist + HTTP Insecure-registry
=========
##Test Steps:
1. Deploy VIC appliance to vSphere server with vic-machine and --registry-ca, --whitelist-registry and --insecure-registry options with NON-overlapping whitelist and insecure servers and one fake registry
2. Issue docker info
3. Issue docker login against the whitelist registry
4. Issue docker pull against the whitelist registry
5. Issue docker login against the insecure registry
6. Issue docker pull against the insecure registry
7. Issue docker login against docker.io
8. Issue docker pull against docker.io
9. Tear down VCH
##Expected Outcome:
* Step 1 has no warnings for registry, whitelist registries are listed and includes all whitelist and insecure servers
* Step 2 have docker hub, whitelist registries and have insecure registries listed
* Step 3-6 succeeds
* Step 7-8 fails and return a message containing 'Access denied to unauthorized registry'
##Possible Problems:
None
Test Case -- Whitelist + overlapping HTTP Insecure-registry with certs
=========
1. Deploy VIC appliance to vSphere server with vic-machine and --registry-ca, --whitelist-registry and --insecure-registry options with the same servers for both
2. Issue docker info
3. Issue docker login against the registry
4. Issue docker pull against a public library on the registry
5. Tear down VCH
##Expected Outcome:
* Step 1 has no warnings for registry, whitelist registries are listed, and the registry was confirmed as insecure
* Step 2 have docker hub, whitelist registries and have insecure registries listed
* Step 3-4 succeeds
##Possible Problems:
None
Test Case -- Whitelist + overlapping HTTP Insecure-registry with NO certs
=========
1. Deploy VIC appliance to vSphere server with vic-machine and --whitelist-registry and --insecure-registry options with the same servers for both
2. Issue docker login against the overlapping registry
3. Issue docker pull against a public library on the registry
4. Tear down VCH
##Expected Outcome:
* Step 1 has no warnings for registry, whitelist registries are listed, and the registry was confirmed as insecure
* Step 2-3 succeeds as insecure-registry modifies the whitelist-registry server
##Possible Problems:
None
Test Case -- Whitelist registry in CIDR format
=========
1. Deploy VIC appliance to vSphere server with vic-machine and --registry-ca, --whitelist-registry
2. Issue docker info
3. Issue docker login against the registry with IP address
4. Issue docker pull against a public library on the registry with IP address
5. Tear down VCH
##Expected Outcome:
* Step 1 have no warnings for registry, whitelist registries are listed, and a message that the registry confirmation was skipped
* Step 2 have docker hub and whitelist registries listed
* Step 3-4 succeeds
##Possible Problems:
None
Test Case -- Whitelist registry in wildcard domain format
=========
1. Deploy VIC appliance to vSphere server with vic-machine and --registry-ca, --whitelist-registry
2. Issue docker info
3. Issue docker login against the registry with IP address
4. Issue docker pull against a public library on the registry with IP address
5. Tear down VCH
##Expected Outcome:
* Step 1 have no warnings for registry, whitelist registries are listed, and a message that the registry confirmation was skipped
* Step 2 have docker hub and whitelist registries listed
* Step 3-4 succeeds
##Possible Problems:
None

View File

@@ -0,0 +1,160 @@
# 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 21-01 - Whitelist
Resource ../../resources/Util.robot
Resource ../../resources/Harbor-Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Setup Harbor
Suite Teardown Nimbus Cleanup ${list} ${false}
Test Teardown Run Keyword If Test Failed Cleanup VIC Appliance On Test Server
*** Keywords ***
Simple ESXi Setup
[Timeout] 110 minutes
${esx} ${esx-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable @{list} ${esx}
Set Environment Variable TEST_URL_ARRAY ${esx-ip}
Set Environment Variable TEST_URL ${esx-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
Setup Harbor
Simple ESXi Setup
# Install a Harbor server with HTTPS a Harbor server with HTTP
Install Harbor To Test Server protocol=https name=harbor-https
Set Environment Variable HTTPS_HARBOR_IP %{HARBOR-IP}
Install Harbor To Test Server protocol=http name=harbor-http
Set Environment Variable HTTP_HARBOR_IP %{HARBOR-IP}
Get HTTPS Harbor Certificate
Get HTTPS Harbor Certificate
[Arguments] ${HARBOR_IP}=%{HTTPS_HARBOR_IP}
# Get the certificates from the HTTPS server
${out}= Run wget --tries=10 --connect-timeout=10 --auth-no-challenge --no-check-certificate --user admin --password %{TEST_PASSWORD} https://${HARBOR_IP}/api/systeminfo/getcert
Log ${out}
Move File getcert ./ca.crt
*** Test Cases ***
Basic Whitelisting
# Install VCH with registry CA for whitelisted registry
${output}= Install VIC Appliance To Test Server vol=default --whitelist-registry=%{HTTPS_HARBOR_IP} --registry-ca=./ca.crt
Should Contain ${output} Secure registry %{HTTPS_HARBOR_IP} confirmed
Should Contain ${output} Whitelist registries =
Get Docker Params ${output} true
# Check docker info for whitelist info
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Registry Whitelist Mode: enabled
Should Contain ${output} Whitelisted Registries:
Should Contain ${output} Registry: registry.hub.docker.com
# Try to login and pull from the HTTPS whitelisted registry (should succeed)
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login -u admin -p %{TEST_PASSWORD} %{HTTPS_HARBOR_IP}
Should Contain ${output} Succeeded
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull %{HTTPS_HARBOR_IP}/library/photon:1.0
Should Be Equal As Integers ${rc} 0
# Try to login and pull from the HTTPS whitelisted registry with :443 tacked on at the end (should succeed)
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login -u admin -p %{TEST_PASSWORD} %{HTTPS_HARBOR_IP}:443
Should Contain ${output} Succeeded
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull %{HTTPS_HARBOR_IP}:443/library/photon:1.0
Should Be Equal As Integers ${rc} 0
# Try to login and pull from docker hub (should fail)
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login --username=victest --password=%{TEST_PASSWORD}
Should Be Equal As Integers ${rc} 1
Should Contain ${output} Access denied to unauthorized registry
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull victest/busybox
Should Be Equal As Integers ${rc} 1
Should Contain ${output} Access denied to unauthorized registry
Cleanup VIC Appliance On Test Server
Check Login to Insecure Registry (http)
# Install VCH w/o specifying insecure registry
${output}= Install VIC Appliance To Test Server additional-args=--registry-ca=./ca.crt
Should Not Contain ${output} Insecure registry %{HTTP_HARBOR_IP} confirmed
Get Docker Params ${output} true
# Try to login and pull from the HTTP insecure registry (should fail)
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login -u admin -p %{TEST_PASSWORD} %{HTTP_HARBOR_IP}
Should Not Contain ${output} Succeeded
Should Be Equal As Integers ${rc} 1
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull %{HTTP_HARBOR_IP}/library/photon:1.0
Should Be Equal As Integers ${rc} 1
Cleanup VIC Appliance On Test Server
${output}= Install VIC Appliance To Test Server additional-args=--insecure-registry=%{HTTP_HARBOR_IP} --registry-ca=./ca.crt
Should Contain ${output} Insecure registry %{HTTP_HARBOR_IP} confirmed
Get Docker Params ${output} true
# Try to login and pull from the HTTP insecure registry (should succeed)
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login -u admin -p %{TEST_PASSWORD} %{HTTP_HARBOR_IP}
Should Contain ${output} Succeeded
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull %{HTTP_HARBOR_IP}/library/photon:1.0
Should Be Equal As Integers ${rc} 0
Cleanup VIC Appliance On Test Server
Configure Registry CA
# Install VCH without registry CA
${output}= Install VIC Appliance To Test Server
Should Not Contain ${output} Secure registry %{HTTPS_HARBOR_IP} confirmed
# Try to login to the HTTPS registry (should fail)
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login -u admin -p %{TEST_PASSWORD} %{HTTPS_HARBOR_IP}
Should Not Contain ${output} Succeeded
# Add the HTTPS registry CA to cert pool with vic-machine configure
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux configure --target %{TEST_URL} --user %{TEST_USERNAME} --password=%{TEST_PASSWORD} --compute-resource=%{TEST_RESOURCE} --name %{VCH-NAME} --registry-ca=./ca.crt --thumbprint=%{TEST_THUMBPRINT} --debug=1
Should Be Equal As Integers ${rc} 0
# Try to login and pull from the HTTPS registry (should succeed)
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login -u admin -p %{TEST_PASSWORD} %{HTTPS_HARBOR_IP}
Should Contain ${output} Succeeded
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull %{HTTPS_HARBOR_IP}/library/photon:1.0
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output bin/vic-machine-linux configure --target %{TEST_URL} --user %{TEST_USERNAME} --password=%{TEST_PASSWORD} --compute-resource=%{TEST_RESOURCE} --name %{VCH-NAME} --thumbprint=%{TEST_THUMBPRINT} --debug=1
Log ${output}
Should Be Equal As Integers ${rc} 0
# Try to login and pull from the HTTPS registry (should succeed)
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login -u admin -p %{TEST_PASSWORD} %{HTTPS_HARBOR_IP}
Should Contain ${output} Succeeded
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull %{HTTPS_HARBOR_IP}/library/photon:1.0
Should Be Equal As Integers ${rc} 0
Cleanup VIC Appliance On Test Server

View File

@@ -0,0 +1,21 @@
Test 21-02 - Artifactory Support
=======
# Purpose:
To verify that VIC engine works properly with Artifactory
# References:
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Deploy VIC appliance to the vSphere server
2. Execute docker login to the artifactory server
3. Execute a docker pull to an image on the artifactory server
# Expected Outcome:
* Steps 1-3 should all result in success
# Possible Problems:
None

View File

@@ -0,0 +1,54 @@
# 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 21-2 - Artifactory
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Artifactory Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
Artifactory Setup
[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}
Set Suite Variable @{list} ${esx1}
Set Suite Variable ${ESX1} ${esx1}
Set Suite Variable ${ESX1_IP} ${esx1_ip}
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
*** Test Cases ***
Test
Log To Console \nStarting test...
Install VIC Appliance To Test Server additional-args=--insecure-registry=vic-docker-local.artifactory.eng.vmware.com
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} login -u vic-deployer -p vmware!123 http://vic-docker-local.artifactory.eng.vmware.com/
Should Be Equal As Integers ${rc} 0
Should Contain ${output} Login Succeeded
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} pull vic-docker-local.artifactory.eng.vmware.com/busybox:1
Should Be Equal As Integers ${rc} 0

View File

@@ -0,0 +1,7 @@
Group 21 - Registries
=======
[Test 21-1 - Whitelist](21-1-Whitelist.md)
-
[Test 21-2 - Artifactory](21-2-Artifactory.md)
-

View File

@@ -0,0 +1,22 @@
Test 23-1 - Future ESXi Install
=======
# Purpose:
To verify the VIC appliance works after more than a year of calendar time of being installed
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Install a VCH and create/run several different containers
2. Adjust the vSphere system time more than 1 year into the future
3. Verify that the VCH continues to function properly and the containers also are running
# Expected Outcome:
The VCH appliance should function properly after a year along with the containers created as well
# Possible Problems:
None

View File

@@ -0,0 +1,73 @@
# 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 23-1-Future-ESXi-Install
Resource ../../resources/Util.robot
Suite Setup Future ESXi Install Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
*** Keywords ***
Future ESXi Install Setup
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${esx} ${esx-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable @{list} ${esx}
Set Environment Variable TEST_URL_ARRAY ${esx-ip}
Set Environment Variable TEST_URL ${esx-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
Curl nginx endpoint
[Arguments] ${endpoint}
${rc} ${output}= Run And Return Rc And Output curl ${endpoint}
Should Be Equal As Integers ${rc} 0
[Return] ${output}
*** Test Cases ***
Test
Install VIC Appliance To Test Server
Run Regression Tests
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name nginx -d -p 8080:80 nginx
Log ${output}
Should Be Equal As Integers ${rc} 0
${output}= Wait Until Keyword Succeeds 10x 10s Curl nginx endpoint %{VCH-IP}:8080
Should Contain ${output} Welcome to nginx!
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name alp alpine ls
Log ${output}
Should Be Equal As Integers ${rc} 0
${cur_year}= Run date +%Y
${future}= Evaluate ${cur_year} + 2
${out}= Run govc host.esxcli system time set -d 10 -H 10 -m 18 -M 04 -y ${future}
${out}= Run govc host.esxcli hardware clock set -d 10 -H 10 -m 18 -M 04 -y ${future}
Run Regression Tests
${output}= Wait Until Keyword Succeeds 10x 10s Curl nginx endpoint %{VCH-IP}:8080
Should Contain ${output} Welcome to nginx!
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} restart alp
Log ${output}
Should Be Equal As Integers ${rc} 0

View File

@@ -0,0 +1,22 @@
Test 23-2 - Future ISO Install
=======
# Purpose:
To verify the VIC appliance install works after more than a year after the ISO was created
# References:
None
# Environment:
This test requires that a vSphere server is running and available
# Test Steps:
1. Adjust the vSphere system time more than 1 year into the future
2. Install a VCH
3. Verify that the VCH functions properly
# Expected Outcome:
The VCH appliance install should function properly after a year after ISOs were built
# 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 23-2-Future-ISO-Install
Resource ../../resources/Util.robot
Suite Setup Future ESXi Install Setup
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}
Test Teardown Reset Domain Variable
*** Keywords ***
Future ESXi Install Setup
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
${esx} ${esx-ip}= Deploy Nimbus ESXi Server %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Set Suite Variable @{list} ${esx}
Set Environment Variable TEST_URL_ARRAY ${esx-ip}
Set Environment Variable TEST_URL ${esx-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
Curl nginx endpoint
[Arguments] ${endpoint}
${rc} ${output}= Run And Return Rc And Output curl ${endpoint}
Should Be Equal As Integers ${rc} 0
[Return] ${output}
Reset Domain Variable
${status}= Run Keyword And Return Status Environment Variable Should Be Set ORIG_DOMAIN
Run Keyword If ${status} Set Environment Variable DOMAIN %{ORIG_DOMAIN}
*** Test Cases ***
Test
Set Environment Variable ORIG_DOMAIN %{DOMAIN}
Set Environment Variable DOMAIN ${EMPTY}
${cur_year}= Run date +%Y
${future}= Evaluate ${cur_year} + 2
${out}= Run govc host.esxcli system time set -d 10 -H 10 -m 18 -M 04 -y ${future}
${out}= Run govc host.esxcli hardware clock set -d 10 -H 10 -m 18 -M 04 -y ${future}
Install VIC Appliance To Test Server
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} info
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} ID: vSphere Integrated Containers

View File

@@ -0,0 +1,8 @@
Group 23 - Future Tests
=======
[Test 23-1 - Future ESXi Install](23-1-Future-ESXi-Install.md)
-
[Test 23-2 - Future ISO Install](23-2-Future-ISO-Install.md)
-

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'

Some files were not shown because too many files have changed in this diff Show More