• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NVIDIA / nvrc / 20359643527

19 Dec 2025 04:16AM UTC coverage: 77.064% (+48.4%) from 28.618%
20359643527

Pull #84

github

web-flow
Merge 3e5c89ae7 into 5b8b670d9
Pull Request #84: NVRC complete code coverage

67 of 88 new or added lines in 10 files covered. (76.14%)

16 existing lines in 5 files now uncovered.

252 of 327 relevant lines covered (77.06%)

1.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

66.67
/src/modprobe.rs
1
use crate::execute::foreground;
2
use anyhow::Result;
3

4
const MODPROBE: &str = "/sbin/modprobe";
5

6
/// Load a kernel module via modprobe.
7
/// Used to load GPU drivers (nvidia, nvidia-uvm) during init.
8
pub fn load(module: &str) -> Result<()> {
1✔
9
    foreground(MODPROBE, &[module])
2✔
10
}
11

12
/// Reload NVIDIA modules to pick up configuration changes.
13
/// Used after nvidia-smi adjusts GPU settings (clocks, power limits)
14
/// that require a module reload to take effect.
15
pub fn reload_nvidia_modules() -> Result<()> {
1✔
16
    foreground(MODPROBE, &["-r", "nvidia-uvm", "nvidia"])?;
1✔
NEW
17
    load("nvidia")?;
×
NEW
18
    load("nvidia-uvm")
×
19
}
20

21
#[cfg(test)]
22
mod tests {
23
    use super::*;
24
    use crate::test_utils::require_root;
25

26
    // Test with real kernel modules commonly available on Linux.
27

28
    #[test]
29
    fn test_load_loop() {
30
        require_root();
31
        // 'loop' module is almost always available (loop devices)
32
        assert!(load("loop").is_ok());
33
    }
34

35
    #[test]
36
    fn test_load_dummy() {
37
        require_root();
38
        // 'dummy' creates a dummy network interface - safe to load
39
        assert!(load("dummy").is_ok());
40
    }
41

42
    #[test]
43
    fn test_load_nonexistent() {
44
        require_root();
45
        // Should fail for a module that doesn't exist
46
        assert!(load("nonexistent_module_xyz123").is_err());
47
    }
48

49
    #[test]
50
    fn test_reload_fails_without_hardware() {
51
        require_root();
52
        // Will fail: no nvidia modules on systems without NVIDIA
53
        let _ = reload_nvidia_modules();
54
    }
55
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc