-
-
Notifications
You must be signed in to change notification settings - Fork 6
dts: dts-e2e.robot: add credentials test cases #949
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ba42d6d
dts: dts-e2e.robot: add credentials test cases
DaniilKl 60da4ab
lib: terminal: add 'Execute Command In Terminal And Return RC'
m-iwanicki f20e6a5
dts-lib: wait for checkpoint before writing DPP credentials
m-iwanicki 52cfe9e
dts-e2e: refactor code a little. Enable sshd in test setup
m-iwanicki fbfc7a3
dts-e2e: add credentials and UI footer tests
m-iwanicki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,265 @@ E2E003.002 DCR UEFI Update On Msi-pro-z690-a-wifi-ddr4 With 13th Gen CPU Should | |
... msi-pro-z690-a-wifi-ddr4 with 13gen CPU. | ||
Perform DCR UEFI Update On Incompatible CPU Regression Test msi-pro-z690-a-wifi-ddr4 | ||
|
||
################################################################################ | ||
# Credentials tests: | ||
################################################################################ | ||
|
||
E2E007.001 Check credentials are being saved correctly | ||
[Documentation] Check that credentials are saved to /etc/cloud-pass and | ||
... to mc correctly | ||
Clean Up DTS Environment | ||
Execute Command In Terminal export DTS_TESTING="true" | ||
Write Into Terminal dts-boot | ||
|
||
Provide DPP Credentials | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Enter Shell In DTS | ||
${creds}= Execute Command In Terminal cat /etc/cloud-pass | ||
@{lines}= Split To Lines ${creds} | ||
${line_num}= Get Length ${lines} | ||
Should Be Equal As Integers ${line_num} 2 cloud-pass file should have only 2 lines | ||
IF "${lines}[0]" != "${DPP_EMAIL}" or "${lines}[1]" != "${DPP_PASSWORD}" | ||
Fail E-mail or password is different from expected | ||
END | ||
${creds2}= Execute Command In Terminal mc alias ls premium | grep "Key" | awk '{print $3}' | ||
Should Be Equal ${creds} ${creds2} | ||
... /etc/cloud-pass and mc credentials differ | ||
|
||
E2E007.002 Check old credentials are being overwritten by new | ||
[Documentation] Make sure that entering new credentials results in old | ||
... being overwritten. Requires 2 sets of working credentials as mc | ||
... doesn't save credentials that do not work. | ||
Depends On Variable \${DPP_EMAIL_FW_ONLY} | ||
Depends On Variable \${DPP_PASSWORD_FW_ONLY} | ||
Clean Up DTS Environment | ||
Execute Command In Terminal export DTS_TESTING="true" | ||
Write Into Terminal dts-boot | ||
|
||
Provide DPP Credentials | ||
VAR ${DPP_EMAIL}= ${DPP_EMAIL_FW_ONLY} scope=TEST | ||
VAR ${DPP_PASSWORD}= ${DPP_PASSWORD_FW_ONLY} scope=TEST | ||
Provide DPP Credentials | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Enter Shell In DTS | ||
|
||
${creds}= Execute Command In Terminal cat /etc/cloud-pass | ||
@{lines}= Split To Lines ${creds} | ||
${line_num}= Get Length ${lines} | ||
Should Be Equal As Integers ${line_num} 2 cloud-pass file should have only 2 lines | ||
IF "${lines}[0]" != "${DPP_EMAIL_FW_ONLY}" or "${lines}[1]" != "${DPP_PASSWORD_FW_ONLY}" | ||
Fail E-mail or password is different from expected | ||
END | ||
${creds2}= Execute Command In Terminal mc alias ls premium | grep "Key" | awk '{print $3}' | ||
Should Be Equal ${creds} ${creds2} | ||
... /etc/cloud-pass and mc credentials differ | ||
|
||
E2E007.003 Check wrong credentials should not allow to log into DPP services | ||
[Documentation] Entering wrong credentials shouldn't allow access to DPP | ||
... services and shouldn't be saved | ||
Clean Up DTS Environment | ||
Execute Command In Terminal export DTS_TESTING="true" | ||
Write Into Terminal dts-boot | ||
|
||
VAR ${DPP_EMAIL}= [email protected] scope=TEST | ||
VAR ${DPP_PASSWORD}= test-password scope=TEST | ||
${out}= Provide DPP Credentials | ||
Should Contain ${out} Cannot log in to DPP server. | ||
Should Not Contain ${out} Dasharo DPP credentials have been saved | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Enter Shell In DTS | ||
${creds}= Execute Command In Terminal cat /etc/cloud-pass | ||
Should Not Contain Any ${creds} ${DPP_EMAIL} ${DPP_PASSWORD} | ||
${creds2}= Execute Command In Terminal | ||
... mc alias ls premium | grep "Key" | awk '{print $3}' | ||
Should Not Contain Any ${creds2} ${DPP_EMAIL} ${DPP_PASSWORD} | ||
|
||
E2E007.004 Check correct credentials should allow to log into DPP services | ||
[Documentation] Entering correct credentials should allow access to DPP | ||
... services | ||
Clean Up DTS Environment | ||
# We need to simulate supported platform | ||
Export Shell Variables For Emulation | ||
... UEFI Update | ||
... DPP | ||
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus] | ||
... ${DTS_CONFIG_REF} | ||
Write Into Terminal dts-boot | ||
|
||
${out}= Provide DPP Credentials | ||
Should Contain ${out} Dasharo Pro Package (DPP): YES | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Enter Shell In DTS | ||
${rc}= Execute Command In Terminal And Return RC mc ls premium | ||
Should Be Equal As Integers ${rc} 0 | ||
... mc command failed to list buckets | ||
|
||
E2E007.005 Check empty e-mail should not pass | ||
[Documentation] Entering empty e-mail shouldn't be allowed | ||
Clean Up DTS Environment | ||
Write Into Terminal dts-boot | ||
${out}= Read From Terminal Until ${DTS_CHECKPOINT} | ||
Write Bare Into Terminal ${DTS_CREDENTIALS_OPT} | ||
Wait For Checkpoint And Press Enter ${DPP_EMAIL_CHECKPOINT} | ||
Set DUT Response Timeout 15s | ||
Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT} | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Enter Shell In DTS | ||
${lines}= Execute Command In Terminal | ||
... cat /etc/cloud-pass 2>/dev/null | wc -l | ||
Should Be Equal As Integers ${lines} 0 cloud-pass shouldn't exist or at least be empty | ||
|
||
E2E007.006 Check empty password should not pass | ||
[Documentation] Entering empty password shouldn't be allowed | ||
Clean Up DTS Environment | ||
Write Into Terminal dts-boot | ||
${out}= Read From Terminal Until ${DTS_CHECKPOINT} | ||
Write Bare Into Terminal ${DTS_CREDENTIALS_OPT} | ||
Wait For Checkpoint And Write ${DPP_EMAIL_CHECKPOINT} ${DPP_EMAIL} | ||
Wait For Checkpoint And Press Enter ${DPP_PASSWORD_CHECKPOINT} | ||
${out}= Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT} | ||
Should Not Contain ${out} Dasharo Pro Package (DPP): | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Enter Shell In DTS | ||
${lines}= Execute Command In Terminal | ||
... cat /etc/cloud-pass 2>/dev/null | wc -l | ||
Should Be Equal As Integers ${lines} 0 cloud-pass shouldn't exist or at least be empty | ||
|
||
E2E007.008 Check DPP credentials with access to only firmware | ||
[Documentation] Those credentials should allow access only to DPP | ||
... firmware | ||
Depends On Variable \${DPP_EMAIL_FW_ONLY} | ||
Depends On Variable \${DPP_PASSWORD_FW_ONLY} | ||
Clean Up DTS Environment | ||
Export Shell Variables For Emulation | ||
... UEFI Update | ||
... DPP | ||
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus] | ||
... ${DTS_CONFIG_REF} | ||
Write Into Terminal dts-boot | ||
|
||
VAR ${DPP_EMAIL}= ${DPP_EMAIL_FW_ONLY} scope=TEST | ||
VAR ${DPP_PASSWORD}= ${DPP_PASSWORD_FW_ONLY} scope=TEST | ||
${out}= Provide DPP Credentials | ||
Should Contain ${out} Dasharo Pro Package (DPP): YES | ||
Should Contain ${out} DTS Extensions: NO | ||
|
||
E2E007.009 Check DPP credentials with access to only extensions | ||
[Documentation] Those credentials should allow access only to DTS | ||
... extensions | ||
Depends On Variable \${DPP_EMAIL_EXTENSIONS_ONLY} | ||
Depends On Variable \${DPP_PASSWORD_EXTENSIONS_ONLY} | ||
Clean Up DTS Environment | ||
Export Shell Variables For Emulation | ||
... UEFI Update | ||
... DPP | ||
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus] | ||
... ${DTS_CONFIG_REF} | ||
Write Into Terminal dts-boot | ||
|
||
VAR ${DPP_EMAIL}= ${DPP_EMAIL_EXTENSIONS_ONLY} scope=TEST | ||
VAR ${DPP_PASSWORD}= ${DPP_PASSWORD_EXTENSIONS_ONLY} scope=TEST | ||
${out}= Provide DPP Credentials | ||
Should Contain ${out} Dasharo Pro Package (DPP): NO | ||
Should Contain ${out} DTS Extensions: YES | ||
|
||
E2E007.010 Check DPP credentials without DPP access | ||
[Documentation] Those credentials shouldn't allow access to any firmware | ||
... or DTS extensions | ||
Depends On Variable \${DPP_EMAIL_NO_ACCESS} | ||
Depends On Variable \${DPP_PASSWORD_NO_ACCESS} | ||
Clean Up DTS Environment | ||
Export Shell Variables For Emulation | ||
... UEFI Update | ||
... DPP | ||
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus] | ||
... ${DTS_CONFIG_REF} | ||
Write Into Terminal dts-boot | ||
|
||
VAR ${DPP_EMAIL}= ${DPP_EMAIL_NO_ACCESS} scope=TEST | ||
VAR ${DPP_PASSWORD}= ${DPP_PASSWORD_NO_ACCESS} scope=TEST | ||
${out}= Provide DPP Credentials | ||
Should Contain ${out} Something may be wrong with the DPP credentials | ||
${out}= Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT} | ||
Should Contain ${out} Dasharo Pro Package (DPP): NO | ||
Should Contain ${out} DTS Extensions: NO | ||
|
||
E2E007.011 Check DPP credentials with both DPP firmware and DTS extensions access | ||
[Documentation] Those credentials should allow access to both DPP | ||
... firmware and DTS extensions | ||
Clean Up DTS Environment | ||
Export Shell Variables For Emulation | ||
... UEFI Update | ||
... DPP | ||
... ${DTS_PLATFORM_VARIABLES}[odroid-h4-plus] | ||
... ${DTS_CONFIG_REF} | ||
Write Into Terminal dts-boot | ||
|
||
${out}= Provide DPP Credentials | ||
Should Contain ${out} Dasharo Pro Package (DPP): YES | ||
Should Contain ${out} DTS Extensions: YES | ||
|
||
E2E008.001 Reboot UI Option Calls Reboot Command | ||
[Documentation] Reboot (R) UI option should call mocked reboot command | ||
Clean Up DTS Environment | ||
Execute Command In Terminal export DTS_TESTING="true" | ||
Write Into Terminal dts-boot | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Write Bare Into Terminal R | ||
Wait For Checkpoint common_mock: using reboot | ||
|
||
E2E008.002 Poweroff UI Option Calls Poweroff Command | ||
[Documentation] Poweroff (P) UI option should call mocked poweroff | ||
Clean Up DTS Environment | ||
Execute Command In Terminal export DTS_TESTING="true" | ||
Write Into Terminal dts-boot | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Write Bare Into Terminal P | ||
Wait For Checkpoint common_mock: using poweroff | ||
|
||
E2E008.003 Launch SSH Server UI Option Enables SSH Server Command | ||
[Documentation] Launch SSH Server (K) UI option should start sshd server | ||
Clean Up DTS Environment | ||
Execute Command In Terminal export DTS_TESTING="true" | ||
Execute Command In Terminal systemctl stop sshd | ||
Write Into Terminal dts-boot | ||
${out}= Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Should Not Contain ${out} SSH status: ON | ||
Write Bare Into Terminal K | ||
${out}= Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT} | ||
Should Contain All ${out} Starting SSH server! Listening on IPs | ||
${out}= Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Should Contain ${out} SSH status: ON | ||
|
||
E2E008.004 Enable Sending Logs UI Option Should Enable DTS Log Sending | ||
[Documentation] Enable Sending DTS Logs (L) should enable automatic log | ||
... sending e.g. when entering shell | ||
Clean Up DTS Environment | ||
Execute Command In Terminal export DTS_TESTING="true" | ||
Write Into Terminal dts-boot | ||
${out}= Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Should Contain ${out} L to enable | ||
Write Bare Into Terminal L | ||
${out}= Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Should Contain ${out} L to disable | ||
Write Bare Into Terminal S | ||
SSHLibrary.Read Until Sending logs... | ||
|
||
E2E009.001 DTS extensions are installed and can be used | ||
[Documentation] Test that DTS extensions are installed after entering DPP | ||
... keys with access to them and that they can be used after. | ||
Clean Up DTS Environment | ||
Execute Command In Terminal export DTS_TESTING="true" | ||
Write Into Terminal dts-boot | ||
|
||
${out}= Provide DPP Credentials | ||
Should Contain ${out} | ||
... Package txeconfigtool-git-r0.core2_64.rpm have been installed successfully! | ||
Wait For Checkpoint ${DTS_CHECKPOINT} | ||
Enter Shell In DTS | ||
${rc}= Execute Command In Terminal And Return RC command -V txeconfigtool | ||
Should Be Equal As Integers ${rc} 0 txeconfigtool can't be found | ||
|
||
|
||
*** Keywords *** | ||
# robocop: disable:0919 | ||
|
@@ -176,13 +435,19 @@ Prepare E2E Test | |
# TODO: needed by 'Go Through Initial Deployment' keyword for couple of | ||
# NovaCustom boards | ||
VAR ${DTS_TEST_BOARD_MODEL}= ${DTS_PLATFORM_VARIABLES}[${platform}][DTS_TEST_BOARD_MODEL] scope=TEST | ||
Clean Up DTS Environment | ||
Write Into Terminal dts-boot | ||
|
||
Clean Up DTS Environment | ||
[Documentation] Remove and clean up everything that might affect tests. | ||
... Should be run in DTS shell | ||
Execute Command In Terminal | ||
... rm -rf /etc/cloud-pass /root/.mc /*.tar.gz /root/*.tar.gz /tmp/logs/*profile /tmp/dts-temp-files | ||
Write Into Terminal dts-boot | ||
|
||
Prepare DTS Test | ||
[Documentation] Used as test setup. Starts new SSH session so we start | ||
... with clean shell environment for each test | ||
Execute Command In Terminal systemctl start sshd | ||
Start New DTS SSH Session In QEMU | ||
|
||
Teardown Template E2E DTS Test | ||
|
@@ -259,7 +524,6 @@ Prepare DTS E2E Test Suite | |
VAR ${DEVICE_OS_PASSWORD}= ${EMPTY} scope=SUITE | ||
Power On And Enter DTS Shell | ||
Set Prompt For Terminal bash-5.2# | ||
Execute Command In Terminal systemctl start sshd | ||
|
||
Perform DCR Initial Deployment On Incompatible CPU Regression Test | ||
[Documentation] Given a board with DCR-incompatible CPU, expect an error | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.