diff --git a/dts/dts-e2e.robot b/dts/dts-e2e.robot index a0e3846670..e96637efa3 100644 --- a/dts/dts-e2e.robot +++ b/dts/dts-e2e.robot @@ -969,6 +969,15 @@ E2E006.004 Odroid H4 DPP update (Coreboot + UEFI -> Coreboot + UEFI) - with cred # 4) Start update: Go Through Update +################################################################################ +# Credentials tests: +################################################################################ + +E2E007.001 QEMU Check credentials are being saved correctly +E2E007.002 QEMU Check old credentials are being overwritten by new +E2E007.003 QEMU Check wrong credentials should not allow to log into DPP services +E2E007.004 QEMU Check correct credentials should allow to log into DPP services +E2E007.005 QEMU Check empty credentials should not pass *** Keywords *** Prepare DTS Test diff --git a/lib/dts-lib.robot b/lib/dts-lib.robot index 24e38ad866..0259893ecc 100644 --- a/lib/dts-lib.robot +++ b/lib/dts-lib.robot @@ -412,3 +412,28 @@ Go Through Update Decline Heads Wait For Checkpoint And Write ${DTS_HEADS_SWITCH_QUESTION} N Wait For Checkpoint And Write ${DTS_SPECIFICATION_WARN} Y Wait For Checkpoint And Write ${DTS_DEPLOY_WARN} Y + +Check DPP Credentials In DTS + [Documentation] This KW checks whether DTS saves provided credentials + .... correctly. + [Arguments] ${dpp_email} ${dpp_password} + ${credentials}= Execute Command In Terminal cat /etc/cloud-pass + + # The /etc/cloud-pass is being created when the credential are being saved: + Should Not Contain @{credentials} No such file or directory + + ${line_count}= Get Line Count ${credentials} + IF ${line_count} != 2 + # There should be no more than 2 lines in the /etc/cloud-pass + Fail More than 2 lines in /etc/cloud-pass + END + + # The first line should be email: + ${current_email}= Get Line ${credentials} 0 + # The second line should be password: + ${current_password}= Get Line ${credentials} 1 + IF '${current_email}' != '${dpp_email}' + Fail DPP email was not saved correctly + ELSE IF '${current_password}' != '${dpp_password}' + Fail DPP password was not saved correctly + END