Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,15 @@
*** Settings ***
Documentation Test 5-26 - Static IP Address
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 10x 10m Static IP Address Create
Suite Setup Setup VC With Static IP
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}


*** Keywords ***
Static IP Address Create
[Timeout] 110 minutes
Log To Console Starting Static IP Address test...
Set Suite Variable ${NIMBUS_LOCATION} NIMBUS_LOCATION=wdc
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
Setup VC With Static IP
${name}= Evaluate 'vic-5-26-' + str(random.randint(1000,9999)) modules=random
${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --noSupportBundles --plugin testng --vcvaBuild ${VC_VERSION} --esxBuild ${ESX_VERSION} --testbedName vic-simple-cluster --testbedSpecRubyFile /dbc/pa-dbc1111/mhagen/nimbus-testbeds/testbeds/vic-simple-cluster.rb --runName ${name}

Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc-ip}= Get IP ${name}.vc.0
${pod}= Fetch POD ${name}.vc.0
Set Suite Variable ${NIMBUS_POD} ${pod}
Close Connection

Set Suite Variable @{list} %{NIMBUS_USER}-${name}.esx.0 %{NIMBUS_USER}-${name}.esx.1 %{NIMBUS_USER}-${name}.esx.2 %{NIMBUS_USER}-${name}.nfs.0 %{NIMBUS_USER}-${name}.vc.0
Log To Console Finished Creating Cluster ${name}

${out}= Get Static IP Address
Set Suite Variable ${static} ${out}
Append To List ${list} %{STATIC_WORKER_NAME}
Wait Until Keyword Succeeds 10x 10m Create Simple VC Cluster With Static IP ${name}

Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23

Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE nfs0-1
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 15m

*** Test Cases ***
Test
Log To Console \nStarting test...
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Test 5-28 - VIC Admin Isolated
=======

# Purpose:
Verify that VIC Admin can display logs on an isolated network with no wan connection.

# Environment:
This test requires that a vSphere environment be running and available, which dSwitch test-ds available.

# Test Steps:

1. Create a DVS Port Group that does not have internet connectivity by setting a random vlan id
2. Deploy VIC appliance to the vSphere server using the no-wan port group
3. Verify login functions properly
4. Verify vic admin internet connectivity status is showing a warning icon
5. Pull the VCH-Init log and verify that it contains valid data
6. Pull the Docker Personality log and verify that it contains valid data
7. Create a container via the appliance
8. Pull the container log bundle from the appliance and verify that it contains the new container's logs

# Test Cases:

## Display HTML
1. Log in
2. Page displays vic-machine name in title

## WAN Status Should Fail
1. Log in
2. Page displays warning symbols for wan connection status

## Fail To Pull Docker Image
1. Log in
2. Pull docker busybox
3. Fail to pull busybox

## Get Portlayer Log
1. Log in
2. Portlayer Log access is allowed and logs are downloaded

## Get VCH-Init Log
1. Log in
2. VCH-Init Log access is allowed and logs are downloaded

## Get Docker Personality Log
1. Log in
2. Docker Personality Log access is allowed and logs are downloaded

## Get VICAdmin Log
1. Log in
2. VICAdmin Log access is allowed and logs are downloaded
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# 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
*** Settings ***
Documentation Test 5-28 - VICAdmin Isolated
Resource ../../resources/Util.robot
Suite Setup Deploy Testbed With Static IP
Suite Teardown Teardown VCH With No WAN
Default Tags

*** Keywords ***
Deploy Testbed With Static IP
Setup VC With No WAN
Deploy VCH With No WAN

Setup VC With No WAN
${name}= Evaluate 'vic-5-28-' + str(random.randint(1000,9999)) modules=random
Wait Until Keyword Succeeds 10x 10m Create Simple VC Cluster With Static IP ${name}
Set Test Environment Variables

Log To Console Create a vch with a public network on a no-wan portgroup.

${vlan}= Evaluate str(random.randint(1, 195)) modules=random

${dvs}= Run govc find -type DistributedVirtualSwitch | head -n1
${rc} ${output}= Run And Return Rc And Output govc dvs.portgroup.add -vlan=${vlan} -dvs ${dvs} dpg-no-wan
Should Be Equal As Integers ${rc} 0

Deploy VCH With No WAN
${out}= Deploy VCH With No WAN Secret
Log ${out}
Get Docker Params ${out} ${false}

Deploy VCH With No WAN Secret
[Tags] secret
${output}= Run bin/vic-machine-linux create --debug 1 --name=%{VCH-NAME} --target=%{TEST_URL}%{TEST_DATACENTER} --thumbprint=%{TEST_THUMBPRINT} --user=%{TEST_USERNAME} --image-store=%{TEST_DATASTORE} --password=%{TEST_PASSWORD} --force=true --compute-resource=%{TEST_RESOURCE} --no-tlsverify --bridge-network=%{BRIDGE_NETWORK} --management-network=%{PUBLIC_NETWORK} --client-network=%{PUBLIC_NETWORK} --client-network-ip &{static}[ip]/&{static}[netmask] --client-network-gateway 10.0.0.0/8:&{static}[gateway] --public-network dpg-no-wan --public-network-ip 192.168.100.2/24 --public-network-gateway 192.168.100.1 --dns-server 10.170.16.48 --insecure-registry wdc-harbor-ci.eng.vmware.com
[Return] ${output}

