xref: /linux/tools/testing/selftests/drivers/sdsi/sdsi.sh (revision 5e0266f0e5f57617472d5aac4013f58a3ef264ac)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# Runs tests for the intel_sdsi driver
4
5if ! command -v python3 > /dev/null 2>&1; then
6	echo "drivers/sdsi: [SKIP] python3 not installed"
7	exit 77
8fi
9
10if ! python3 -c "import pytest" > /dev/null 2>&1; then
11	echo "drivers/sdsi: [SKIP] pytest module not installed"
12	exit 77
13fi
14
15if ! /sbin/modprobe -q -r intel_sdsi; then
16	echo "drivers/sdsi: [SKIP]"
17	exit 77
18fi
19
20if /sbin/modprobe -q intel_sdsi && python3 -m pytest sdsi_test.py; then
21	echo "drivers/sdsi: [OK]"
22else
23	echo "drivers/sdsi: [FAIL]"
24	exit 1
25fi
26