1#!/bin/sh
2# SPDX-License-Identifier: LGPL-2.1-or-later
3
4set -e
5
6dmi_memory_id="$1"
7input="$2"
8expected="$3"
9
10output=$(mktemp --tmpdir "test-udev-dmi-memory-id.XXXXXXXXXX")
11# shellcheck disable=SC2064
12trap "rm '$output'" EXIT INT QUIT PIPE
13
14(
15    set -x
16    "$dmi_memory_id" -F "$input" >"$output"
17    diff -u "$output" "$expected"
18)
19