Skip to content

Commit a585c8f

Browse files
committed
unify approach to Power On
* Use Power Supply keywords from osfv_cli libs * Unify Power On keywords in include/default.robot in a for of "Power On Default" keyword, as most of them looked more or less identical * Platfom configs can choose to use this keyword as Powe On, or define platform-specific one as before Tested following platforms via the BPS001.001 from util/basic-platform-setup.robot: - protectli-vp2410 - protectli-vp2420 - protectli-vp4630 - protectli-vp4670 - protectli-vp6670 - pcengines-apu2 - msi-pro-z690-a-ddr5 - odroid-h4-plus - minnowboard-turbot - optiplex-7010 Signed-off-by: Maciej Pijanowski <[email protected]>
1 parent b24ad0b commit a585c8f

15 files changed

+43
-220
lines changed

keywords.robot

+20-97
Original file line numberDiff line numberDiff line change
@@ -702,45 +702,37 @@ Get DUT To Start State
702702
END
703703

704704
Turn On Power Supply
705-
${pc}= Get Variable Value ${POWER_CTRL}
706-
IF 'sonoff' == '${pc}'
707-
${state}= Sonoff On
708-
ELSE
709-
${state}= Rte Relay Set on
710-
END
705+
Rte Psu On
711706

712707
Power Cycle On
713-
[Documentation] Clears telnet buffer and perform full power cycle with
714-
... RTE relay set to ON.
715-
[Arguments] ${power_button}=${FALSE}
708+
[Documentation] Clears telnet buffer and performs full power cycle
709+
... by setting power supply to OFF, and then to ON. If platform needs
710+
... additional power button press, it will be used as well, so at the
711+
... end of this keyword platform starts booting. This is controlled via
712+
... the DEFAULT_POWER_STATE_AFTER_FAIL variable defined in platform config.
713+
714+
Variable Should Exist ${DEFAULT_POWER_STATE_AFTER_FAIL}
716715
IF "${OPTIONS_LIB}"=="dcu" and "${POWER_CTRL}"=="none"
717716
Execute Reboot Command
718717
Sleep 5s
719718
RETURN
720719
END
720+
721721
Restore Initial DUT Connection Method
722722
${pc}= Get Variable Value ${POWER_CTRL}
723-
IF 'sonoff' == '${pc}'
724-
Sonoff Power Cycle On
725-
ELSE IF 'obmcutil' == '${pc}'
723+
IF 'obmcutil' == '${pc}'
726724
OBMC Power Cycle On
727725
ELSE
728-
Rte Relay Power Cycle On
729-
END
730-
731-
IF ${power_button} Rte Power On
732-
733-
Rte Relay Power Cycle On
734-
[Documentation] Clears telnet buffer and perform full power cycle with
735-
... RTE relay set to ON.
736-
Rte Relay Set off
737-
Sleep 10
738-
TRY
739-
Telnet.Read
740-
EXCEPT
741-
Log Could not clear Telnet buffer
726+
Rte Psu Off
727+
Sleep 10
728+
TRY
729+
Read From Terminal
730+
EXCEPT
731+
Log Could not clear terminal buffer
732+
END
733+
Rte Psu On
742734
END
743-
Rte Relay Set on
735+
IF '${DEFAULT_POWER_STATE_AFTER_FAIL}' == 'Powered Off' Rte Power On
744736

745737
OBMC Power Cycle On
746738
[Documentation] Clears obmc-console-client buffer and perform full power
@@ -754,78 +746,9 @@ OBMC Power Cycle On
754746
Read From Terminal
755747
Power On
756748

