summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pm_rpm.c10
-rw-r--r--tests/vgem_basic.c3
2 files changed, 10 insertions, 3 deletions
diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c
index e5475c91..3b88348a 100644
--- a/tests/pm_rpm.c
+++ b/tests/pm_rpm.c
@@ -26,6 +26,7 @@
*/
#include "igt.h"
+#include "igt_kmod.h"
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
@@ -111,6 +112,11 @@ struct modeset_params *default_mode_params;
static int8_t *pm_data = NULL;
+static int modprobe(const char *driver)
+{
+ return igt_kmod_load(driver, "");
+}
+
/* If the read fails, then the machine doesn't support PC8+ residencies. */
static bool supports_pc8_plus_residencies(void)
{
@@ -647,7 +653,7 @@ static void setup_pc8(void)
return;
/* Make sure our Kernel supports MSR and the module is loaded. */
- igt_require(system("modprobe -s msr") == 0);
+ igt_require(modprobe("msr") == 0);
msr_fd = open("/dev/cpu/0/msr", O_RDONLY);
igt_assert_f(msr_fd >= 0,
@@ -793,7 +799,7 @@ static void i2c_subtest_check_environment(void)
struct dirent *dirent;
/* Make sure the /dev/i2c-* files exist. */
- igt_require(system("modprobe -s i2c-dev") == 0);
+ igt_require(modprobe("i2c-dev") == 0);
dev_dir = opendir("/dev");
igt_assert(dev_dir);
diff --git a/tests/vgem_basic.c b/tests/vgem_basic.c
index 5b54a4a3..cce9229f 100644
--- a/tests/vgem_basic.c
+++ b/tests/vgem_basic.c
@@ -22,6 +22,7 @@
*/
#include "igt.h"
+#include "igt_kmod.h"
#include "igt_vgem.h"
#include "igt_debugfs.h"
#include "igt_sysfs.h"
@@ -290,7 +291,7 @@ static void test_debugfs_read(int fd)
static int module_unload(void)
{
- return system("/sbin/modprobe -s -r vgem");
+ return igt_kmod_unload("vgem", 0);
}
static void test_unload(void)