-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
thank you for awesome tool. you might consider using "real" BTRFS filesystem fixtures handy some time
def btrfstest_fs_instance(path):
"""create test btrfs filesystem"""
testmount = Path(path)
if testmount.exists():
subprocess.run(f"umount --force --quiet {testmount}", check=False, shell=True)
Path(f"{testmount}.raw").unlink(missing_ok=True)
else:
testmount.mkdir()
subprocess.run(
f"dd if=/dev/zero of={testmount}.raw bs=500M count=1", check=True, shell=True
)
subprocess.run(f"mkfs.btrfs {testmount}.raw", check=True, shell=True)
subprocess.run(f"mount -o loop {testmount}.raw {testmount}", check=True, shell=True)
yield testmount
subprocess.run(f"umount {testmount}", check=True, shell=True)
Path(f"{testmount}.raw").unlink(missing_ok=True)
@pytest.fixture(scope="function")
def btrfstest_fs():
"""yield first test filesystem"""
yield from btrfstest_fs_instance("/tmp/btrfstest")Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request