| 590 | |
| 591 | #[test] |
| 592 | fn test_sysgroups_parse() -> Result<()> { |
| 593 | let mut entries = SYSGROUPS_REF |
| 594 | .lines() |
| 595 | .filter(|line| !(line.is_empty() || line.starts_with('#'))) |
| 596 | .map(|line| SysusersEntry::parse(line).unwrap().unwrap()); |
| 597 | assert_eq!( |
| 598 | entries.next().unwrap(), |
| 599 | SysusersEntry::Group { |
| 600 | name: "root".into(), |
| 601 | id: Some(0.into()), |
| 602 | } |
| 603 | ); |
| 604 | assert_eq!( |
| 605 | entries.next().unwrap(), |
| 606 | SysusersEntry::Group { |
| 607 | name: "bin".into(), |
| 608 | id: Some(1.into()), |
| 609 | } |
| 610 | ); |
| 611 | assert_eq!(entries.count(), 28); |
| 612 | Ok(()) |
| 613 | } |
| 614 | |
| 615 | fn newroot() -> Result<cap_std_ext::cap_tempfile::TempDir> { |
| 616 | let root = cap_std_ext::cap_tempfile::tempdir(cap_std::ambient_authority())?; |