757-
OBMC Power Cycle Off
758-
[Documentation] Clears obmc-console-client buffer and perform full power
759-
... cycle with Chassis and Host State Control
760-
${host_state}= Get Host State
761-
${chassis_state}= Get Chassis Power State
762-
IF '${host_state.lower()}'=='on' or '${chassis_state.lower()}'=='on'
763-
Set Chassis Power State off
764-
Sleep 15s
765-
END
766-
Read From Terminal
767-
768-
Sonoff Power Cycle On
769-
[Documentation] Clear telnet buffer and perform full power cycle with
770-
... Sonoff
771-
Sonoff Off
772-
Sleep 10
773-
TRY
774-
Telnet.Read
775-
EXCEPT
776-
Log Could not clear Telnet buffer
777-
END
778-
Sonoff On
779-
780-
Power Cycle Off
781-
[Documentation] Power cycle off power supply using the supported
782-
... method.
783-
${pc}= Get Variable Value ${POWER_CTRL}
784-
IF 'sonoff' == '${pc}'
785-
Sonoff Power Cycle Off
786-
ELSE IF 'obmcutil' == '${pc}'
787-
OBMC Power Cycle Off
788-
ELSE
789-
Rte Relay Power Cycle Off
790-
END
791-
Telnet.Close All Connections
792-
Serial Setup ${RTE_IP} ${RTE_S2_N_PORT}
793-
794-
Rte Relay Power Cycle Off
795-
[Documentation] Performs full power cycle with RTE relay set to OFF.
796-
# sleep for DUT Start state in Suite Setup
797-
Sleep 1s
798-
${result}= RTE Relay Get
799-
IF '${result}' == 'on' Rte Relay off
800-
801-
Sonoff Power Cycle Off
802-
Sonoff On
803-
Sonoff Off
804-
805-
Get Relay State
806-
[Documentation] Returns the power relay state depending on the supported
807-
... method.
808-
${pc}= Get Variable Value ${POWER_CTRL}
809-
IF 'sonoff' == '${pc}'
810-
${state}= Sonoff Get
811-
ELSE
812-
${state}= RTE Relay Get
813-
END
814-
RETURN ${state}
815-
816-
RTE Relay Get
817-
[Documentation] Returns the RTE relay state through REST API.
818-
${state}= Rte Gpio Get 0
819-
RETURN ${state}
820-
821749
Get Power Supply State
822750
[Documentation] Returns the power supply state.
823-
${pc}= Get Variable Value ${POWER_CTRL}
824-
IF '${pc}'=='sonoff'
825-
${state}= Sonoff Get
826-
ELSE
827-
${state}= Get Relay State
828-
END
751+
${state}= Rte Psu Get
829752
RETURN ${state}
830753

831754
Get Sound Devices Windows

platform-configs/include/default.robot

+15
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,18 @@ ${STABILITY_DETECTION_WARMBOOT_ITERATIONS}= 2
263263
${STABILITY_DETECTION_REBOOT_ITERATIONS}= 5
264264
${STABILITY_DETECTION_SUSPEND_ITERATIONS}= 5
265265
${DCU_SUPPORTED_BOOLEAN_SMMSTORE_VARIABLE}= NetworkBoot
266+
267+
268+
*** Keywords ***
269+
Power On Default
270+
[Documentation] Keyword clears terminal buffer and sets Device Under Test
271+
... into Power On state using RTE OC buffers. Implementation
272+
... must be compatible with the theory of operation of a
273+
... specific platform.
274+
Restore Initial DUT Connection Method
275+
IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN
276+
Sleep 2s
277+
Rte Power Off
278+
Sleep 10s
279+
Read From Terminal
280+
Power Cycle On

platform-configs/include/msi-z690-common.robot

+1-12
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,4 @@ ${ROMHOLE_SUPPORT}= ${TRUE}
118118

119119
*** Keywords ***
120120
Power On
121-
[Documentation] Keyword clears telnet buffer and sets Device Under Test
122-
... into Power On state using RTE OC buffers. Implementation
123-
... must be compatible with the theory of operation of a
124-
... specific platform.
125-
Restore Initial DUT Connection Method
126-
IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN
127-
Sleep 2s
128-
Rte Power Off ${6}
129-
Sleep 5s
130-
# read the old output
131-
Telnet.Read
132-
Rte Power On
121+
Power On Default

