File: tolerate-no-root-mount.diff

package info (click to toggle)
rust-libmount 0.1.15-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 312 kB
  • sloc: makefile: 2
file content (21 lines) | stat: -rw-r--r-- 784 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Description: tolerate lack of / mount.
 Some chroot environments may not have an accessible root mount,
 tolerate this case in the testsuite.
Author: Peter Michael Green <plugwash@debian.org>

--- rust-libmount-0.1.15.orig/src/remount.rs
+++ rust-libmount-0.1.15/src/remount.rs
@@ -375,7 +375,12 @@ mod test {
 
     #[test]
     fn test_get_mountpoint_flags() {
-        assert!(get_mountpoint_flags(Path::new("/")).is_ok());
+        let res = get_mountpoint_flags(Path::new("/"));
+        match res {
+            Ok(v) => {},
+            Err(RemountError::UnknownMountPoint(p)) => assert_eq!(p, Path::new("/")), // in some chroot environments mount point information on the / mountpoint may be unavailable.
+            Err(e) => panic!("{}",e)
+        }
     }
 
     #[test]