From a8be2be49cbc43702a33ad866b88f0ee69ec5b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Thu, 14 Nov 2024 18:35:00 +0100 Subject: [PATCH 1/7] dts-compatibility: dasharo-tools-suite: add Dasharo update via USB & iPXE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Iwanicki --- .../dasharo-tools-suite.robot | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/dasharo-compatibility/dasharo-tools-suite.robot b/dasharo-compatibility/dasharo-tools-suite.robot index 1a009d73e..86c7720f0 100644 --- a/dasharo-compatibility/dasharo-tools-suite.robot +++ b/dasharo-compatibility/dasharo-tools-suite.robot @@ -25,6 +25,8 @@ Test Setup Run Keyword If ${TESTS_IN_FIRMWARE_SUPPORT} *** Test Cases *** +# After https://github.com/Dasharo/dts-scripts/pull/42 is released +# 'Write Into Terminal' might have to be changed to 'Write Bare Into Terminal' DTS001.001 Booting DTS from USB works correctly [Documentation] This test aims to verify that DTS is properly booting ... from USB. @@ -130,3 +132,40 @@ DTS008.001 DTS option power-off DUT works correctly Set DUT Response Timeout 30s ${status}= Run Keyword And Return Status Enter Setup Menu Tianocore Should Not Be True ${status} + +DTS009.001 Update Dasharo firmware by using DTS via USB works correctly + [Documentation] This test aims to verify that the option Power off + ... system in the DTS menu turns off the DUT. + Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} DTS009.001 not supported + # Flash earlier version so update can proceed. Firmware should have serial + # redirection enabled + Flash Firmware ${FW_FILE} + Power On + Boot Dasharo Tools Suite USB + Update Dasharo In DTS + +DTS009.002 Update Dasharo firmware by using DTS via iPXE works correctly + [Documentation] This test aims to verify that the option Power off + ... system in the DTS menu turns off the DUT. + Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} DTS009.002 not supported + # Flash earlier version so update can proceed. Firmware should have serial + # redirection enabled + Flash Firmware ${FW_FILE} + Make Sure That Network Boot Is Enabled + Boot Dasharo Tools Suite iPXE + Update Dasharo In DTS + + +*** Keywords *** +Update Dasharo In DTS + [Documentation] Update Firmware by using built-in DTS script. + ... Keyword has to be used when in DTS menu + Write Into Terminal 2 + Set DUT Response Timeout 240s + Read From Terminal Until Are you sure you want to proceed with update? (Y|n) + Write Into Terminal Y + Read From Terminal Until Does it match your actual specification? (Y|n) + Write Into Terminal Y + Read From Terminal Until Do you want to update Dasharo firmware on your hardware? (Y|n) + Write Into Terminal Y + Read From Terminal Until Successfully updated Dasharo firmware From bb5f944f300361a2c3a36dfb241a5e43ade374e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Fri, 15 Nov 2024 10:37:12 +0100 Subject: [PATCH 2/7] dts-compatibility: dasharo-tools-suite: disable BIOS lock MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Iwanicki --- dasharo-compatibility/dasharo-tools-suite.robot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dasharo-compatibility/dasharo-tools-suite.robot b/dasharo-compatibility/dasharo-tools-suite.robot index 86c7720f0..b688006a9 100644 --- a/dasharo-compatibility/dasharo-tools-suite.robot +++ b/dasharo-compatibility/dasharo-tools-suite.robot @@ -140,7 +140,7 @@ DTS009.001 Update Dasharo firmware by using DTS via USB works correctly # Flash earlier version so update can proceed. Firmware should have serial # redirection enabled Flash Firmware ${FW_FILE} - Power On + Set UEFI Option LockBios ${FALSE} Boot Dasharo Tools Suite USB Update Dasharo In DTS @@ -151,6 +151,7 @@ DTS009.002 Update Dasharo firmware by using DTS via iPXE works correctly # Flash earlier version so update can proceed. Firmware should have serial # redirection enabled Flash Firmware ${FW_FILE} + Set UEFI Option LockBios ${FALSE} Make Sure That Network Boot Is Enabled Boot Dasharo Tools Suite iPXE Update Dasharo In DTS From 0343a82819c133421232531f9bc1d6247a5f1c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Thu, 2 Jan 2025 09:57:47 +0100 Subject: [PATCH 3/7] dts-compatibility: dasharo-tools-suite: skip if FW_FILE is not defined MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Iwanicki --- dasharo-compatibility/dasharo-tools-suite.robot | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dasharo-compatibility/dasharo-tools-suite.robot b/dasharo-compatibility/dasharo-tools-suite.robot index b688006a9..e7feb9da0 100644 --- a/dasharo-compatibility/dasharo-tools-suite.robot +++ b/dasharo-compatibility/dasharo-tools-suite.robot @@ -136,6 +136,9 @@ DTS008.001 DTS option power-off DUT works correctly DTS009.001 Update Dasharo firmware by using DTS via USB works correctly [Documentation] This test aims to verify that the option Power off ... system in the DTS menu turns off the DUT. + ${skip}= Run Keyword And Return Status + ... Variable Should Not Exist $FW_FILE + Skip If ${skip} FW_FILE is not defined Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} DTS009.001 not supported # Flash earlier version so update can proceed. Firmware should have serial # redirection enabled @@ -147,6 +150,9 @@ DTS009.001 Update Dasharo firmware by using DTS via USB works correctly DTS009.002 Update Dasharo firmware by using DTS via iPXE works correctly [Documentation] This test aims to verify that the option Power off ... system in the DTS menu turns off the DUT. + ${skip}= Run Keyword And Return Status + ... Variable Should Not Exist $FW_FILE + Skip If ${skip} FW_FILE is not defined Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} DTS009.002 not supported # Flash earlier version so update can proceed. Firmware should have serial # redirection enabled From 9154ecf275bb6aa4fa0ed20bfef7efba1f3b338f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Thu, 2 Jan 2025 09:59:03 +0100 Subject: [PATCH 4/7] dts-compatibility: dasharo-tools-suite: fix documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Iwanicki --- dasharo-compatibility/dasharo-tools-suite.robot | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dasharo-compatibility/dasharo-tools-suite.robot b/dasharo-compatibility/dasharo-tools-suite.robot index e7feb9da0..37ed6daf2 100644 --- a/dasharo-compatibility/dasharo-tools-suite.robot +++ b/dasharo-compatibility/dasharo-tools-suite.robot @@ -134,8 +134,12 @@ DTS008.001 DTS option power-off DUT works correctly Should Not Be True ${status} DTS009.001 Update Dasharo firmware by using DTS via USB works correctly - [Documentation] This test aims to verify that the option Power off - ... system in the DTS menu turns off the DUT. + [Documentation] This test aims to verify that updating Dasharo by using + ... DTS built-in script works correctly when booting DTS via USB. + ... Test expects FW_FILE variable to contain path to Dasharo firmware. + ... This firmware should be earlier version than current one so update + ... can proceed. Test doesn't use DPP keys so it can only update up to + ... newest community version available. ${skip}= Run Keyword And Return Status ... Variable Should Not Exist $FW_FILE Skip If ${skip} FW_FILE is not defined @@ -148,8 +152,11 @@ DTS009.001 Update Dasharo firmware by using DTS via USB works correctly Update Dasharo In DTS DTS009.002 Update Dasharo firmware by using DTS via iPXE works correctly - [Documentation] This test aims to verify that the option Power off - ... system in the DTS menu turns off the DUT. + [Documentation] This test aims to verify that updating Dasharo by using + ... DTS built-in script works correctly when booting DTS via iPXE. + ... Test expects FW_FILE variable to contain path to Dasharo firmware + ... and DPP_LOGS_KEY, DPP_DOWNLOAD_KEY and DPP_PASSWORD to contain DPP + ... subscription credentials. ${skip}= Run Keyword And Return Status ... Variable Should Not Exist $FW_FILE Skip If ${skip} FW_FILE is not defined From d2393869c882ac09fba154c96389caf223a576bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Thu, 2 Jan 2025 18:01:34 +0100 Subject: [PATCH 5/7] dts-compatibility: dasharo-tools-suite: use dts-e2e keywords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Iwanicki --- .../dasharo-tools-suite.robot | 64 ++++---- dts/dts-e2e.robot | 150 ------------------ lib/dts-lib.robot | 148 +++++++++++++++++ 3 files changed, 184 insertions(+), 178 deletions(-) diff --git a/dasharo-compatibility/dasharo-tools-suite.robot b/dasharo-compatibility/dasharo-tools-suite.robot index 37ed6daf2..fc760f96f 100644 --- a/dasharo-compatibility/dasharo-tools-suite.robot +++ b/dasharo-compatibility/dasharo-tools-suite.robot @@ -136,20 +136,24 @@ DTS008.001 DTS option power-off DUT works correctly DTS009.001 Update Dasharo firmware by using DTS via USB works correctly [Documentation] This test aims to verify that updating Dasharo by using ... DTS built-in script works correctly when booting DTS via USB. - ... Test expects FW_FILE variable to contain path to Dasharo firmware. - ... This firmware should be earlier version than current one so update - ... can proceed. Test doesn't use DPP keys so it can only update up to - ... newest community version available. - ${skip}= Run Keyword And Return Status - ... Variable Should Not Exist $FW_FILE - Skip If ${skip} FW_FILE is not defined + ... Test expects FW_FILE variable to contain path to Dasharo firmware + ... and DPP_LOGS_KEY, DPP_DOWNLOAD_KEY and DPP_PASSWORD to contain DPP + ... subscription credentials. Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} DTS009.001 not supported + ${variables_defined}= Are FW FILE And DPP Keys Defined + Skip If not ${variables_defined} + ... Test can't run without setting FW_FILE, DPP_LOGS_KEY, DPP_DOWNLOAD_KEY and DPP_PASSWORD # Flash earlier version so update can proceed. Firmware should have serial # redirection enabled Flash Firmware ${FW_FILE} - Set UEFI Option LockBios ${FALSE} + Make Sure That Flash Locks Are Disabled + Power On Boot Dasharo Tools Suite USB - Update Dasharo In DTS + # To refresh screen as next keyword expects DTS checkpoint + Press Key N Times 1 ${ESC} + Provide DPP Credentials + Go Through Update + Wait For Checkpoint Rebooting DTS009.002 Update Dasharo firmware by using DTS via iPXE works correctly [Documentation] This test aims to verify that updating Dasharo by using @@ -157,29 +161,33 @@ DTS009.002 Update Dasharo firmware by using DTS via iPXE works correctly ... Test expects FW_FILE variable to contain path to Dasharo firmware ... and DPP_LOGS_KEY, DPP_DOWNLOAD_KEY and DPP_PASSWORD to contain DPP ... subscription credentials. - ${skip}= Run Keyword And Return Status - ... Variable Should Not Exist $FW_FILE - Skip If ${skip} FW_FILE is not defined - Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} DTS009.002 not supported + Skip If not ${TESTS_IN_FIRMWARE_SUPPORT} DTS009.001 not supported + ${variables_defined}= Are FW FILE And DPP Keys Defined + Skip If not ${variables_defined} + ... Test can't run without setting FW_FILE, DPP_LOGS_KEY, DPP_DOWNLOAD_KEY and DPP_PASSWORD # Flash earlier version so update can proceed. Firmware should have serial # redirection enabled Flash Firmware ${FW_FILE} - Set UEFI Option LockBios ${FALSE} - Make Sure That Network Boot Is Enabled + Make Sure That Flash Locks Are Disabled + Power On Boot Dasharo Tools Suite iPXE - Update Dasharo In DTS + # To refresh screen as next keyword expects DTS checkpoint + Press Key N Times 1 ${ESC} + Provide DPP Credentials + Go Through Update + Wait For Checkpoint Rebooting *** Keywords *** -Update Dasharo In DTS - [Documentation] Update Firmware by using built-in DTS script. - ... Keyword has to be used when in DTS menu - Write Into Terminal 2 - Set DUT Response Timeout 240s - Read From Terminal Until Are you sure you want to proceed with update? (Y|n) - Write Into Terminal Y - Read From Terminal Until Does it match your actual specification? (Y|n) - Write Into Terminal Y - Read From Terminal Until Do you want to update Dasharo firmware on your hardware? (Y|n) - Write Into Terminal Y - Read From Terminal Until Successfully updated Dasharo firmware +Are FW FILE And DPP Keys Defined + ${fw}= Run Keyword And Return Status + ... Variable Should Exist $FW_FILE + ${logs}= Run Keyword And Return Status + ... Variable Should Exist $DPP_LOGS_KEY + ${download}= Run Keyword And Return Status + ... Variable Should Exist $DPP_DOWNLOAD_KEY + ${password}= Run Keyword And Return Status + ... Variable Should Exist $DPP_PASSWORD + ${status}= Run Keyword And Return Status Should Be True + ... ${fw} and ${logs} and ${download} and ${password} + RETURN ${status} diff --git a/dts/dts-e2e.robot b/dts/dts-e2e.robot index 62008638c..8283911ce 100644 --- a/dts/dts-e2e.robot +++ b/dts/dts-e2e.robot @@ -17,39 +17,6 @@ Suite Teardown Run Keyword ... Log Out And Close Connection -*** Variables *** -# TODO: We should extend our keyword libs with keywords for DTS UI, these are -# first candidates. But before doing so - we need to establish some UI rules in -# DTS itself. -# DTS checkpoints: -${DTS_CHECKPOINT}= Enter an option: -${DTS_CONFIRM_CHECKPOINT}= Press Enter to continue -${HCL_REPORT_CHECKPOINT}= Please consider contributing to the "Hardware for Linux" project in the future. -${HCL_REPORT_SENDINGLOGS}= -... Do you want to support Dasharo development by sending us logs with your hardware configuration? [N/y] -${DTS_SPECIFICATION_WARN}= Does it match your actual specification? (Y|n) -${DTS_DEPLOY_WARN}= Do you want to deploy this Dasharo Firmware on your platform (Y|n) -${DTS_HW_PROBE_WARN}= Do you want to participate in this project? -${DTS_HEADS_SWITCH_QUESTION}= Would you like to switch to Dasharo heads firmware? (Y|n) -# DTS initial deployment menupoints: -${DTS_DCR_UEFI_MENUPOINT}= Community version -${DTS_DPP_UEFI_MENUPOINT}= DPP version (coreboot + UEFI) -${DTS_DPP_SEA_MENUPOINT}= DPP version (coreboot + SeaBIOS) -# Default DTS boot type, can be overwritten by CMD: -${DTS_BOOT_TYPE}= iPXE -# DTS options: -${DTS_HCL_OPT}= 1 -${DTS_DEPLOY_OPT}= 2 -${DTS_CREDENTIALS_OPT}= 4 -${DTS_DCR_UEFI_OPT}= c -${DTS_DPP_UEFI_OPT}= d -${DTS_DPP_SEA_OPT}= s -# DTS subscription checkpoints: -${DTS_NOACCESS_DPP_UEFI}= DPP version (coreboot + UEFI) available but you don't have access -${DTS_NOACCESS_DPP_SEABIOS}= DPP version (coreboot + SeaBIOS) available but you don't have access -${DTS_NOACCESS_DPP_HEADS}= DPP version (coreboot + Heads) available but you don't have access - - *** Test Cases *** E2E001.001 HCL Report test [Documentation] Verify that HCL Report is being executed with all @@ -1125,120 +1092,3 @@ E2E006.004 Odroid H4 DPP update (Coreboot + UEFI -> Coreboot + UEFI) - with cred # 5) The final step is rebooting: Wait For Checkpoint Rebooting - - -*** Keywords *** -Power On And Enter DTS Shell - [Documentation] This KW boots DTS using the method defined by user via - ... DTS_BOOT_TYPE or the default one. After booting DTS shell is being - ... entered. - # 1) Boot up to DTS UI: - Power On - Boot Dasharo Tools Suite ${DTS_BOOT_TYPE} - - # 2) Enter shell: - Write Into Terminal S - Set Prompt For Terminal bash-5.2# - Read From Terminal Until Prompt - Set DUT Response Timeout 90s - -Provide DPP Credentials - [Documentation] This KW automatically writes DPP credentials into DTS UI. - ... The credentials should be set via CMD or file. - ${out}= Read From Terminal Until ${DTS_CHECKPOINT} - Write Bare Into Terminal ${DTS_CREDENTIALS_OPT} - - # Enter logs key: - Variable Should Exist ${DPP_LOGS_KEY} - Write Into Terminal ${DPP_LOGS_KEY} - # Enter download key: - Variable Should Exist ${DPP_DOWNLOAD_KEY} - Write Into Terminal ${DPP_DOWNLOAD_KEY} - # Enter password: - Variable Should Exist ${DPP_PASSWORD} - Write Into Terminal ${DPP_PASSWORD} - - Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT} - -Wait For Checkpoint - [Documentation] This KW waits for checkpoint (first argument) and logs - ... everything read up to the checkpoint. - [Arguments] ${checkpoint} - ${out}= Read From Terminal Until ${checkpoint} - Log ${out} - -Wait For Checkpoint And Write - [Documentation] This KW waits for checkpoint (first argument) - ... and writes specified answer (second argument), with logging all - ... output before the checkpoint. - [Arguments] ${checkpoint} ${to_write} - Wait For Checkpoint ${checkpoint} - Sleep 1s - Write Into Terminal ${to_write} - -Wait For Checkpoint And Press Enter - [Documentation] This KW waits for checkpoint (first argument) - ... and preses enter, with logging all output before the checkpoint. - [Arguments] ${checkpoint} - Wait For Checkpoint ${checkpoint} - Sleep 1s - Write Bare Into Terminal \r\n - -Go Through Initial Deployment - [Documentation] This KW goes through standard Dasharo initial deployment - ... choosing all needed menu options and answering all questions. The - ... only thing which needs to be specified - the Dasharo version to - ... deploy (first argument), available versions: DCR UEFI, DPP UEFI, DPP - ... SeaBIOS. - [Arguments] ${dasharo_version} - # 1) Select initial deployment: - Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DEPLOY_OPT} - - # 2) Wait for HCL report to do its work, might take some time: - Set DUT Response Timeout 5m - # Accept hw-probe question from HCL report: - Wait For Checkpoint And Write ${DTS_HW_PROBE_WARN} Y - Set DUT Response Timeout 30s - - # 3) Choose version to install: - IF '${dasharo_version}' == 'DCR UEFI' - Wait For Checkpoint ${DTS_DCR_UEFI_OPT}) ${DTS_DCR_UEFI_MENUPOINT} - Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DCR_UEFI_OPT} - ELSE IF '${dasharo_version}' == 'DPP UEFI' - Wait For Checkpoint ${DTS_DPP_UEFI_OPT}) ${DTS_DPP_UEFI_MENUPOINT} - Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DPP_UEFI_OPT} - ELSE IF '${dasharo_version}' == 'DPP SeaBIOS' - Wait For Checkpoint ${DTS_DPP_SEA_OPT}) ${DTS_DPP_SEA_MENUPOINT} - Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DPP_SEA_OPT} - ELSE - Fail No Dasharo version for initial deployment provided! - END - - # 4) Check out all warnings: - Wait For Checkpoint And Write ${DTS_SPECIFICATION_WARN} Y - Wait For Checkpoint And Write ${DTS_DEPLOY_WARN} Y - -Go Through Update - [Documentation] This KW goes through standard Dasharo update workflow - ... choosing all needed menu options and answering all questions. - # 1) Select initial deployment: - Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DEPLOY_OPT} - - # 2) Check out all warnings: - Wait For Checkpoint And Write ${DTS_SPECIFICATION_WARN} Y - Wait For Checkpoint And Write ${DTS_DEPLOY_WARN} Y - -Go Through Heads Transition - [Documentation] This KW goes through transition to Dasharo Heads choosing - ... all needed menu options and answering all questions. - # 1) Start update: - Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DEPLOY_OPT} - - # 2) Check out all warnings: - Wait For Checkpoint And Write ${DTS_HEADS_SWITCH_QUESTION} Y - Wait For Checkpoint And Write ${DTS_SPECIFICATION_WARN} Y - Wait For Checkpoint And Write ${DTS_DEPLOY_WARN} Y - - # 3) Check for Heads firmware deployment success: - Wait For Checkpoint Successfully switched to Dasharo Heads firmware - Wait For Checkpoint And Write ${DTS_CONFIRM_CHECKPOINT} 1 diff --git a/lib/dts-lib.robot b/lib/dts-lib.robot index eb3673a5a..74801a613 100644 --- a/lib/dts-lib.robot +++ b/lib/dts-lib.robot @@ -2,6 +2,39 @@ Resource terminal.robot +*** Variables *** +# TODO: We should extend our keyword libs with keywords for DTS UI, these are +# first candidates. But before doing so - we need to establish some UI rules in +# DTS itself. +# DTS checkpoints: +${DTS_CHECKPOINT}= Enter an option: +${DTS_CONFIRM_CHECKPOINT}= Press Enter to continue +${HCL_REPORT_CHECKPOINT}= Please consider contributing to the "Hardware for Linux" project in the future. +${HCL_REPORT_SENDINGLOGS}= +... Do you want to support Dasharo development by sending us logs with your hardware configuration? [N/y] +${DTS_SPECIFICATION_WARN}= Does it match your actual specification? (Y|n) +${DTS_DEPLOY_WARN}= Do you want to deploy this Dasharo Firmware on your platform (Y|n) +${DTS_HW_PROBE_WARN}= Do you want to participate in this project? +${DTS_HEADS_SWITCH_QUESTION}= Would you like to switch to Dasharo heads firmware? (Y|n) +# DTS initial deployment menupoints: +${DTS_DCR_UEFI_MENUPOINT}= Community version +${DTS_DPP_UEFI_MENUPOINT}= DPP version (coreboot + UEFI) +${DTS_DPP_SEA_MENUPOINT}= DPP version (coreboot + SeaBIOS) +# Default DTS boot type, can be overwritten by CMD: +${DTS_BOOT_TYPE}= iPXE +# DTS options: +${DTS_HCL_OPT}= 1 +${DTS_DEPLOY_OPT}= 2 +${DTS_CREDENTIALS_OPT}= 4 +${DTS_DCR_UEFI_OPT}= c +${DTS_DPP_UEFI_OPT}= d +${DTS_DPP_SEA_OPT}= s +# DTS subscription checkpoints: +${DTS_NOACCESS_DPP_UEFI}= DPP version (coreboot + UEFI) available but you don't have access +${DTS_NOACCESS_DPP_SEABIOS}= DPP version (coreboot + SeaBIOS) available but you don't have access +${DTS_NOACCESS_DPP_HEADS}= DPP version (coreboot + Heads) available but you don't have access + + *** Keywords *** Boot Dasharo Tools Suite Via IPXE Shell [Documentation] Boots DTS via iPXE shell by chaining script. Arguments: @@ -155,3 +188,118 @@ Remove Extra Default Route ${route_info}= Execute Command In Terminal ip route | grep ^default Log Default route via 172.16.0.1 dev ${devname[0]} removed END + +Power On And Enter DTS Shell + [Documentation] This KW boots DTS using the method defined by user via + ... DTS_BOOT_TYPE or the default one. After booting DTS shell is being + ... entered. + # 1) Boot up to DTS UI: + Power On + Boot Dasharo Tools Suite ${DTS_BOOT_TYPE} + + # 2) Enter shell: + Write Into Terminal S + Set Prompt For Terminal bash-5.2# + Read From Terminal Until Prompt + Set DUT Response Timeout 90s + +Provide DPP Credentials + [Documentation] This KW automatically writes DPP credentials into DTS UI. + ... The credentials should be set via CMD or file. + ${out}= Read From Terminal Until ${DTS_CHECKPOINT} + Write Bare Into Terminal ${DTS_CREDENTIALS_OPT} + + # Enter logs key: + Variable Should Exist ${DPP_LOGS_KEY} + Write Into Terminal ${DPP_LOGS_KEY} + # Enter download key: + Variable Should Exist ${DPP_DOWNLOAD_KEY} + Write Into Terminal ${DPP_DOWNLOAD_KEY} + # Enter password: + Variable Should Exist ${DPP_PASSWORD} + Write Into Terminal ${DPP_PASSWORD} + + Wait For Checkpoint And Press Enter ${DTS_CONFIRM_CHECKPOINT} + +Wait For Checkpoint + [Documentation] This KW waits for checkpoint (first argument) and logs + ... everything read up to the checkpoint. + [Arguments] ${checkpoint} + ${out}= Read From Terminal Until ${checkpoint} + Log ${out} + +Wait For Checkpoint And Write + [Documentation] This KW waits for checkpoint (first argument) + ... and writes specified answer (second argument), with logging all + ... output before the checkpoint. + [Arguments] ${checkpoint} ${to_write} + Wait For Checkpoint ${checkpoint} + Sleep 1s + Write Into Terminal ${to_write} + +Wait For Checkpoint And Press Enter + [Documentation] This KW waits for checkpoint (first argument) + ... and preses enter, with logging all output before the checkpoint. + [Arguments] ${checkpoint} + Wait For Checkpoint ${checkpoint} + Sleep 1s + Write Bare Into Terminal \r\n + +Go Through Initial Deployment + [Documentation] This KW goes through standard Dasharo initial deployment + ... choosing all needed menu options and answering all questions. The + ... only thing which needs to be specified - the Dasharo version to + ... deploy (first argument), available versions: DCR UEFI, DPP UEFI, DPP + ... SeaBIOS. + [Arguments] ${dasharo_version} + # 1) Select initial deployment: + Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DEPLOY_OPT} + + # 2) Wait for HCL report to do its work, might take some time: + Set DUT Response Timeout 5m + # Accept hw-probe question from HCL report: + Wait For Checkpoint And Write ${DTS_HW_PROBE_WARN} Y + Set DUT Response Timeout 30s + + # 3) Choose version to install: + IF '${dasharo_version}' == 'DCR UEFI' + Wait For Checkpoint ${DTS_DCR_UEFI_OPT}) ${DTS_DCR_UEFI_MENUPOINT} + Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DCR_UEFI_OPT} + ELSE IF '${dasharo_version}' == 'DPP UEFI' + Wait For Checkpoint ${DTS_DPP_UEFI_OPT}) ${DTS_DPP_UEFI_MENUPOINT} + Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DPP_UEFI_OPT} + ELSE IF '${dasharo_version}' == 'DPP SeaBIOS' + Wait For Checkpoint ${DTS_DPP_SEA_OPT}) ${DTS_DPP_SEA_MENUPOINT} + Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DPP_SEA_OPT} + ELSE + Fail No Dasharo version for initial deployment provided! + END + + # 4) Check out all warnings: + Wait For Checkpoint And Write ${DTS_SPECIFICATION_WARN} Y + Wait For Checkpoint And Write ${DTS_DEPLOY_WARN} Y + +Go Through Update + [Documentation] This KW goes through standard Dasharo update workflow + ... choosing all needed menu options and answering all questions. + # 1) Select initial deployment: + Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DEPLOY_OPT} + + # 2) Check out all warnings: + Wait For Checkpoint And Write ${DTS_SPECIFICATION_WARN} Y + Wait For Checkpoint And Write ${DTS_DEPLOY_WARN} Y + +Go Through Heads Transition + [Documentation] This KW goes through transition to Dasharo Heads choosing + ... all needed menu options and answering all questions. + # 1) Start update: + Wait For Checkpoint And Write ${DTS_CHECKPOINT} ${DTS_DEPLOY_OPT} + + # 2) Check out all warnings: + Wait For Checkpoint And Write ${DTS_HEADS_SWITCH_QUESTION} Y + Wait For Checkpoint And Write ${DTS_SPECIFICATION_WARN} Y + Wait For Checkpoint And Write ${DTS_DEPLOY_WARN} Y + + # 3) Check for Heads firmware deployment success: + Wait For Checkpoint Successfully switched to Dasharo Heads firmware + Wait For Checkpoint And Write ${DTS_CONFIRM_CHECKPOINT} 1 From 3fc7e3815f799bfd0135e5e03306f0b0462c7189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Thu, 2 Jan 2025 19:06:11 +0100 Subject: [PATCH 6/7] dts-lib.robot: use dts-boot instead of dts in shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Iwanicki --- lib/dts-lib.robot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dts-lib.robot b/lib/dts-lib.robot index 74801a613..023af26b1 100644 --- a/lib/dts-lib.robot +++ b/lib/dts-lib.robot @@ -118,7 +118,7 @@ Boot Dasharo Tools Suite Set Global Variable ${DUT_CONNECTION_METHOD} SSH Login To Linux Via SSH Without Password root root@DasharoToolsSuite:~# # Spawn DTS menu on SSH console - Write Into Terminal dts + Write Into Terminal dts-boot END Read From Terminal Until Enter an option: Sleep 5s From 19dd18ce20c4de2c0bbe25f11ce0ac484759d32a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Thu, 2 Jan 2025 19:07:01 +0100 Subject: [PATCH 7/7] requirements.txt: update osfv to 0.5.9 to fix requests exception error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Iwanicki --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 9158bfc4d..dd50c2f32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -27,7 +27,7 @@ MarkupSafe==2.1.5 mdurl==0.1.2 nodeenv==1.8.0 oauth2client==4.1.3 -osfv @ git+https://github.com/Dasharo/osfv-scripts.git@36a030eb006391c3761c25d6972036a5a34fb73b#subdirectory=osfv_cli +osfv @ git+https://github.com/Dasharo/osfv-scripts.git@2aefa227c20e9f3da29d8be4ad3d3cebc2e804ac#subdirectory=osfv_cli paramiko==3.4.0 pathspec==0.9.0 pexpect==4.9.0