mardi 15 octobre 2019

How to mock a mounted partition in Python

I'm working on a task that operates on a mounted partition when it has reached a certain percentage used, i.e. when 90% of the parition has been allocated, perform task X.

In order to test this, i'd like to be able to stub out a volume with a given size, so I can fill it with garbage up to the point that task X is carried out, so I can make sure it's doing what it's supposed to do. Is this even possible? I'm using python 2.7 on linux.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire