summaryrefslogtreecommitdiff
path: root/test/test_kmod
diff options
context:
space:
mode:
authorAlan Somers <asomers@gmail.com>2020-05-31 15:17:16 -0600
committerAlan Somers <asomers@gmail.com>2020-05-31 19:07:15 -0600
commit1ae5dd8b16aed61958fd3ce488ed7fd459743652 (patch)
tree17c28555c9b2cd3db3741dcd28b7401d08ad3678 /test/test_kmod
parent84e66d7a29234d16d62c5fa5bc5b66ad5504c2a2 (diff)
downloadnix-1ae5dd8b16aed61958fd3ce488ed7fd459743652.zip
Convert the crate to edition 2018
Diffstat (limited to 'test/test_kmod')
-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());