Skip to content

Fix bridge port group creation in test code#8223

Closed
hickeng wants to merge 2 commits intovmware:masterfrom
hickeng:bridge-fix-robot
Closed

Fix bridge port group creation in test code#8223
hickeng wants to merge 2 commits intovmware:masterfrom
hickeng:bridge-fix-robot

Conversation

@hickeng
Copy link
Contributor

@hickeng hickeng commented Aug 21, 2018

Creation of the bridge network was switching behaviour based on whether
remote system was ESX or vCenter. In the case of ESX we were overwriting
the return code with the nil values from vCenter case.

This tries an inline python fix to select the correct return code before
continuing the test.

@hickeng hickeng requested a review from a team as a code owner August 21, 2018 09:33
@zjs
Copy link
Member

zjs commented Aug 21, 2018

Alternative summary line: "Preserve rc in bridge creation robot keyword"

I prefer "Preserve rc" to "Fix" as it makes it slightly easier to tell at a glance what is being fixed.

I prefer "robot keyword" to "test code" as it makes it clearer what kind of tests are affected.

${rc} ${output}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run And Return Rc And Output govc dvs.portgroup.add -vlan=${vlan} -dvs ${dvs} VCH-%{DRONE_BUILD_NUMBER}-${vlan}
${rc2} ${output2}= Run Keyword If '%{HOST_TYPE}' == 'VC' Run And Return Rc And Output govc dvs.portgroup.add -vlan=${vlan} -dvs ${dvs} VCH-%{DRONE_BUILD_NUMBER}-${vlan}

${rc}= Evaluate ${rc} if '%{HOST_TYPE}' != 'VC' else ${rc2}
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this needs more quotes (around ${rc} and ${rc2}).

Creation of the bridge network was switching behaviour based on whether
remote system was ESX or vCenter. In the case of ESX we were overwriting
the return code with the nil values from vCenter case.

This tries an inline python fix to select the correct return code before
continuing the test.
The capitalization of the positional parameter name was incorrect and
therefore we were getting `name=value` as the string set for the
variable instead of `value`.
@hickeng
Copy link
Contributor Author

hickeng commented Aug 23, 2018

Closing in favour of #8228

@hickeng hickeng closed this Aug 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants