brintos

brintos / linux-shallow public Read only

0
0
Text · 754 B · 874c119 Raw
46 lines · bash
1#!/bin/sh2# SPDX-License-Identifier: GPL-2.0-only3 4. ./eeh-functions.sh5 6eeh_test_prep # NB: may exit7 8vf_list="$(eeh_enable_vfs)";9if $? != 0 ; then10	log "No usable VFs found. Skipping EEH unaware VF test"11	exit $KSELFTESTS_SKIP;12fi13 14log "Enabled VFs: $vf_list"15 16tested=017passed=018for vf in $vf_list ; do19	log "Testing $vf"20 21	if ! eeh_can_recover $vf ; then22		log "Driver for $vf doesn't support error recovery, skipping"23		continue;24	fi25 26	tested="$((tested + 1))"27 28	log "Breaking $vf..."29	if ! eeh_one_dev $vf ; then30		log "$vf failed to recover"31		continue;32	fi33 34	passed="$((passed + 1))"35done36 37eeh_disable_vfs38 39if [ "$tested" == 0 ] ; then40	echo "No VFs with EEH aware drivers found, skipping"41	exit $KSELFTESTS_SKIP42fi43 44test "$failed" != 045exit $?;46