Skip to content

Commit c35aab7

Browse files
committed
zarhus: zarhus-provisioning: Add tests for preparation and cukinia
Signed-off-by: Michał Iwanicki <michal.iwanicki@3mdeb.com>
1 parent 1d13434 commit c35aab7

File tree

2 files changed

+106
-0
lines changed

2 files changed

+106
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
*** Settings ***
2+
Library Collections
3+
Library Dialogs
4+
Library OperatingSystem
5+
Library Process
6+
Library String
7+
Library Telnet timeout=20 seconds connection_timeout=120 seconds
8+
Library SSHLibrary timeout=90 seconds
9+
Library RequestsLibrary
10+
Resource ../keywords.robot
11+
Resource ../keys.robot
12+
Resource ../variables.robot
13+
Resource ../lib/zarhus-provision-lib.robot
14+
15+
Suite Setup Run Keywords
16+
... Prepare Test Suite
17+
... AND
18+
... Skip If '${MANUFACTURER}' == 'QEMU'
19+
... AND
20+
... Prepare ZPB OS
21+
Suite Teardown Run Keyword
22+
... Log Out And Close Connection
23+
Test Setup Run Keyword If ${TESTS_IN_FIRMWARE_SUPPORT}
24+
... Restore Initial DUT Connection Method
25+
26+
27+
*** Test Cases ***
28+
ZPBP001.101 Make sure that network boot is disabled
29+
[Documentation] Make sure that Network Boot is disabled
30+
${state}= Get UEFI Option NetworkBoot
31+
Should Not Be True ${state}
32+
33+
ZPBP002.101 Make sure that BIOS boot medium is locked
34+
[Documentation] Make sure that BIOS boot medium is locked
35+
${state}= Get UEFI Option LockBios
36+
Should Be True ${state}
37+
38+
ZPBP003.101 Make sure that SMM BIOS write protection is enabled
39+
[Documentation] Make sure that SMM BIOS write protection is enabled
40+
${state}= Get UEFI Option SmmBwp
41+
Should Be True ${state}
42+
43+
ZPBP004.101 Make sure that Intel ME is HAP disabled
44+
[Documentation] Make sure that Intel ME is HAP disabled
45+
${state}= Get UEFI Option MeMode
46+
Should Be Equal ${state} Disabled (HAP)
47+
48+
ZPBP005.101 Make sure that OptionROM loading is disabled
49+
[Documentation] Make sure that Network Boot is disabled
50+
${state}= Get UEFI Option OptionROMExecutionPolicy
51+
Should Contain ${state} Disable all OptionROMs
52+
53+
ZPBP006.206 Make sure that zarhus status returns expected initial state
54+
[Documentation] Make sure that `zarhus status` returns information that
55+
... BootGuard and Secure Boot is disabled and that Fusing state is
56+
... unknown
57+
Boot Zarhus OS
58+
${output}= Execute Command In Terminal zarhus status
59+
Should Contain ${output} Boot Guard: Disabled
60+
Should Contain ${output} Secure Boot: Disabled
61+
Should Contain ${output} Fusing state: Unknown (ME may be disabled)
62+
63+
ZPBP007.206 Make sure that Secure Boot is in Setup Mode
64+
[Documentation] Make sure that Secure Boot is in Setup Mode which means
65+
... it can be provisioned from OS
66+
Boot Zarhus OS
67+
${output}= Execute Command In Terminal sbctl status
68+
@{lines}= Split To Lines ${output}
69+
FOR ${line} IN @{lines}
70+
${status}= Run Keyword And Return Status
71+
... Should Match ${line} Setup Mode:*Enabled
72+
IF ${status} Pass Execution Secure Boot is in Setup Mode
73+
END
74+
Fail Couldn't find 'Setup Mode: *Enabled' string
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
*** Settings ***
2+
Library Collections
3+
Library Dialogs
4+
Library OperatingSystem
5+
Library Process
6+
Library String
7+
Library Telnet timeout=20 seconds connection_timeout=120 seconds
8+
Library SSHLibrary timeout=90 seconds
9+
Library RequestsLibrary
10+
Resource ../keywords.robot
11+
Resource ../keys.robot
12+
Resource ../variables.robot
13+
Resource ../lib/zarhus-provision-lib.robot
14+
15+
Suite Setup Run Keywords
16+
... Prepare Test Suite
17+
... AND
18+
... Prepare ZPB OS
19+
... AND
20+
... Setup ZPB
21+
Suite Teardown Run Keywords
22+
... Teardown ZPB Test Suite
23+
... AND
24+
... Log Out And Close Connection
25+
Test Setup Run Keyword If ${TESTS_IN_FIRMWARE_SUPPORT}
26+
... Restore Initial DUT Connection Method
27+
28+
29+
*** Test Cases ***
30+
ZPB001.206 Make sure that cukinia tests pass
31+
Boot Zarhus OS
32+
Execute Command In Terminal With Sudo cukinia

0 commit comments

Comments
 (0)