Teardown VCH With No WAN
Run Keyword And Ignore Error Nimbus Cleanup ${list}

Login And Save Cookies
[Tags] secret
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/authentication -XPOST -F username=%{TEST_USERNAME} -F password=%{TEST_PASSWORD} -D /tmp/cookies-%{VCH-NAME}
Should Be Equal As Integers ${rc} 0

*** Test Cases ***
Display HTML
Login And Save Cookies
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN} -b /tmp/cookies-%{VCH-NAME}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Log ${output} for all of these to assist in troubleshooting

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Log ${output}
Should contain ${output} <title>VIC: %{VCH-NAME}</title>

WAN Status Should Fail
Login And Save Cookies
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN} -b /tmp/cookies-%{VCH-NAME}
Log ${output}
Should contain ${output} <div class="sixty">Registry and Internet Connectivity<span class="error-message">

Fail To Pull Docker Image
Login And Save Cookies
${rc} ${output}= Run And Return Rc and Output docker %{VCH-PARAMS} pull ${busybox}
Log ${output}
Should Be Equal As Integers ${rc} 1
Should contain ${output} no route to host

Get Portlayer Log
Login And Save Cookies
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/port-layer.log -b /tmp/cookies-%{VCH-NAME}
Log ${output}
Should contain ${output} Launching portlayer server

Get VCH-Init Log
Login And Save Cookies
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/init.log -b /tmp/cookies-%{VCH-NAME}
Log ${output}
Should contain ${output} reaping child processes

Get Docker Personality Log
Login And Save Cookies
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/docker-personality.log -b /tmp/cookies-%{VCH-NAME}
Log ${output}
Should contain ${output} docker personality

Get VICAdmin Log
Login And Save Cookies
${rc} ${output}= Run And Return Rc And Output curl -sk %{VIC-ADMIN}/logs/vicadmin.log -b /tmp/cookies-%{VCH-NAME}
Log ${output}
Should contain ${output} Launching vicadmin pprof server
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ Group 5 - Functional Tests
-
[Test 5-27 - Selenium Grid](5-27-Selenium-Grid.md)
-

[Test 5-28 - VICAdmin Isolated](5-28-VICAdmin-Isolated.md)
39 changes: 39 additions & 0 deletions tests/resources/Nimbus-Util.robot
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,45 @@ Power Off Host
${out}= Execute Command poweroff -d 0 -f
Close connection

Create Simple VC Cluster With Static IP
[Arguments] ${name}=vic-simple-vc-static-ip
[Timeout] 110 minutes
Set Suite Variable ${NIMBUS_LOCATION} NIMBUS_LOCATION=wdc
Run Keyword And Ignore Error Nimbus Cleanup ${list} ${false}
Log To Console Create a new simple vc cluser with static ip support...
${out}= Deploy Nimbus Testbed %{NIMBUS_USER} %{NIMBUS_PASSWORD} --noSupportBundles --plugin testng --vcvaBuild ${VC_VERSION} --esxBuild ${ESX_VERSION} --testbedName vic-simple-cluster --testbedSpecRubyFile /dbc/pa-dbc1111/mhagen/nimbus-testbeds/testbeds/vic-simple-cluster.rb --runName ${name}
Log ${out}

Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
${vc-ip}= Get IP ${name}.vc.0
${pod}= Fetch POD ${name}.vc.0
Set Suite Variable ${NIMBUS_POD} ${pod}
Close Connection

Set Suite Variable @{list} %{NIMBUS_USER}-${name}.esx.0 %{NIMBUS_USER}-${name}.esx.1 %{NIMBUS_USER}-${name}.esx.2 %{NIMBUS_USER}-${name}.nfs.0 %{NIMBUS_USER}-${name}.vc.0
Log To Console Finished Creating Cluster ${name}

${out}= Get Static IP Address
Set Suite Variable ${static} ${out}
Append To List ${list} %{STATIC_WORKER_NAME}

Log To Console Set environment variables up for GOVC
Set Environment Variable GOVC_URL ${vc-ip}
Set Environment Variable GOVC_USERNAME Administrator@vsphere.local
Set Environment Variable GOVC_PASSWORD Admin\!23

Log To Console Deploy VIC to the VC cluster
Set Environment Variable TEST_URL_ARRAY ${vc-ip}
Set Environment Variable TEST_USERNAME Administrator@vsphere.local
Set Environment Variable TEST_PASSWORD Admin\!23
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE nfs0-1
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 15m

Create Static IP Worker
Open Connection %{NIMBUS_GW}
Wait Until Keyword Succeeds 10 min 30 sec Login %{NIMBUS_USER} %{NIMBUS_PASSWORD}
Expand Down