Files
neon/test_runner/fixtures/overlayfs.py
2024-01-05 13:17:28 +00:00

12 lines
338 B
Python

from typing import Iterator
import psutil
from pathlib import Path
def iter_mounts_beneath(topdir: Path) -> Iterator[Path]:
for part in psutil.disk_partitions(all=True):
if part.fstype == "overlay":
mountpoint = Path(part.mountpoint)
if topdir in mountpoint.parents:
yield mountpoint