tests/extmod: Make some vfs tests fully unmount FSs before running.
Otherwise the existing FSs can interfere with the tests, and in some cases the tests can write to the real FS on the device.
This commit is contained in:
parent
d00d062af2
commit
9bd67d9fbc
|
@ -47,6 +47,10 @@ class Filesystem:
|
|||
|
||||
|
||||
# first we umount any existing mount points the target may have
|
||||
try:
|
||||
uos.umount('/')
|
||||
except OSError:
|
||||
pass
|
||||
for path in uos.listdir('/'):
|
||||
uos.umount('/' + path)
|
||||
|
||||
|
|
|
@ -44,6 +44,14 @@ except MemoryError:
|
|||
print("SKIP")
|
||||
sys.exit()
|
||||
|
||||
# first we umount any existing mount points the target may have
|
||||
try:
|
||||
uos.umount('/')
|
||||
except OSError:
|
||||
pass
|
||||
for path in uos.listdir('/'):
|
||||
uos.umount('/' + path)
|
||||
|
||||
uos.VfsFat.mkfs(bdev)
|
||||
uos.mount(bdev, '/')
|
||||
|
||||
|
|
Loading…
Reference in New Issue