1
0
Fork 0
qemu/subprojects/libvfio-user/test/test-lspci.sh
Daniel Baumann ea34ddeea6
Adding upstream version 1:10.0.2+ds.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-22 14:27:05 +02:00

28 lines
498 B
Bash
Executable file

#!/bin/bash
#
# There are three different potential outputs on the distributions we test for;
# accept any.
#
LSPCI=../samples/lspci
if ! command -v lspci &> /dev/null
then
exit 77
fi
test -n "$1" && LSPCI="$1"
$LSPCI | lspci -vv -F /dev/stdin >lspci.out
for i in 1 2 3; do
if diff lspci.out $(dirname $0)/lspci.expected.out.$i >/dev/null 2>&1; then
exit 0
fi
done
# we don't match any; let's demonstrate one
diff lspci.out $(dirname $0)/lspci.expected.out.1 >&2
exit 1