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.
pull/3074/head
Damien George 2017-05-09 15:50:40 +10:00
rodzic d00d062af2
commit 9bd67d9fbc
2 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -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)

Wyświetl plik

@ -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, '/')