platform-configs/include/optiplex-common.robot

+1-3
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,4 @@ ${HIBERNATION_AND_RESUME_SUPPORT}= ${TRUE}
9696

9797
*** Keywords ***
9898
Power On
99-
Sonoff Power Cycle On
100-
Sleep 2s
101-
Rte Power On
99+
Power On Default

platform-configs/include/pcengines.robot

-15
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,3 @@ ${USB_TYPE-A_DEVICES_DETECTION_SUPPORT}= ${TRUE}
102102

103103
# Test module: trenchboot
104104
${TRENCHBOOT_SUPPORT}= ${TRUE}
105-
106-
107-
*** Keywords ***
108-
Power On
109-
[Documentation] Keyword clears telnet buffer and sets Device Under Test
110-
... into Power On state using RTE OC buffers. Implementation
111-
... must be compatible with the theory of operation of a
112-
... specific platform.
113-
Restore Initial DUT Connection Method
114-
IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN
115-
Sleep 2s
116-
Rte Power Off
117-
Sleep 10s
118-
Telnet.Read
119-
Rte Power On

platform-configs/include/protectli-common.robot

+3
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ ${STABILITY_DETECTION_SUSPEND_ITERATIONS}= 5
134134

135135

136136
*** Keywords ***
137+
Power On
138+
Power On Default
139+
137140
Check Coreboot Components Measurement
138141
[Documentation] Check whether the hashes of the coreboot components
139142
... measurements have been stored in the TPM PCR registers.

platform-configs/include/protectli-v1x10.robot

-15
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,6 @@ ${DCU_SUPPORTED_BOOLEAN_SMMSTORE_VARIABLE}= ${EMPTY}
3838

3939

4040
*** Keywords ***
41-
Power On
42-
[Documentation] Keyword clears telnet buffer and sets Device Under Test
43-
... into Power On state using RTE OC buffers. Implementation
44-
... must be compatible with the theory of operation of a
45-
... specific platform.
46-
Restore Initial DUT Connection Method
47-
IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN
48-
Sleep 2s
49-
Rte Power Off
50-
Sleep 10s
51-
Telnet.Read
52-
# After Rte Power Off, the platform cannot be powered back using the power button.
53-
# Possibly bug in HW or FW.
54-
Power Cycle On
55-
5641
Flash Device Via External Programmer
5742
[Documentation] Keyword allows to flash Device Under Test firmware by
5843
... using external programmer and check flashing procedure

platform-configs/include/protectli-vp24xx.robot

-15
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,3 @@ ${MAX_CPU_TEMP}= 95
1212
${DMIDECODE_MANUFACTURER}= Protectli
1313
${DMIDECODE_VENDOR}= 3mdeb
1414
${DMIDECODE_FAMILY}= Vault Pro
15-
16-
17-
*** Keywords ***
18-
Power On
19-
[Documentation] Keyword clears telnet buffer and sets Device Under Test
20-
... into Power On state using RTE OC buffers. Implementation
21-
... must be compatible with the theory of operation of a
22-
... specific platform.
23-
Restore Initial DUT Connection Method
24-
IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN
25-
Sleep 2s
26-
Rte Power Off
27-
Sleep 10s
28-
Telnet.Read
29-
Rte Power On

platform-configs/include/protectli-vp32xx.robot

-7
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,3 @@ Resource protectli-common.robot
77
${FLASH_SIZE}= ${16*1024*1024}
88

99
${MAX_CPU_TEMP}= 82
10-
11-
12-
*** Keywords ***
13-
Power On
14-
Rte Power Off
15-
Sleep 5s
16-
Power Cycle On

platform-configs/include/protectli-vp46xx.robot

-8
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,3 @@ ${DMIDECODE_FIRMWARE_VERSION}= Dasharo (coreboot+UEFI) v1.2.0
2020
${DMIDECODE_RELEASE_DATE}= 03/13/2024
2121

