Skip to content

Commit 53c4d5a

Browse files
committed
test-case: check-audio-equalizer.sh: Restore config after test
Signed-off-by: Pawel Langowski <pawelx.langowski@intel.com>
1 parent 5124961 commit 53c4d5a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test-case/check-audio-equalizer.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ func_test_eq()
5151
local id=$1
5252
local conf=$2
5353
local double_quoted_id=\""$id"\"
54+
local default_conf="/tmp/default_${id}.txt"
55+
56+
sof-ctl -Dhw:"$sofcard" -c name="$double_quoted_id" | tail -n1 > "$default_conf"
5457

5558
dlogc "sof-ctl -Dhw:$sofcard -c name=$double_quoted_id -s $conf"
5659
sof-ctl -Dhw:"$sofcard" -c name="$double_quoted_id" -s "$conf" || {
@@ -59,10 +62,13 @@ func_test_eq()
5962
}
6063

6164
dlogc "$cmd -D $dev -f $fmt -c $channel -r $rate -d $duration $dummy_file"
62-
$cmd -D "$dev" -f "$fmt" -c "$channel" -r "$rate" -d "$duration" "$dummy_file" || {
65+
$cmd -D "$dev" -f "$fmt" -c "$channel" -r "$rate" -d "$duration" "$dummy_file"
66+
ret=$?
67+
sof-ctl -Dhw:"$sofcard" -c name="$double_quoted_id" -s "$default_conf"
68+
if [ $ret -ne 0 ]; then
6369
dloge "Equalizer test failure with $conf"
6470
return 1
65-
}
71+
fi
6672
sleep 1
6773
}
6874

0 commit comments

Comments
 (0)