diff --git a/lib/label/label.c b/lib/label/label.c index c11a040a9..4b18f5682 100644 --- a/lib/label/label.c +++ b/lib/label/label.c @@ -922,6 +922,9 @@ bool dev_write_bytes(struct device *dev, off_t start, size_t len, void *data) { int ret; + if (test_mode()) + return true; + if (!scan_bcache) { if (!dev_open(dev)) return false; @@ -955,6 +958,9 @@ bool dev_write_zeros(struct device *dev, off_t start, size_t len) { int ret; + if (test_mode()) + return true; + if (!scan_bcache) { if (!dev_open(dev)) return false;