Skip to content

Commit 93f1680

Browse files
committed
lib/bsd.robot: Execute Cold Boot kw introduced
Signed-off-by: Mateusz Maciejewski <[email protected]>
1 parent 7a89d2a commit 93f1680

File tree

4 files changed

+23
-31
lines changed

4 files changed

+23
-31
lines changed

dasharo-compatibility/os-opnsense.robot

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,7 @@ OPN003.503 Boot OPNsense (serial output) from disk after cold-boot
4141
[Documentation] Boot OPNsense (serial output) from disk after cold-boot
4242
@{supported_power_ctrls}= Create List RteCtrl sonoff
4343
Skip If '${POWER_CTRL}' not in ${supported_power_ctrls}
44-
Power On
45-
Set UEFI Option PowerStateAfterPowerAcLoss Powered On
46-
Sleep 2
47-
IF '${POWER_CTRL}' == 'RteCtrl'
48-
Rte Psu Off
49-
ELSE IF '${POWER_CTRL}' == 'sonoff'
50-
Sonoff Off
51-
END
52-
Sleep 12
53-
IF '${POWER_CTRL}' == 'RteCtrl'
54-
Rte Psu On
55-
ELSE IF '${POWER_CTRL}' == 'sonoff'
56-
Sonoff On
57-
END
44+
Execute Cold Boot
5845
${start_date}= Get Current Date
5946
Boot OPNsense
6047
${end_date}= Get Current Date

dasharo-compatibility/os-pfsense.robot

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,11 @@ PFS002.502 Boot pfSense LTS CE (serial output) from disk
3434
Power On
3535
Boot PfSense
3636

37-
PFS003.502 Boot pfSense LTS CE (serial output) from disk after cold-boot
37+
PFS003.502 Boot pfSense LTS CE (serial output) from diskt
3838
[Documentation] Boot pfSense LTS CE (serial output) from disk after cold-boot
3939
@{supported_power_ctrls}= Create List RteCtrl sonoff
4040
Skip If '${POWER_CTRL}' not in ${supported_power_ctrls}
41-
Power On
42-
Set UEFI Option PowerStateAfterPowerAcLoss Powered On
43-
Sleep 2
44-
IF '${POWER_CTRL}' == 'RteCtrl'
45-
Rte Psu Off
46-
ELSE IF '${POWER_CTRL}' == 'sonoff'
47-
Sonoff Off
48-
END
49-
Sleep 12
50-
IF '${POWER_CTRL}' == 'RteCtrl'
51-
Rte Psu On
52-
ELSE IF '${POWER_CTRL}' == 'sonoff'
53-
Sonoff On
54-
END
41+
Execute Cold Boot
5542
${start_date}= Get Current Date
5643
Boot PfSense
5744
${end_date}= Get Current Date

lib/bsd.robot

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Settings ***
22
Library Collections
33
Resource ../keywords.robot
4+
Resource ../lib/platform/power.robot
45

56

67
*** Keywords ***
@@ -16,7 +17,7 @@ Boot PfSense Installer
1617
Write Into Terminal vt100
1718
Read From Terminal Until [Accept]
1819
Press Enter
19-
Set Suite Variable ${BOOTED_OS_ID} 502
20+
Set Suite Variable ${BOOTED_OS_ID} ${ENV_ID_PFSENSE}
2021
Import Variables ${CURDIR}/../os-config/${BOOTED_OS_ID}-credentials.py
2122

2223
Boot OPNsense Installer
@@ -28,7 +29,7 @@ Boot OPNsense Installer
2829
Execute File In File Explorer bootx64.efi
2930
Read From Terminal Until FreeBSD/amd64 (OPNsense.localdomain) (ttyu0)
3031
Read From Terminal Until login:
31-
Set Suite Variable ${BOOTED_OS_ID} 503
32+
Set Suite Variable ${BOOTED_OS_ID} ${ENV_ID_OPNSENSE}
3233
Import Variables ${CURDIR}/../os-config/${BOOTED_OS_ID}-credentials.py
3334

3435
Enter PfSense Shell

lib/platform/power.robot

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,20 @@ Power Cycle Into Windows
105105
Power Cycle Into Firmware Setup
106106
Power On
107107
Enter Setup Menu Tianocore
108+
109+
Execute Cold Boot
110+
[Documentation] Performs cold boot, either with RTE relay or Sonoff
111+
Power On
112+
Set UEFI Option PowerStateAfterPowerAcLoss Powered On
113+
Sleep 2
114+
IF '${POWER_CTRL}' == 'RteCtrl'
115+
Rte Psu Off
116+
ELSE IF '${POWER_CTRL}' == 'sonoff'
117+
Sonoff Off
118+
END
119+
Sleep 12
120+
IF '${POWER_CTRL}' == 'RteCtrl'
121+
Rte Psu On
122+
ELSE IF '${POWER_CTRL}' == 'sonoff'
123+
Sonoff On
124+
END

0 commit comments

Comments
 (0)