summaryrefslogtreecommitdiff
path: root/test/test_kmod/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_kmod/mod.rs')
-rw-r--r--test/test_kmod/mod.rs30
1 files changed, 15 insertions, 15 deletions
diff --git a/test/test_kmod/mod.rs b/test/test_kmod/mod.rs
index ad406357..e7472ab8 100644
--- a/test/test_kmod/mod.rs
+++ b/test/test_kmod/mod.rs
@@ -4,7 +4,7 @@ use std::process::Command;
use tempfile::{tempdir, TempDir};
fn compile_kernel_module() -> (PathBuf, String, TempDir) {
- let _m = ::FORK_MTX
+ let _m = crate::FORK_MTX
.lock()
.expect("Mutex got poisoned by another test");
@@ -41,8 +41,8 @@ use std::io::Read;
#[test]
fn test_finit_and_delete_module() {
require_capability!(CAP_SYS_MODULE);
- let _m0 = ::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
- let _m1 = ::CWD_LOCK.read().expect("Mutex got poisoned by another test");
+ let _m0 = crate::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m1 = crate::CWD_LOCK.read().expect("Mutex got poisoned by another test");
let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module();
@@ -59,8 +59,8 @@ fn test_finit_and_delete_module() {
#[test]
fn test_finit_and_delete_modul_with_params() {
require_capability!(CAP_SYS_MODULE);
- let _m0 = ::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
- let _m1 = ::CWD_LOCK.read().expect("Mutex got poisoned by another test");
+ let _m0 = crate::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m1 = crate::CWD_LOCK.read().expect("Mutex got poisoned by another test");
let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module();
@@ -80,8 +80,8 @@ fn test_finit_and_delete_modul_with_params() {
#[test]
fn test_init_and_delete_module() {
require_capability!(CAP_SYS_MODULE);
- let _m0 = ::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
- let _m1 = ::CWD_LOCK.read().expect("Mutex got poisoned by another test");
+ let _m0 = crate::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m1 = crate::CWD_LOCK.read().expect("Mutex got poisoned by another test");
let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module();
@@ -100,8 +100,8 @@ fn test_init_and_delete_module() {
#[test]
fn test_init_and_delete_module_with_params() {
require_capability!(CAP_SYS_MODULE);
- let _m0 = ::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
- let _m1 = ::CWD_LOCK.read().expect("Mutex got poisoned by another test");
+ let _m0 = crate::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m1 = crate::CWD_LOCK.read().expect("Mutex got poisoned by another test");
let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module();
@@ -121,8 +121,8 @@ fn test_init_and_delete_module_with_params() {
#[test]
fn test_finit_module_invalid() {
require_capability!(CAP_SYS_MODULE);
- let _m0 = ::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
- let _m1 = ::CWD_LOCK.read().expect("Mutex got poisoned by another test");
+ let _m0 = crate::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m1 = crate::CWD_LOCK.read().expect("Mutex got poisoned by another test");
let kmod_path = "/dev/zero";
@@ -135,8 +135,8 @@ fn test_finit_module_invalid() {
#[test]
fn test_finit_module_twice_and_delete_module() {
require_capability!(CAP_SYS_MODULE);
- let _m0 = ::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
- let _m1 = ::CWD_LOCK.read().expect("Mutex got poisoned by another test");
+ let _m0 = crate::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m1 = crate::CWD_LOCK.read().expect("Mutex got poisoned by another test");
let (kmod_path, kmod_name, _kmod_dir) = compile_kernel_module();
@@ -157,8 +157,8 @@ fn test_finit_module_twice_and_delete_module() {
#[test]
fn test_delete_module_not_loaded() {
require_capability!(CAP_SYS_MODULE);
- let _m0 = ::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
- let _m1 = ::CWD_LOCK.read().expect("Mutex got poisoned by another test");
+ let _m0 = crate::KMOD_MTX.lock().expect("Mutex got poisoned by another test");
+ let _m1 = crate::CWD_LOCK.read().expect("Mutex got poisoned by another test");
let result = delete_module(&CString::new("hello").unwrap(), DeleteModuleFlags::empty());