Skip to content

Commit

Permalink
Cherry-pick: Fix Get Container IP Robot util keyword (#7152) (#7182)
Browse files Browse the repository at this point in the history
  • Loading branch information
hickeng authored and mdubya66 committed Jan 29, 2018
1 parent 70b2021 commit afdab46
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/resources/Docker-Util.robot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2017 VMware, Inc. All Rights Reserved.
# 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.
Expand Down Expand Up @@ -48,7 +48,7 @@ Hit Nginx Endpoint
Should Be Equal As Integers ${rc} 0

Get Container IP
[Arguments] ${docker-params} ${id} ${network}=default ${dockercmd}=docker
[Arguments] ${docker-params} ${id} ${network}=bridge ${dockercmd}=docker
${rc} ${ip}= Run And Return Rc And Output ${dockercmd} ${docker-params} inspect --format='{{(index .NetworkSettings.Networks "${network}").IPAddress}}' ${id}
Should Be Equal As Integers ${rc} 0
[Return] ${ip}
Expand Down
5 changes: 3 additions & 2 deletions tests/test-cases/Group10-VCH-Restart/10-01-VCH-Restart.robot
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,13 @@ Created Network And Images Persists As Well As Containers Are Discovered With Co

Check Nginx Port Forwarding 10000 10001

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it -p 10000:80 -p 10001:80 --name webserver1 ${nginx}
# one of the ports collides
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it -p 10001:80 -p 10002:80 --name webserver1 ${nginx}
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} Error
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start webserver1
Should Be Equal As Integers ${rc} 1
Should Contain ${output} port 10000 is not available
Should Contain ${output} port 10001 is not available

# docker pull should work
# if this fails, very likely the default gateway on the VCH is not set
Expand Down
5 changes: 3 additions & 2 deletions tests/test-cases/Group11-Upgrade/11-01-Upgrade.robot
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ Run Docker Checks
Wait Until Keyword Succeeds 20x 5 seconds Hit Nginx Endpoint %{VCH-IP} 10000
Wait Until Keyword Succeeds 20x 5 seconds Hit Nginx Endpoint %{VCH-IP} 10001

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it -p 10000:80 -p 10001:80 --name webserver1 nginx
# one of the ports collides
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} create -it -p 10001:80 -p 10002:80 --name webserver1 ${nginx}
Should Be Equal As Integers ${rc} 0
Should Not Contain ${output} Error
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} start webserver1
Should Be Equal As Integers ${rc} 1
Should Contain ${output} port 10000 is not available
Should Contain ${output} port 10001 is not available

${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} ps -aq | xargs -n1 docker %{VCH-PARAMS} stop
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} ps -aq | xargs -n1 docker %{VCH-PARAMS} rm
Expand Down
6 changes: 3 additions & 3 deletions tests/test-cases/Group11-Upgrade/11-02-Upgrade-Exec.robot
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2016-2017 VMware, Inc. All Rights Reserved.
# 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.
Expand All @@ -21,7 +21,7 @@ Default Tags

*** Test Cases ***
Exec Not Allowed On Older Containers
Launch Container exec-test
Launch Container exec-test bridge

Upgrade
Check Upgraded Version
Expand All @@ -30,6 +30,6 @@ Exec Not Allowed On Older Containers
Should Not Be Equal As Integers ${rc} 0
Should Contain ${output} running tasks not supported for this container

Launch Container exec-test2
Launch Container exec-test2 bridge
${rc} ${output}= Run And Return Rc And Output docker %{VCH-PARAMS} exec -d exec-test2 ls
Should Be Equal As Integers ${rc} 0

0 comments on commit afdab46

Please sign in to comment.