Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vic-ui robot tests #1911

Merged

Conversation

wjun
Copy link
Contributor

@wjun wjun commented Aug 7, 2018

Fixes #1771

@wjun wjun requested a review from zjs August 7, 2018 01:50
@wjun wjun self-assigned this Aug 7, 2018
@wjun wjun requested a review from a user August 7, 2018 01:51
@wjun wjun changed the title Morris jason 1771/update tests vic-ui robot tests Aug 7, 2018
@ghost
Copy link

ghost commented Aug 7, 2018

LGTM with 1 question above. Great job, Jun!


:FOR ${i} IN RANGE 10
\ ${rc} ${out}= Run And Return Rc And Output curl -k -w "\%{http_code}\\n" --header "Content-Type: application/json" -X POST --data '{"vc":{"target":"${vc}:443","user":"${vc_user}","password":"${vc_pass}","thumbprint":"${vc_thumbprint}"},"plugin":{"preset":"${plugin_preset}"}}' https://${ova_ip}:9443/plugin/${action}
\ Exit For Loop If '204' in '''${out}'''
Copy link
Member

@zjs zjs Aug 7, 2018

Choose a reason for hiding this comment

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

It seems like this (and similar lines) will match 204 appearing anywhere in the curl output (instead of just testing the HTTP status code).

You could use something like this to get the status code by itself:

${out}    ${status}=    Split String From Right    ${out}    \n    1

Then, you could check ${status} instead of ${out} (and return ${status} instead of ${out}, so keywords calling this one check the right value too).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. Refactored to get http response status.


*** Keywords ***
Uninstall OVA Setup
Wait Until Keyword Succeeds 1x 30m VIC UI OVA Setup
Copy link
Member

Choose a reason for hiding this comment

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

Why do we wait 30 minutes before retrying?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch. I removed this retry.

*** Settings ***
Documentation Test 9-1 - VIC UI Installation
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 1x 30m VIC UI OVA Setup
Copy link
Member

Choose a reason for hiding this comment

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

Why do we wait 30 minutes before retrying?

Resource ../resources/Util.robot

*** Keywords ***
Install UI Plugin
Copy link
Member

Choose a reason for hiding this comment

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

