BIOS Operations BIOS/UEFI configuration and management commands.
Expecting a failure Several of these commands take a should_fail flag. It asserts that the
target refused the operation , which is how you test that firmware rejects a
signature it should not accept.
Only the target can satisfy it. If the step never reaches the target the step
fails, whatever should_fail says:
a key_path or cert_path that does not exist, or holds something that is
not a valid key or certificate a parameter the command needs but the description does not set an SSH connection that could not be opened, or that dropped the step timeout expiring The log says which of the two happened:
✓ the target refused to update the enrolled certificate, as expected. The certificate configuration is unchanged. ✗ bios certificate 'update' never reached the target: failed to load certificate: x509: malformed certificate
should_fail expects the target to refuse the operation, and it was never asked A step that expects a rejection and gets one for the wrong reason proves
nothing, so the second case is reported as a failure rather than counted as
the refusal.
BIOS Certificate Check BIOS Options on the DUT.
Attribute Type Required Default Description cmdconstYes bios certificate managementCommand Name namestringYes Name to uniquely identify the teststep. This name will show up in reports, logs and the WebUI transportTransportObjectYes Additional transport options optionsOptionsObjectNo Additional command options parametersBIOS Certificate OptionsYes Options passed into BIOS Certificate
BIOS Certificate Options Attribute Type Required Default Description passwordstringEither of* BIOS Password old_passwordstringEither of* Old BIOS Password cert_pathstringEither of* BIOS Certificate key_pathstringEither of* BIOS Certificate Private Key serialstringEither of* Serial number of device expectBIOS Certificate Expect OptionsNo Array of expected BIOS Certificate Options
BIOS Certificate Expect Options Attribute Type Required Default Description should_failboolNo falseExpect the firmware to refuse the operation. See Expecting a failure .
BIOS Certificate Example - cmd : bios certificate management
name : Enable certificate
transport : *transport
parameters :
command : enable
password : mypassword
cert_path : /root/default-tools/system-suite/4k/new/cert.pem
- cmd : bios certificate management
name : Check certificate thumbprint
transport : *transport
parameters :
command : check
cert_path : /root/default-tools/system-suite/4k/new/cert.pem
- cmd : bios certificate management
name : Disable certificate
transport : *transport
parameters :
command : disable
key_path : /root/default-tools/system-suite/4k/new/key.pem
password : mypassword
- cmd : bios certificate management
name : Clear certificate
transport : *transport
parameters :
command : clear
key_path : /root/default-tools/system-suite/4k/new/key.pem
- cmd : bios certificate management
name : Update password
transport : *transport
parameters :
command : set-password
old_password : mypassword
password : mynewpassword BIOS Settings Get Check BIOS Options on the DUT.
Attribute Type Required Default Description cmdconstYes get bios settingCommand Name namestringYes Name to uniquely identify the teststep. This name will show up in reports, logs and the WebUI transportTransportObjectYes Additional transport options optionsOptionsObjectNo Additional command options parametersBIOS Settings Get OptionsYes Options passed into BIOS Settings Get
BIOS Settings Get Options BIOS Settings Get Expect Options Attribute Type Required Default Description optionstringYes BIOS Option valuestringYes Expected Value (supports regex)
BIOS Settings Get Example cmd : get bios setting
name : "Check BIOS Settings"
transport : *transport
parameters :
expect :
- option : BootDisplayDevice
value : LCD
- option : BootMode
value : Quick
- option : BootOrderLock
value : Disable BIOS Settings Set Try to set BIOS Options on the DUT.
Attribute Type Required Default Description cmdconstYes set bios settingCommand Name namestringYes Name to uniquely identify the teststep. This name will show up in reports, logs and the WebUI transportTransportObjectYes Additional transport options optionsOptionsObjectNo Additional command options parametersBIOS Settings Set OptionsYes Options passed into BIOS Settings Set
BIOS Settings Set Options Attribute Type Required Default Description passwordstringNo BIOS Password key_pathstringNo BIOS Cert Key bios_options[]BIOS OptionsYes Array of BIOS Options to set
BIOS Options Attribute Type Required Default Description optionstringYes BIOS Option valuestringYes Value to set should_failboolNo falseExpect the firmware to refuse this write. See Expecting a failure .
BIOS Settings Set Example cmd : set bios setting
name : "Set Target BIOS Settings"
transport : *transport
parameters :
password : <bios-password>
bios_options :
- option : AlwaysOnUSB
value : Disable
- option : FingerprintPasswordAuthentication
value : Disable SecureBoot Management Run different commands, based on sbctl on the DUT.
Attribute Type Required Default Description cmdconstYes Secure Boot ManagementCommand Name namestringYes Name to uniquely identify the teststep. This name will show up in reports, logs and the WebUI transportTransportObjectYes Additional transport options optionsOptionsObjectNo Additional command options parametersSecureBoot OptionsYes Options passed into the Secure Boot Management cmd
SecureBoot Options Attribute Type Required Default Description commandstringYes Command to execute. Can be one of: status, enroll-key, rotate-key, reset, custom-key. hierarchystringYes Hierarchy to use for the key. Can be one of: db, dbx, KEK, PK. key_filestringNo Path to the key file used for enroll-key and rotate-key commands. custom_key_filestringNo Path to the custom key file used for custom-key command. cert_filestringNo Path to the certificate file used for enroll-key and rotate-key commands. signing_key_filestringNo Path to the signing key file used for enroll-key and rotate-key commands. signing_cert_filestringNo Path to the signing certificate file used for enroll-key and rotate-key commands. appendbooleanNo falseAppend the key to the existing key database. expectSecureBoot Expect OptionsNo parametersExpectations for the command execution.
SecureBoot Expect Options Attribute Type Required Default Description should_failbooleanNo falseExpect the target to refuse the operation. See Expecting a failure . secure_bootbooleanYes falseIf set to true, the test step will fail if Secure Boot is not enabled. setup_modebooleanYes falseIf set to true, the test step will fail if Secure Boot is not in setup mode.
SecureBoot Management Examples - cmd : Secure Boot Management
name : Check if SetupMode is enabled
transport : *transport
parameters :
command : status
expect :
secure_boot : false
setup_mode : true
- cmd : Secure Boot Management
name : Enroll invalid signed PK key
transport : *transport
parameters :
command : custom-key
hierarchy : PK
custom_key_file : /tmp/sbctl/keys/invalidPK.auth
expect :
should_fail : true
- cmd : Secure Boot Management
name : Enroll db key
transport : *transport
parameters :
command : enroll-key
hierarchy : db
key_file : /tmp/sbctl/keys/DB.key
cert_file : /tmp/sbctl/keys/DB.crt
signing_key_file : /tmp/sbctl/keys/KEK.key
signing_cert_file : /tmp/sbctl/keys/KEK.crt
append : true
- cmd : Secure Boot Management
name : Rotate db key
transport : *transport
parameters :
command : rotate-key
hierarchy : db
key_file : /tmp/sbctl/keys-new/DB.key
cert_file : /tmp/sbctl/keys-new/DB.crt
signing_key_file : /tmp/sbctl/keys/KEK.key
signing_cert_file : /tmp/sbctl/keys/KEK.crt
- cmd : Secure Boot Management
name : Reset db key
transport : *transport
parameters :
command : reset
hierarchy : db
signing_key_file : /tmp/sbctl/keys/KEK.key
signing_cert_file : /tmp/sbctl/keys/KEK.crt
cert_file : /tmp/sbctl/keys/DB.crt