fn test_read_proc_filesystems()

in metalos/metalctl/src/mount.rs [248:307]


    fn test_read_proc_filesystems() -> Result<()> {
        let tmpdir = TempDir::new()?;
        std::fs::create_dir_all(tmpdir.path().join("proc"))?;
        let fake_proc_filesystems_path = tmpdir.path().join("proc/filesystems");
        std::fs::write(
            fake_proc_filesystems_path.clone(),
            b"nodev   sysfs
nodev   rootfs
nodev   ramfs
nodev   bdev
nodev   proc
nodev   cpuset
nodev   cgroup
nodev   cgroup2
nodev   tmpfs
nodev   devtmpfs
nodev   binfmt_misc
nodev   configfs
nodev   debugfs
nodev   tracefs
nodev   securityfs
nodev   sockfs
nodev   dax
nodev   bpf
nodev   pipefs
nodev   hugetlbfs
nodev   devpts
        ext3
        ext2
        ext4
        vfat
        msdos
nodev   overlay
        xfs
nodev   mqueue
        btrfs
nodev   pstore
nodev   autofs
nodev   efivarfs
        fuseblk
nodev   fuse
nodev   fusectl
nodev   rpc_pipefs\n",
        )?;

        assert_eq!(
            parse_proc_file_systems_file(fake_proc_filesystems_path)?,
            vec![
                "ext3".to_string(),
                "ext2".to_string(),
                "ext4".to_string(),
                "vfat".to_string(),
                "msdos".to_string(),
                "xfs".to_string(),
                "btrfs".to_string(),
                "fuseblk".to_string(),
            ]
        );
        Ok(())
    }