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 @@ -16,18 +16,10 @@
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 Single VM '*5-11-multiple-cluster*'
Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup Single VM '*5-11-multiple-cluster*' ${false}
Test Teardown Cleanup VIC Appliance On Test Server

*** 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 Single VM '*5-11-multiple-cluster*' ${false}
Expand All @@ -52,9 +44,14 @@ Multiple Cluster Setup
Set Environment Variable BRIDGE_NETWORK bridge
Set Environment Variable PUBLIC_NETWORK vm-network
Remove Environment Variable TEST_DATACENTER
Set Environment Variable TEST_DATASTORE local-0
Set Environment Variable TEST_RESOURCE cls
Set Environment Variable TEST_TIMEOUT 15m
Set Environment Variable TEST_RESOURCE cls

# Get one of the hosts in the cluster we want and make sure we use the correct local datastore
${hosts}= Run govc ls -t HostSystem host/cls
@{hosts}= Split To Lines ${hosts}
${datastore}= Get Name of First Local Storage For Host @{hosts}[0]
Copy link
Contributor

@rajanashok rajanashok May 7, 2018

Choose a reason for hiding this comment

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

Understand it is always a good practice not to hard-code. But Is there a specific reason why we look for the first datastore in the list?
lgtm otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it is local storage, so it doesn't matter which one just so long as it is on the host.

Set Environment Variable TEST_DATASTORE "${datastore}"

*** Test Cases ***
Test
Expand All @@ -63,4 +60,3 @@ Test

Install VIC Appliance To Test Server certs=${false} vol=default
Run Regression Tests
Cleanup VIC Appliance On Test Server
6 changes: 6 additions & 0 deletions tests/resources/Nimbus-Util.robot
Original file line number Diff line number Diff line change
Expand Up @@ -562,3 +562,9 @@ Is Nimbus Location WDC
${status}= Run Keyword And Return Status Should Not Be Empty ${out}
Close Connection
[Return] ${status}

Get Name of First Local Storage For Host
[Arguments] ${host}
${datastores}= Run govc host.info -host ${host} -json | jq -r '.HostSystems[].Config.FileSystemVolume.MountInfo[].Volume | select (.Type\=\="VMFS") | select (.Local\=\=true) | .Name'
@{datastores}= Split To Lines ${datastores}
[Return] @{datastores}[0]