From abf79089a1866e16512bc00fd28a2fcbb5197c38 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Tue, 24 Apr 2018 08:04:03 -0700 Subject: [PATCH 1/4] Add ping to NFS Volume nightly tests --- .../5-22-NFS-Volume.robot | 49 ++++++++++++++++++- tests/resources/Network-Util.robot | 22 +++++++++ tests/resources/Util.robot | 1 + 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 tests/resources/Network-Util.robot diff --git a/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot b/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot index 43b7ca725e..2d0e203f8d 100644 --- a/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot +++ b/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot @@ -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 @@ -86,6 +86,9 @@ Setup ENV Variables for VIC Appliance Install Verify NFS Volume Basic Setup [Arguments] ${volumeName} ${containerName} ${nfsIP} ${rwORro} + Ping NFS Server + Ping 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} @@ -100,6 +103,9 @@ Verify NFS Volume Basic Setup Verify NFS Volume Already Created [Arguments] ${containerVolName} + Ping NFS Server + Ping 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. @@ -139,6 +145,17 @@ NFS Volume Cleanup Gather NFS Logs Nimbus Cleanup ${list} +Ping NFS Server + ${rc} ${out}= Ping Host ${NFS_READONLY_IP} + Log ${rc} + Log ${out} + +Ping VCH + ${rc} ${out}= Ping Host %{VCH-IP} + Log ${rc} + Log ${out} + + *** Test Cases *** VIC Appliance Install with Read Only NFS Volume Setup ENV Variables for VIC Appliance Install @@ -150,6 +167,9 @@ 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 + Ping NFS Server + Ping 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 @@ -174,6 +194,9 @@ VIC Appliance Install With Correct NFS Server Simple Docker Volume Create #Pull image ${busybox} + Ping NFS Server + Ping VCH + ${rc} ${volumeOutput}= Run And Return Rc And Output docker %{VCH-PARAMS} volume create --opt VolumeStore=${nfsVolumeStore} Should Be Equal As Integers ${rc} 0 @@ -182,6 +205,9 @@ Simple Docker Volume Create Verify NFS Volume Basic Setup ${nfsUnNamedVolume} ${unnamedNFSVolContainer} ${NFS_IP} rw Docker Volume Create Named Volume + Ping NFS Server + Ping 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} @@ -196,12 +222,18 @@ Docker Volume Create Already Named Volume Run Keyword And Ignore Error Verify NFS Volume Already Created ${nfsNamedVolume} Docker Volume Create with possibly Invalid Name + Ping NFS Server + Ping 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. + Ping NFS Server + Ping 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 @@ -217,6 +249,9 @@ 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 + Ping NFS Server + Ping 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 @@ -234,6 +269,9 @@ 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 + Ping NFS Server + Ping 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} @@ -276,6 +314,9 @@ Simultaneous Container Write to File Simple Docker Volume Inspect + Ping NFS Server + Ping 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 @@ -305,6 +346,9 @@ Volume rm Tests Should Contain ${output} Error response from daemon: volume ${nfsNamedVolume} in use by Docker Inspect Mount Data after Reboot + Ping NFS Server + Ping 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 @@ -321,6 +365,9 @@ Docker Inspect Mount Data after Reboot Verify Volume Inspect Info After VM Reboot ${mntDataTestContainer} ${checkList} Kill NFS Server + Ping NFS Server + Ping 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 diff --git a/tests/resources/Network-Util.robot b/tests/resources/Network-Util.robot new file mode 100644 index 0000000000..ef636787fd --- /dev/null +++ b/tests/resources/Network-Util.robot @@ -0,0 +1,22 @@ +# 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 + [Arguments] ${host} + ${rc} ${out}= Run And Return Rc And Output ping -c 4 ${host} + [Return] ${rc} ${output} diff --git a/tests/resources/Util.robot b/tests/resources/Util.robot index f4ce326fd3..c25b0d154e 100644 --- a/tests/resources/Util.robot +++ b/tests/resources/Util.robot @@ -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 From 9f824b986d90e34e6636853c0aa0b7b8d912503f Mon Sep 17 00:00:00 2001 From: mdharamadas Date: Thu, 10 May 2018 16:10:43 -0500 Subject: [PATCH 2/4] Update ping keywords --- .../5-22-NFS-Volume.robot | 50 ++++++------------- tests/resources/Network-Util.robot | 9 ++-- 2 files changed, 22 insertions(+), 37 deletions(-) diff --git a/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot b/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot index 2d0e203f8d..10ad6d70b1 100644 --- a/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot +++ b/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot @@ -86,8 +86,8 @@ Setup ENV Variables for VIC Appliance Install Verify NFS Volume Basic Setup [Arguments] ${volumeName} ${containerName} ${nfsIP} ${rwORro} - Ping NFS Server - Ping VCH + Wait Until Keyword Succeeds 20x 30s Ping Host Successfully ${NFS_READONLY_IP} + Wait Until Keyword Succeeds 20x 30s Ping Host Successfully %{VCH-IP} ${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 @@ -103,8 +103,7 @@ Verify NFS Volume Basic Setup Verify NFS Volume Already Created [Arguments] ${containerVolName} - Ping NFS Server - Ping VCH + 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 @@ -145,16 +144,9 @@ NFS Volume Cleanup Gather NFS Logs Nimbus Cleanup ${list} -Ping NFS Server - ${rc} ${out}= Ping Host ${NFS_READONLY_IP} - Log ${rc} - Log ${out} - -Ping VCH - ${rc} ${out}= Ping Host %{VCH-IP} - Log ${rc} - Log ${out} - +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 @@ -167,8 +159,7 @@ 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 - Ping NFS Server - Ping VCH + 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 @@ -194,8 +185,7 @@ VIC Appliance Install With Correct NFS Server Simple Docker Volume Create #Pull image ${busybox} - Ping NFS Server - Ping VCH + 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 @@ -205,8 +195,7 @@ Simple Docker Volume Create Verify NFS Volume Basic Setup ${nfsUnNamedVolume} ${unnamedNFSVolContainer} ${NFS_IP} rw Docker Volume Create Named Volume - Ping NFS Server - Ping VCH + 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 @@ -222,8 +211,7 @@ Docker Volume Create Already Named Volume Run Keyword And Ignore Error Verify NFS Volume Already Created ${nfsNamedVolume} Docker Volume Create with possibly Invalid Name - Ping NFS Server - Ping VCH + 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 @@ -231,8 +219,7 @@ Docker Volume Create with possibly Invalid Name Docker Single Write and Read to/from File from one Container using NFS Volume # Done with the same container for this test. - Ping NFS Server - Ping VCH + 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 @@ -249,8 +236,7 @@ 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 - Ping NFS Server - Ping VCH + 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 @@ -269,8 +255,7 @@ 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 - Ping NFS Server - Ping VCH + 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 @@ -314,8 +299,7 @@ Simultaneous Container Write to File Simple Docker Volume Inspect - Ping NFS Server - Ping VCH + 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 @@ -346,8 +330,7 @@ Volume rm Tests Should Contain ${output} Error response from daemon: volume ${nfsNamedVolume} in use by Docker Inspect Mount Data after Reboot - Ping NFS Server - Ping VCH + 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 @@ -365,8 +348,7 @@ Docker Inspect Mount Data after Reboot Verify Volume Inspect Info After VM Reboot ${mntDataTestContainer} ${checkList} Kill NFS Server - Ping NFS Server - Ping VCH + 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" diff --git a/tests/resources/Network-Util.robot b/tests/resources/Network-Util.robot index ef636787fd..62f289ee96 100644 --- a/tests/resources/Network-Util.robot +++ b/tests/resources/Network-Util.robot @@ -16,7 +16,10 @@ Documentation This resource contains any keywords related to networking *** Keywords *** -Ping Host +Ping Host Successfully [Arguments] ${host} - ${rc} ${out}= Run And Return Rc And Output ping -c 4 ${host} - [Return] ${rc} ${output} + ${rc} ${output}= Run And Return Rc And Output ping -c 4 ${host} + Log ${output} + Should Be Equal As Integers ${rc} 0 + Should Contain ${output} 4 packets transmitted, 4 received, 0% packet loss + [Return] ${output} From 380379e4d58871facf3a8dd246b5528d1f5c9eae Mon Sep 17 00:00:00 2001 From: mdharamadas Date: Thu, 10 May 2018 16:12:15 -0500 Subject: [PATCH 3/4] Update another test with ping keyword --- .../Group5-Functional-Tests/5-22-NFS-Volume.robot | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot b/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot index 10ad6d70b1..5311f66209 100644 --- a/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot +++ b/tests/manual-test-cases/Group5-Functional-Tests/5-22-NFS-Volume.robot @@ -86,8 +86,7 @@ Setup ENV Variables for VIC Appliance Install Verify NFS Volume Basic Setup [Arguments] ${volumeName} ${containerName} ${nfsIP} ${rwORro} - Wait Until Keyword Succeeds 20x 30s Ping Host Successfully ${NFS_READONLY_IP} - Wait Until Keyword Succeeds 20x 30s Ping Host Successfully %{VCH-IP} + 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 From 84f97c5b6ae008146f58e4047855d0ea2924151a Mon Sep 17 00:00:00 2001 From: mdharamadas Date: Fri, 11 May 2018 12:05:22 -0500 Subject: [PATCH 4/4] Update ping host keyword --- tests/resources/Network-Util.robot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/resources/Network-Util.robot b/tests/resources/Network-Util.robot index 62f289ee96..ad64acc0df 100644 --- a/tests/resources/Network-Util.robot +++ b/tests/resources/Network-Util.robot @@ -18,8 +18,8 @@ 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 4 ${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} 4 packets transmitted, 4 received, 0% packet loss + Should Contain ${output} 1 packets transmitted, 1 packets received, 0% packet loss [Return] ${output}