2222
@{ETH_PERF_PAIR_2_G}= enp5s0 enp6s0
23-
24-
25-
*** Keywords ***
26-
Power On
27-
Restore Initial DUT Connection Method
28-
Rte Power Off
29-
Sleep 5s
30-
Power Cycle On

platform-configs/include/protectli-vp66xx.robot

-7
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,3 @@ ${HYPER_THREADING_SUPPORT}= ${TRUE}
2222
${INTEL_HYBRID_ARCH_SUPPORT}= ${TRUE}
2323
@{ETH_PERF_PAIR_2_G}= enp5s0 enp6s0
2424
@{ETH_PERF_PAIR_10_G}= enp2s0f0 enp2s0f1
25-
26-
27-
*** Keywords ***
28-
Power On
29-
Rte Power Off
30-
Sleep 5s
31-
Power Cycle On

platform-configs/minnowboard-turbot.robot

+1-12
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,4 @@ ${CUSTOM_BOOT_MENU_KEY_SUPPORT}= ${TRUE}
3737

3838
*** Keywords ***
3939
Power On
40-
[Documentation] Keyword clears telnet buffer and sets Device Under Test
41-
... into Power On state using RTE OC buffers. Implementation
42-
... must be compatible with the theory of operation of a
43-
... specific platform.
44-
Restore Initial DUT Connection Method
45-
IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN
46-
Sleep 3s
47-
Rte Power Off
48-
Sleep 1s
49-
Telnet.Read
50-
Rte Power On
51-
Sleep 1s
40+
Power On Default

platform-configs/odroid-h4-plus.robot

+1-11
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,4 @@ ${AUTO_BOOT_TIME_OUT_DEFAULT_VALUE}= 2
6262

6363
*** Keywords ***
6464
Power On
65-
[Documentation] Keyword clears telnet buffer and sets Device Under Test
66-
... into Power On state using RTE OC buffers. Implementation
67-
... must be compatible with the theory of operation of a
68-
... specific platform.
69-
Restore Initial DUT Connection Method
70-
Sleep 2s
71-
Rte Relay Power Cycle Off
72-
Sleep 5s
73-
# read the old output
74-
Telnet.Read
75-
Rte Relay Power Cycle On
65+
Power On Default

platform-configs/protectli-vp2410.robot

-17
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,3 @@ ${PLATFORM_RAM_SPEED}= 2400
4242
${PLATFORM_RAM_SIZE}= 8192
4343

4444
@{ETH_PERF_PAIR_1_G}= enp2s0 enp3s0
45-
46-
47-
*** Keywords ***
48-
Power On
49-
[Documentation] Keyword clears telnet buffer and sets Device Under Test
50-
... into Power On state using RTE OC buffers. Implementation
51-
... must be compatible with the theory of operation of a
52-
... specific platform.
53-
Restore Initial DUT Connection Method
54-
IF '${DUT_CONNECTION_METHOD}' == 'SSH' RETURN
55-
Sleep 2s
56-
Rte Power Off
57-
Sleep 10s
58-
Telnet.Read
59-
# After Rte Power Off, the platform cannot be powered back using the power button.
60-
# Possibly bug in HW or FW.
61-
Power Cycle On

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ MarkupSafe==2.1.5
2222
mdurl==0.1.2
2323
nodeenv==1.8.0
2424
oauth2client==4.1.3
25-
osfv @ git+https://github.com/Dasharo/osfv-scripts.git@6f7eb96d2f586e00f0f69d52ac0ed9dfc1208eec#subdirectory=osfv_cli
25+
osfv @ git+https://github.com/Dasharo/osfv-scripts.git@36a030eb006391c3761c25d6972036a5a34fb73b#subdirectory=osfv_cli
2626
paramiko==3.4.0
2727
pathspec==0.9.0
2828
pexpect==4.9.0

0 commit comments

Comments
 (0)