Skip to content

Commit

Permalink
dasharo-security/tpm-support.robot: Refactor TPM version and support …
Browse files Browse the repository at this point in the history
…tests

This commit introduces a new variable TPM_EXPECTED_VERSION to various
platform configs. Then, Verify TPM Version tests are changed to refer
to this new variable.

Signed-off-by: Sebastian Czapla <[email protected]>
  • Loading branch information
SebastianCzapla committed Sep 24, 2024
1 parent d13cd29 commit 8534884
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
27 changes: 20 additions & 7 deletions dasharo-security/tpm-support.robot
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TPM001.001 TPM Support (firmware)
Login To Linux
Switch To Root User
Get Cbmem From Cloud
${out}= Execute Command In Terminal cbmem -L
${out}= Execute Command In Terminal cbmem -1
Should Contain Any ${out} TPM2 log TCPA log

TPM001.002 TPM Support (Ubuntu)
Expand Down Expand Up @@ -69,9 +69,7 @@ TPM002.001 Verify TPM version (firmware)
Boot System Or From Connected Disk ubuntu
Login To Linux
Switch To Root User
Get Cbmem From Cloud
${out}= Execute Command In Terminal cbmem -L
Should Contain Any ${out} TPM2 log TCPA log
Validate Expected TPM In Firmware

TPM002.002 Verify TPM version (Ubuntu)
[Documentation] This test aims to verify that the TPM version is
Expand All @@ -82,9 +80,7 @@ TPM002.002 Verify TPM version (Ubuntu)
Boot System Or From Connected Disk ubuntu
Login To Linux
Switch To Root User
${out}= Execute Command In Terminal cat /sys/class/tpm/tpm0/tpm_version_major
# TPM 2.0 and 1.2
Should Contain Any ${out} 1 2
Validate Expected TPM In Linux

TPM002.003 Verify TPM version (Windows)
[Documentation] This test aims to verify that the TPM version is
Expand Down Expand Up @@ -153,3 +149,20 @@ Validate Any TPM
ELSE
Fail No valid TPM version available.
END

Validate Expected TPM In Linux
[Documentation] Checks if major TPM version matches the expected
... value.
${tpm_ver}= Execute Command In Terminal cat /sys/class/tpm/tpm0/tpm_version_major
IF '${TPM_EXPECTED_VERSION}' != '${tpm_ver}' Fail

Validate Expected TPM In Firmware
Get Cbmem From Cloud
${out}= Execute Command In Terminal cbmem -1
IF '${TPM_EXPECTED_VERSION}' == '1'
Should Contain ${out} TCPA log
ELSE IF '${TPM_EXPECTED_VERSION}' == '2'
Should Contain ${out} TPM2 log
ELSE
Fail
END
1 change: 1 addition & 0 deletions platform-configs/include/msi-z690-common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ ${POWER_CTRL}= sonoff
${FLASH_VERIFY_METHOD}= none
${WIFI_CARD}= ${TBD}
${MAX_CPU_TEMP}= 80
${TPM_EXPECTED_VERSION}= 2

${DMIDECODE_MANUFACTURER}= Micro-Star International Co., Ltd.
${DMIDECODE_VENDOR}= 3mdeb
Expand Down
1 change: 1 addition & 0 deletions platform-configs/include/optiplex-common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ${SETUP_MENU_KEY}= ${F2}
${IPXE_BOOT_ENTRY}= Network Boot and Utilities
${POWER_CTRL}= sonoff
${MAX_CPU_TEMP}= 80
${TPM_EXPECTED_VERSION}= 1

${DMIDECODE_VENDOR}= 3mdeb
${DMIDECODE_FAMILY}= N/A
Expand Down
1 change: 1 addition & 0 deletions platform-configs/include/protectli-vp66xx.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ${DEVICE_AUDIO1}= Alderlake-P HDMI
${DEVICE_AUDIO1_WIN}= High Definition Audio Device
${INITIAL_CPU_FREQUENCY}= 2600
${MAX_CPU_TEMP}= 82
${TPM_EXPECTED_VERSION}= 1

${CPU_P_CORES_MAX}= 2
${CPU_E_CORES_MAX}= 8
Expand Down

0 comments on commit 8534884

Please sign in to comment.