# 3GiB volume
fs_img = mk_fs(u_boot_config, fs_type, 0xc0000000, '3GB')
+ except CalledProcessError as err:
+ pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.format(err))
+ return
- # Mount the image so we can populate it.
+ try:
check_call('mkdir -p %s' % mount_dir, shell=True)
+ except CalledProcessError as err:
+ pytest.skip('Preparing mount folder failed for filesystem: ' + fs_type + '. {}'.format(err))
+ return
+ finally:
+ call('rm -f %s' % fs_img, shell=True)
+
+ try:
+ # Mount the image so we can populate it.
mount_fs(fs_type, fs_img, mount_dir)
# Create a subdirectory.
% big_file, shell=True).decode()
md5val.append(out.split()[0])
- umount_fs(mount_dir)
except CalledProcessError as err:
- pytest.skip('Setup failed for filesystem: ' + fs_type + \
- '. {}'.format(err))
+ pytest.skip('Setup failed for filesystem: ' + fs_type + '. {}'.format(err))
return
else:
yield [fs_ubtype, fs_img, md5val]
finally:
umount_fs(mount_dir)
call('rmdir %s' % mount_dir, shell=True)
- if fs_img:
- call('rm -f %s' % fs_img, shell=True)
+ call('rm -f %s' % fs_img, shell=True)
#
# Fixture for extended fs test
# 128MiB volume
fs_img = mk_fs(u_boot_config, fs_type, 0x8000000, '128MB')
+ except CalledProcessError as err:
+ pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.format(err))
+ return
- # Mount the image so we can populate it.
+ try:
check_call('mkdir -p %s' % mount_dir, shell=True)
+ except CalledProcessError as err:
+ pytest.skip('Preparing mount folder failed for filesystem: ' + fs_type + '. {}'.format(err))
+ return
+ finally:
+ call('rm -f %s' % fs_img, shell=True)
+
+ try:
+ # Mount the image so we can populate it.
mount_fs(fs_type, fs_img, mount_dir)
# Create a test directory
md5val.append(out.split()[0])
check_call('rm %s' % tmp_file, shell=True)
- umount_fs(mount_dir)
except CalledProcessError:
pytest.skip('Setup failed for filesystem: ' + fs_type)
return
finally:
umount_fs(mount_dir)
call('rmdir %s' % mount_dir, shell=True)
- if fs_img:
- call('rm -f %s' % fs_img, shell=True)
+ call('rm -f %s' % fs_img, shell=True)
#
# Fixture for mkdir test
fs_img = mk_fs(u_boot_config, fs_type, 0x8000000, '128MB')
except:
pytest.skip('Setup failed for filesystem: ' + fs_type)
+ return
else:
yield [fs_ubtype, fs_img]
- finally:
- if fs_img:
- call('rm -f %s' % fs_img, shell=True)
+ call('rm -f %s' % fs_img, shell=True)
#
# Fixture for unlink test
# 128MiB volume
fs_img = mk_fs(u_boot_config, fs_type, 0x8000000, '128MB')
+ except CalledProcessError as err:
+ pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.format(err))
+ return
- # Mount the image so we can populate it.
+ try:
check_call('mkdir -p %s' % mount_dir, shell=True)
+ except CalledProcessError as err:
+ pytest.skip('Preparing mount folder failed for filesystem: ' + fs_type + '. {}'.format(err))
+ return
+ finally:
+ call('rm -f %s' % fs_img, shell=True)
+
+ try:
+ # Mount the image so we can populate it.
mount_fs(fs_type, fs_img, mount_dir)
# Test Case 1 & 3
check_call('dd if=/dev/urandom of=%s/dir5/file1 bs=1K count=1'
% mount_dir, shell=True)
- umount_fs(mount_dir)
except CalledProcessError:
pytest.skip('Setup failed for filesystem: ' + fs_type)
return
finally:
umount_fs(mount_dir)
call('rmdir %s' % mount_dir, shell=True)
- if fs_img:
- call('rm -f %s' % fs_img, shell=True)
+ call('rm -f %s' % fs_img, shell=True)
#
# Fixture for symlink fs test
try:
- # 3GiB volume
+ # 1GiB volume
fs_img = mk_fs(u_boot_config, fs_type, 0x40000000, '1GB')
+ except CalledProcessError as err:
+ pytest.skip('Creating failed for filesystem: ' + fs_type + '. {}'.format(err))
+ return
- # Mount the image so we can populate it.
+ try:
check_call('mkdir -p %s' % mount_dir, shell=True)
+ except CalledProcessError as err:
+ pytest.skip('Preparing mount folder failed for filesystem: ' + fs_type + '. {}'.format(err))
+ return
+ finally:
+ call('rm -f %s' % fs_img, shell=True)
+
+ try:
+ # Mount the image so we can populate it.
mount_fs(fs_type, fs_img, mount_dir)
# Create a subdirectory.
% medium_file, shell=True).decode()
md5val.extend([out.split()[0]])
- umount_fs(mount_dir)
except CalledProcessError:
pytest.skip('Setup failed for filesystem: ' + fs_type)
return
finally:
umount_fs(mount_dir)
call('rmdir %s' % mount_dir, shell=True)
- if fs_img:
- call('rm -f %s' % fs_img, shell=True)
+ call('rm -f %s' % fs_img, shell=True)