Because this performs two operations, I'm not sure we're validating what we expect in cases where one plugin installation succeeds and one fails. (E.g., tests like Attempt To Install To A Non vCenter Server should probably be verifying that both calls fail, but don't currently do so — and I don't think they can with the current structure.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. I refactored to add plugin type as a parameter.


[Return] ${out}

Deploy OVA And Install UI Plugin And Run Regression Tests
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this keyword is important functionality to test, but I don't see where it's used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw it is used in Group5 test cases.

Global Environment Setup
Set Test VC Variables

${ova-ip}= Install And Initialize VIC Product OVA vic-*.ova %{OVA_NAME}
Copy link
Member

Choose a reason for hiding this comment

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

It seems like vic-*.ova is already repeated in a few places. Perhaps it should be extracted into a variable?

Wait Until Keyword Succeeds 10x 5s Login root vmware

# extract vic bundle name
${download_url}= Run command and Return output curl -k https://${ova-ip}:9443 | tac | tac | grep -Po -m 1 '(?<=href=")[^"]*tar.gz'
Copy link
Member

Choose a reason for hiding this comment

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

tac | tac

What's the purpose of this?

@wjun
Copy link
Contributor Author

wjun commented Aug 8, 2018

Why is the TEST_THUMBPRINT using a ‘$’ instead of ‘%’
Jason, I looked at the robot log and found TEST_THUMBPRINT is defined as a robot global environment variable, but implemented as a regular variable, but not a OS environment variable, so I need to use $ to refer to it, while % is for OS environment variable.

@@ -15,29 +15,41 @@
*** Settings ***
Documentation Test 9-1 - VIC UI Installation
Resource ../../resources/Util.robot
Suite Setup Wait Until Keyword Succeeds 1x 30m VIC UI OVA Setup
Suite Setup Run Keyword VIC UI OVA Setup
Copy link
Member

Choose a reason for hiding this comment

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

With just a single keyword here, you don't need Run Keyword. You can just use:

Suite Setup    VIC UI OVA Setup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Suite Teardown Run Keyword And Ignore Error Nimbus Cleanup ${list}

*** Variables ***
${ok}= 204
${html5}= H5
${flex}= FLEX
Copy link
Member

Choose a reason for hiding this comment

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

Since these variables are only intended to be used with Install UI Plugin and Remove UI Plugin, it would probably be best to just define them once in VIC-UI-Util.robot.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@wjun wjun merged commit be522d1 into vmware:feature/auto-vic-ui-plugin Aug 16, 2018
wjun added a commit to wjun/vic-product that referenced this pull request Aug 20, 2018
* Refactor register tests to use thumbprint

tmp

* [BROKEN] Robot testing

* Refacotr UI plugin registration test cases

* Revert "Refacotr UI plugin registration test cases"

This reverts commit c17d914.

* Revert "Revert "Refacotr UI plugin registration test cases""

This reverts commit f63b61d.

* fixup! Refacotr UI plugin registration test cases

* fixup! Refacotr UI plugin registration test cases
wjun added a commit to wjun/vic-product that referenced this pull request Aug 22, 2018
wjun added a commit to wjun/vic-product that referenced this pull request Aug 22, 2018
* Refactor register tests to use thumbprint

tmp

* [BROKEN] Robot testing

* Refacotr UI plugin registration test cases

* Revert "Refacotr UI plugin registration test cases"

This reverts commit c17d914.

* Revert "Revert "Refacotr UI plugin registration test cases""

This reverts commit f63b61d.

* fixup! Refacotr UI plugin registration test cases

* fixup! Refacotr UI plugin registration test cases
zjs pushed a commit that referenced this pull request Aug 23, 2018
* Refactor register tests to use thumbprint

tmp

* [BROKEN] Robot testing

* Refacotr UI plugin registration test cases

* Revert "Refacotr UI plugin registration test cases"

This reverts commit c17d914.

* Revert "Revert "Refacotr UI plugin registration test cases""

This reverts commit f63b61d.

* fixup! Refacotr UI plugin registration test cases

* fixup! Refacotr UI plugin registration test cases
@zjs zjs mentioned this pull request Aug 23, 2018
2 tasks
wjun added a commit that referenced this pull request Aug 27, 2018
* Refactor register tests to use thumbprint

tmp

* [BROKEN] Robot testing

* Refacotr UI plugin registration test cases

* Revert "Refacotr UI plugin registration test cases"

This reverts commit c17d914.

* Revert "Revert "Refacotr UI plugin registration test cases""

This reverts commit f63b61d.

* fixup! Refacotr UI plugin registration test cases

* fixup! Refacotr UI plugin registration test cases
wjun added a commit that referenced this pull request Aug 29, 2018
* Refactor register tests to use thumbprint

tmp

* [BROKEN] Robot testing

* Refacotr UI plugin registration test cases

* Revert "Refacotr UI plugin registration test cases"

This reverts commit c17d914.

* Revert "Revert "Refacotr UI plugin registration test cases""

This reverts commit f63b61d.

* fixup! Refacotr UI plugin registration test cases

* fixup! Refacotr UI plugin registration test cases
wjun added a commit that referenced this pull request Aug 29, 2018
* Refactor register tests to use thumbprint

tmp

* [BROKEN] Robot testing

* Refacotr UI plugin registration test cases

* Revert "Refacotr UI plugin registration test cases"

This reverts commit c17d914.

* Revert "Revert "Refacotr UI plugin registration test cases""

This reverts commit f63b61d.

* fixup! Refacotr UI plugin registration test cases

* fixup! Refacotr UI plugin registration test cases
wjun added a commit that referenced this pull request Aug 30, 2018
Refactor register tests to use thumbprint
Refacotr UI plugin registration test cases
wjun added a commit that referenced this pull request Aug 30, 2018
Refactor register tests to use thumbprint
Refacotr UI plugin registration test cases
wjun added a commit that referenced this pull request Aug 30, 2018
Refactor register tests to use thumbprint
Refacotr UI plugin registration test cases
wjun added a commit that referenced this pull request Aug 30, 2018
Refactor register tests to use thumbprint
Refacotr UI plugin registration test cases
wjun added a commit that referenced this pull request Aug 31, 2018
Refactor register tests to use thumbprint
Refacotr UI plugin registration test cases
wjun added a commit that referenced this pull request Aug 31, 2018
Refactor register tests to use thumbprint
Refacotr UI plugin registration test cases
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