def test_filesystem_create(self): """ Test creating a filesystem. """ pool_name = p_n() pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1]) fs_name = fs_n() self._unittest_command(StratisDbus.fs_create(pool_path, fs_name), dbus.UInt16(0))
def test_filesystem_create(self): """ Test creating a filesystem. """ pool_name = p_n() pool_path = make_test_pool(pool_name, DISKS[0:1]) fs_name = fs_n() (_, return_code, _) = StratisDbus.fs_create(pool_path, fs_name) self.assertEqual(return_code, dbus.UInt16(0))
def test_filesystem_create_specified_size_toosmall(self): """ Test creating a filesystem with a specified size that is too small. """ pool_name = p_n() pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1]) fs_name = fs_n() self._unittest_command( StratisDbus.fs_create(pool_path, fs_name, fs_size="536866816"), dbus.UInt16(1), )
def test_filesystem_create_specified_size(self): """ Test creating a filesystem with a specified size. """ pool_name = p_n() pool_path = make_test_pool(pool_name, StratisCertify.DISKS[0:1]) fs_name = fs_n() self._unittest_command( StratisDbus.fs_create(pool_path, fs_name, fs_size="8796093022208"), dbus.UInt16(0), )
def make_test_filesystem(pool_path, fs_name): """ Create a test filesystem that will later get destroyed :param str pool_path: Object path of a test pool :param str fs_name: Name of the filesystem to be created :return: Object path of the created filesystem """ ( filesystems_created, (array_of_tuples_with_obj_paths_and_names), ), return_code, msg = StratisDbus.fs_create(pool_path, fs_name) assert return_code == 0, "return_code: %s, error_msg: %s" % (return_code, msg) assert filesystems_created, "filesystems_created: %s" % filesystems_created return array_of_tuples_with_obj_paths_and_names[0][0]
def make_test_filesystem(pool_path, fs_name): """ Create a test filesystem that will later get destroyed :param str pool_path: Object path of a test pool :param str fs_name: Name of the filesystem to be created :return: Object path of the created filesystem """ ( (filesystems_created, (array_of_tuples_with_obj_paths_and_names),), return_code, msg, ) = StratisDbus.fs_create(pool_path, fs_name) _raise_error_exception(return_code, msg, filesystems_created) exec_command(["udevadm", "settle"]) return array_of_tuples_with_obj_paths_and_names[0][0]