Skip to content

Commit 816284c

Browse files
authored
Merge pull request #63 from Dasharo/optimize-hcl-report
Optimize hcl report execution time.
2 parents 143964b + e69ca6c commit 816284c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

include/hal/common-mock-func.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ TEST_TOUCHPAD_PATH="${TEST_TOUCHPAD_PATH:-}"
406406
TEST_AC_PRESENT="${TEST_AC_PRESENT:-}"
407407
TEST_MEI_CONF_PRESENT="${TEST_MEI_CONF_PRESENT:-true}"
408408
TEST_INTEL_FUSE_STATUS="${TEST_INTEL_FUSE_STATUS:-0}"
409+
TEST_SOUND_CARD_PRESENT="${TEST_SOUND_CARD_PRESENT:-true}"
409410

410411
fsread_tool_common_mock(){
411412
# This functionn emulates read hardware specific file system resources or its
@@ -445,6 +446,11 @@ fsread_tool_test_mock(){
445446
[ "$TEST_AC_PRESENT" = "true" ] && return 0
446447
fi
447448

449+
if [ "$_arg_f" = "/sys/class/sound/card0/hw*/init_pin_configs" ] || [ "$_arg_f" = "/proc/asound/card0/codec#*" ]; then
450+
# Emulate sound card presence, check dasharo-hcl-report for more inf.:
451+
[ "$TEST_SOUND_CARD_PRESENT" = "true" ] && return 0
452+
fi
453+
448454
return 1
449455
}
450456

include/hal/dts-hal.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ cap_upd_tool(){
181181

182182
check_if_heci_present(){
183183
# FIXME: what if HECI is not device 16.0?
184-
$FSREAD_TOOL test_mock test -d /sys/class/pci_bus/0000:00/device/0000:00:16.0
184+
$FSREAD_TOOL test -d /sys/class/pci_bus/0000:00/device/0000:00:16.0
185185

186186
return $?
187187
}

reports/dasharo-hcl-report

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ do
141141
SND_HW_FILE=`echo $SND_HW_FILES | cut -d ' ' -f 1`
142142
SND_CODEC_FILE=`echo $SND_CODEC_FILES | cut -d ' ' -f 1`
143143

144-
if [ -f "$SND_HW_FILE" ] && [ -f "$SND_CODEC_FILE" ]; then
144+
if $FSREAD_TOOL test -f "$SND_HW_FILE" && $FSREAD_TOOL test -f "$SND_CODEC_FILE"; then
145145
break
146146
else
147147
sleep 5

0 commit comments

Comments
 (0)