-
Notifications
You must be signed in to change notification settings - Fork 92
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
vic-ui robot tests #1911
Conversation
LGTM with 1 question above. Great job, Jun! |
tests/resources/VIC-UI-Util.robot
Outdated
|
||
: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}''' |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
tests/resources/VIC-UI-Util.robot
Outdated
Resource ../resources/Util.robot | ||
|
||
*** Keywords *** | ||
Install UI Plugin |
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
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.
tests/resources/VIC-UI-Util.robot
Outdated
|
||
[Return] ${out} | ||
|
||
Deploy OVA And Install UI Plugin And Run Regression Tests |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
tests/resources/VIC-UI-Util.robot
Outdated
Global Environment Setup | ||
Set Test VC Variables | ||
|
||
${ova-ip}= Install And Initialize VIC Product OVA vic-*.ova %{OVA_NAME} |
There was a problem hiding this comment.
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?
tests/resources/VIC-UI-Util.robot
Outdated
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' |
There was a problem hiding this comment.
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?
|
@@ -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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
* 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
* 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
* 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
* 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
* 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
* 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
Refactor register tests to use thumbprint Refacotr UI plugin registration test cases
Refactor register tests to use thumbprint Refacotr UI plugin registration test cases
Refactor register tests to use thumbprint Refacotr UI plugin registration test cases
Refactor register tests to use thumbprint Refacotr UI plugin registration test cases
Refactor register tests to use thumbprint Refacotr UI plugin registration test cases
Refactor register tests to use thumbprint Refacotr UI plugin registration test cases
Fixes #1771