|
| 1 | +*** Settings *** |
| 2 | +Library Collections |
| 3 | +Library Dialogs |
| 4 | +Library String |
| 5 | +Resource ../variables.robot |
| 6 | +Resource ../keywords.robot |
| 7 | + |
| 8 | +Suite Setup Run Keyword |
| 9 | +... Prepare Test Suite |
| 10 | +Suite Teardown Run Keyword |
| 11 | +... Log Out And Close Connection |
| 12 | + |
| 13 | +Default Tags automated |
| 14 | + |
| 15 | +*** Variables *** |
| 16 | +${NVRAM_ATTEMPT_B_FLAG}= Attempt Slot B #TBD |
| 17 | +${NVRAM_ATTEMPT_B_FLAG_SET}= 1 # TBD |
| 18 | +${NVRAM_ATTEMPT_B_FLAG_CLR}= 0 # TBD |
| 19 | + |
| 20 | +*** Test Cases *** |
| 21 | +CRB001.201 Boot Slot A After Clearing CMOS (Ubuntu) |
| 22 | + [Documentation] Check if clearing the CMOS makes the DUT boot from slot A |
| 23 | + ... which should contain a recovery firmware |
| 24 | + [Tags] semiauto |
| 25 | + Execute Manual Step Disconnect the CMOS battery |
| 26 | + Sleep 5s |
| 27 | + Execute Manual Step Connect the CMOS battery |
| 28 | + |
| 29 | + Power On |
| 30 | + Boot System Or From Connected Disk ${ENV_ID_UBUNTU} |
| 31 | + Login To Linux |
| 32 | + Switch To Root User |
| 33 | + Should Have Booted From Slot A |
| 34 | + |
| 35 | + |
| 36 | +CRB002.201 Boot Slot B After Setting Attempt Slot B Flag (Ubuntu) |
| 37 | + [Documentation] Check if setting the Attempt Slot B flag the device boots |
| 38 | + ... from the slot B |
| 39 | + Power On |
| 40 | + Boot System Or From Connected Disk ${ENV_ID_UBUNTU} |
| 41 | + Login To Linux |
| 42 | + Switch To Root User |
| 43 | + Set Attempt Slot B Flag ${TRUE} |
| 44 | + Execute Reboot Command |
| 45 | + |
| 46 | + Boot System Or From Connected Disk ${ENV_ID_UBUNTU} |
| 47 | + Login To Linux |
| 48 | + Switch To Root User |
| 49 | + Should Have Booted From Slot B |
| 50 | + |
| 51 | +CRB003.201 Boot Slot A After Clearing Attempt Slot B Flag (Ubuntu) |
| 52 | + [Documentation] Check if clearing the Attempt Slot B flag the device boots |
| 53 | + ... from the slot A |
| 54 | + Power On |
| 55 | + Boot System Or From Connected Disk ${ENV_ID_UBUNTU} |
| 56 | + Login To Linux |
| 57 | + Switch To Root User |
| 58 | + Set Attempt Slot B Flag ${FALSE} |
| 59 | + Execute Reboot Command |
| 60 | + |
| 61 | + Boot System Or From Connected Disk ${ENV_ID_UBUNTU} |
| 62 | + Login To Linux |
| 63 | + Switch To Root User |
| 64 | + Should Have Booted From Slot A |
| 65 | + |
| 66 | + |
| 67 | +*** Keywords *** |
| 68 | +Set Attempt Slot B Flag |
| 69 | + [Arguments] ${state}=${TRUE} |
| 70 | + IF ${state} |
| 71 | + VAR ${flag_state}= ${NVRAM_ATTEMPT_B_FLAG_SET} |
| 72 | + ELSE |
| 73 | + VAR ${flag_state}= ${NVRAM_ATTEMPT_B_FLAG_CLR} |
| 74 | + END |
| 75 | + |
| 76 | + ${out}= Execute Command In Terminal nvramtool -w ${NVRAM_ATTEMPT_B_FLAG}=${flag_state} |
| 77 | + ${out}= Execute Command In Terminal nvramtool -r ${NVRAM_ATTEMPT_B_FLAG} |
| 78 | + Should Contain ${out} ${flag_state} |
| 79 | + |
| 80 | +Should Have Booted From Slot |
| 81 | + [Arguments] ${slot} |
| 82 | + ${slot}= Convert To Lower Case ${slot} |
| 83 | + # TBD - will this show slot B? |
| 84 | + ${out}= Execute Command In Terminal cbmem -c | grep -E "Slot [AB] is selected" | uniq | grep -oE " [AB] " |
| 85 | + ${out}= Convert To Lower Case ${out} |
| 86 | + ${out}= Strip String ${out} |
| 87 | + Should Be Equal ${out} ${slot} |
| 88 | + |
| 89 | + |
0 commit comments