Skip to content

Commit a4d14f0

Browse files
committed
mock: amdtool: mock exit status
Add mockup funtion for amdtool to simualte failures on intel platform. This is to be consistant with hardware behavior. Signed-off-by: Mateusz Kusiak <[email protected]>
1 parent 1895194 commit a4d14f0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

include/hal/common-mock-func.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,3 +770,18 @@ mei-amt-check_common_mock() {
770770
return 1
771771
fi
772772
}
773+
774+
################################################################################
775+
# amdtool
776+
################################################################################
777+
778+
amdtool_on_intel_mock() {
779+
# lowercase
780+
local cpu="${TEST_CPU_VERSION,,}"
781+
782+
if [[ "$cpu" == *amd* \
783+
|| "$cpu" == *advanced\ micro\ devices* ]]; then
784+
return 0
785+
fi
786+
return 1
787+
}

reports/dasharo-hcl-report.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ update_result "Intel configuration registers" logs/inteltool.err.log
145145
progress_bar_update
146146

147147
# echo "Dumping AMD configuration registers..."
148-
$AMDTOOL -a >logs/amdtool.log 2>logs/amdtool.err.log
148+
$AMDTOOL on_intel_mock -a >logs/amdtool.log 2>logs/amdtool.err.log
149149
update_result "AMD configuration registers" logs/amdtool.err.log
150150
progress_bar_update
151151

0 commit comments

Comments
 (0)