Skip to content

disks: delete existing test file, if necessary

Sunil Mohan Adapa requested to merge JoKeyser:attemptFixDiskTest into master

Created by: JoKeyser

This is an attempt to fix issue #780 (closed). At least on the vagrant image (not checked elsewhere), this allows the disk test to pass even if they are interrupted for some reason. (I've simulated this by commenting out the cleanup methods in the __exit__ method). In issue #780 (closed), it was proposed to create a new disk file name for every test. However, this PR circumvents the creation of multiple files by simply checking if the disk file exists already, and deleting it if it does. Due to repeated losetups, there are however many loopback devices accumulating in /dev/loop* after multiple tests, which seems fine.

Edit: More explanation, simplified the file-check.

Merge request reports

Loading