2020-12-02 11:40:42 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-12-16 11:21:43 +00:00
|
|
|
dmi_memory_id="$1"
|
|
|
|
input="$2"
|
|
|
|
expected="$3"
|
2020-12-02 11:40:42 +00:00
|
|
|
|
2020-12-16 11:21:43 +00:00
|
|
|
output=$(mktemp --tmpdir "test-udev-dmi-memory-id.XXXXXXXXXX")
|
2021-09-29 18:30:08 +00:00
|
|
|
# shellcheck disable=SC2064
|
2020-12-16 11:21:43 +00:00
|
|
|
trap "rm '$output'" EXIT INT QUIT PIPE
|
2020-12-02 11:40:42 +00:00
|
|
|
|
2020-12-16 11:21:43 +00:00
|
|
|
(
|
|
|
|
set -x
|
2021-09-29 18:30:08 +00:00
|
|
|
"$dmi_memory_id" -F "$input" >"$output"
|
2020-12-16 11:21:43 +00:00
|
|
|
diff -u "$output" "$expected"
|
|
|
|
)
|