diff options
author | Jani Nikula <jani.nikula@intel.com> | 2016-10-03 16:48:54 +0300 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2016-10-04 09:57:26 +0300 |
commit | 8f3cf597e498e147bede782a6d759400092c640e (patch) | |
tree | 23a4104f1de6073d07c2389e2cb71f29464f366a /tests | |
parent | 1a76d88905995d123ad252087228f6d310c51bdd (diff) |
igt/drv_module_reload_basic: add helper for checking module reloaded
Add a helper for checking whether a module is reloaded, using
lsmod. Also make the grep stricter than before.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/drv_module_reload_basic | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/drv_module_reload_basic b/tests/drv_module_reload_basic index 3bba796f..4f317278 100755 --- a/tests/drv_module_reload_basic +++ b/tests/drv_module_reload_basic @@ -10,6 +10,12 @@ SOURCE_DIR="$( dirname "${BASH_SOURCE[0]}" )" # no other drm service should be running, so we can just unbind +# return 0 if module by name $1 is loaded according to lsmod +function mod_loaded() +{ + lsmod | grep -w "^$1" &> /dev/null +} + function reload() { local snd_hda_intel_unloaded @@ -37,7 +43,7 @@ function reload() { rmmod drm_kms_helper &> /dev/null rmmod drm &> /dev/null - if lsmod | grep i915 &> /dev/null ; then + if mod_loaded i915; then echo WARNING: i915.ko still loaded! return $IGT_EXIT_FAILURE else |