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 @@ -60,7 +60,7 @@ Setup ESX And NFS Suite
${out}= Execute Command rpcdebug -m rpc -s all
${out}= Execute Command service rpcbind restart
Close Connection

Open Connection ${NFS_READONLY_IP}
Wait Until Keyword Succeeds 2 min 30 sec Login root ${strippedPW}
${out}= Execute Command rpcdebug -m nfsd -s all
Expand All @@ -86,6 +86,8 @@ Setup ENV Variables for VIC Appliance Install
Verify NFS Volume Basic Setup
[Arguments] ${volumeName} ${containerName} ${nfsIP} ${rwORro}

Wait For NFS And VCH

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name ${containerName} -v ${volumeName}:/mydata ${busybox} mount
Should Be Equal As Integers ${rc} 0
Should Contain ${output} ${nfsIP}:/store/volumes/${volumeName}
Expand All @@ -100,6 +102,8 @@ Verify NFS Volume Basic Setup

Verify NFS Volume Already Created
[Arguments] ${containerVolName}
Wait For NFS And VCH

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name=${containerVolName} --opt VolumeStore=${nfsVolumeStore}
Should Be Equal As Integers ${rc} 1
Should Contain ${output} Error response from daemon: A volume named ${containerVolName} already exists. Choose a different volume name.
Expand Down Expand Up @@ -139,6 +143,10 @@ NFS Volume Cleanup
Gather NFS Logs
Nimbus Cleanup ${list}

Wait For NFS And VCH
Wait Until Keyword Succeeds 20x 30s Ping Host Successfully ${NFS_READONLY_IP}
Wait Until Keyword Succeeds 20x 30s Ping Host Successfully %{VCH-IP}

*** Test Cases ***
VIC Appliance Install with Read Only NFS Volume
Setup ENV Variables for VIC Appliance Install
Expand All @@ -150,6 +158,8 @@ VIC Appliance Install with Read Only NFS Volume
Should Contain ${output} VolumeStore (${nfsReadOnlyVolumeStore}) cannot be brought online - check network, nfs server, and --volume-store configurations
Should Contain ${output} Not all configured volume stores are online - check port layer log via vicadmin

Wait For NFS And VCH

${rc} ${volumeOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --opt VolumeStore=${nfsReadOnlyVolumeStore}
Should Be Equal As Integers ${rc} 1
Should Contain ${volumeOutput} Error response from daemon: No volume store named (${nfsReadOnlyVolumeStore}) exists
Expand All @@ -174,6 +184,8 @@ VIC Appliance Install With Correct NFS Server
Simple Docker Volume Create
#Pull image ${busybox}

Wait For NFS And VCH

${rc} ${volumeOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --opt VolumeStore=${nfsVolumeStore}
Should Be Equal As Integers ${rc} 0

Expand All @@ -182,6 +194,8 @@ Simple Docker Volume Create
Verify NFS Volume Basic Setup ${nfsUnNamedVolume} ${unnamedNFSVolContainer} ${NFS_IP} rw

Docker Volume Create Named Volume
Wait For NFS And VCH

${rc} ${volumeOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name nfs-volume_%{VCH-NAME} --opt VolumeStore=${nfsVolumeStore}
Should Be Equal As Integers ${rc} 0
Should Be Equal As Strings ${volumeOutput} nfs-volume_%{VCH-NAME}
Expand All @@ -196,12 +210,16 @@ Docker Volume Create Already Named Volume
Run Keyword And Ignore Error Verify NFS Volume Already Created ${nfsNamedVolume}

Docker Volume Create with possibly Invalid Name
Wait For NFS And VCH

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --name="test!@\#$%^&*()" --opt VolumeStore=${nfsVolumeStore}
Should Be Equal As Integers ${rc} 1
Should Be Equal As Strings ${output} Error response from daemon: volume name "test!@\#$%^&*()" includes invalid characters, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed

Docker Single Write and Read to/from File from one Container using NFS Volume
# Done with the same container for this test.
Wait For NFS And VCH

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run --name ${createFileContainer} -d -v ${nfsNamedVolume}:/mydata ${busybox} /bin/top -d 600
Should Be Equal As Integers ${rc} 0

Expand All @@ -217,6 +235,8 @@ Docker Single Write and Read to/from File from one Container using NFS Volume
Should Contain ${output} The Texas and Chile flag look similar.

Docker Multiple Writes from Multiple Containers (one at a time) and Read from Another
Wait For NFS And VCH

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} run -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "echo 'The Chad and Romania flag look the same.\n' >> /mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0

Expand All @@ -234,6 +254,8 @@ Docker Multiple Writes from Multiple Containers (one at a time) and Read from An
Should Contain ${output} Norway and Iceland have flags that are basically inverses of each other.

Docker Read and Remove File
Wait For NFS And VCH

${rc} ${catID}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "cat mydata/test_nfs_file.txt"
Should Be Equal As Integers ${rc} 0
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} logs ${catID}
Expand Down Expand Up @@ -276,6 +298,8 @@ Simultaneous Container Write to File


Simple Docker Volume Inspect
Wait For NFS And VCH

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} volume inspect ${nfsNamedVolume}
Should Be Equal As Integers ${rc} 0
${output}= Evaluate json.loads(r'''${output}''') json
Expand Down Expand Up @@ -305,6 +329,8 @@ Volume rm Tests
Should Contain ${output} Error response from daemon: volume ${nfsNamedVolume} in use by

Docker Inspect Mount Data after Reboot
Wait For NFS And VCH

${rc} ${container}= Run And Return Rc And Output docker %{VCH-PARAMS} create --name ${mntDataTestContainer} -v ${mntTest} -v ${nfsNamedVolume}:${mntNamed} ${busybox}
Should Be Equal As Integers ${rc} 0

Expand All @@ -321,6 +347,8 @@ Docker Inspect Mount Data after Reboot
Verify Volume Inspect Info After VM Reboot ${mntDataTestContainer} ${checkList}

Kill NFS Server
Wait For NFS And VCH

Sleep 5 minutes
${rc} ${runningContainer}= Run And Return Rc And Output docker %{VCH-PARAMS} run -d -v ${nfsNamedVolume}:/mydata ${busybox} sh -c "while true; do echo 'Still here...\n' >> /mydata/test_nfs_kill.txt; sleep 2; done"
Should Be Equal As Integers ${rc} 0
Expand Down
25 changes: 25 additions & 0 deletions tests/resources/Network-Util.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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 This resource contains any keywords related to networking

*** Keywords ***
Ping Host Successfully
[Arguments] ${host}
${rc} ${output}= Run And Return Rc And Output ping -c 1 ${host}
Log ${output}
Should Be Equal As Integers ${rc} 0
Should Contain ${output} 1 packets transmitted, 1 packets received, 0% packet loss
[Return] ${output}
1 change: 1 addition & 0 deletions tests/resources/Util.robot
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Resource Admiral-Util.robot
Resource OVA-Util.robot
Resource Cert-Util.robot
Resource Slack-Util.robot
Resource Network-Util.robot
Resource nimbus-testbeds/ELM-DRS-Disabled.robot

Variables dynamic-vars.py