summaryrefslogtreecommitdiff
path: root/tests/vgem_reload_basic
blob: e47af2f549519c6a5ecf7b06f7e9a592c164c50e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
#
# Testcase: Reload the vgem module
#
# ... we've broken this way too often :(
#

SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )"
. $SOURCE_DIR/drm_getopt.sh

function unload() {
	/sbin/rmmod vgem
	# drm may be used by other devices (nouveau, radeon, udl, etc)
	/sbin/rmmod drm &> /dev/null

	if /sbin/lsmod | grep vgem &> /dev/null ; then
		echo WARNING: vgem.ko still loaded!
		return 1
	fi
}

unload &> /dev/null

/sbin/modprobe -q -n vgem || exit $IGT_EXIT_SKIP

/sbin/modprobe vgem $* || exit $IGT_EXIT_FAILURE
unload || exit $IGT_EXIT_FAILURE