Enable test functions for lvol resize. Change-Id: Ia4583af211350054797d2d8441083e582e6e2ab7 Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com> Reviewed-on: https://review.gerrithub.io/395043 Reviewed-by: Maciej Szwed <maciej.szwed@intel.com> Tested-by: SPDK Automated Test System <sys_sgsw@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com>
85 lines
2.4 KiB
Python
Executable File
85 lines
2.4 KiB
Python
Executable File
def construct_lvol_store(client, args):
|
|
params = {'bdev_name': args.bdev_name, 'lvs_name': args.lvs_name}
|
|
if args.cluster_sz:
|
|
params['cluster_sz'] = args.cluster_sz
|
|
return client.call('construct_lvol_store', params)
|
|
|
|
|
|
def rename_lvol_store(client, args):
|
|
params = {
|
|
'old_name': args.old_name,
|
|
'new_name': args.new_name
|
|
}
|
|
return client.call('rename_lvol_store', params)
|
|
|
|
|
|
def construct_lvol_bdev(client, args):
|
|
num_bytes = (args.size * 1024 * 1024)
|
|
params = {'lvol_name': args.lvol_name, 'size': num_bytes}
|
|
if args.thin_provision:
|
|
params['thin_provision'] = args.thin_provision
|
|
if (args.uuid and args.lvs_name) or (not args.uuid and not args.lvs_name):
|
|
print("You need to specify either uuid or name of lvolstore")
|
|
else:
|
|
if args.uuid:
|
|
params['uuid'] = args.uuid
|
|
if args.lvs_name:
|
|
params['lvs_name'] = args.lvs_name
|
|
return client.call('construct_lvol_bdev', params)
|
|
|
|
|
|
def snapshot_lvol_bdev(client, args):
|
|
params = {
|
|
'lvol_name': args.lvol_name,
|
|
'snapshot_name': args.snapshot_name
|
|
}
|
|
return client.call('snapshot_lvol_bdev', params)
|
|
|
|
|
|
def clone_lvol_bdev(client, args):
|
|
params = {
|
|
'snapshot_name': args.snapshot_name,
|
|
'clone_name': args.clone_name
|
|
}
|
|
return client.call('clone_lvol_bdev', params)
|
|
|
|
|
|
def rename_lvol_bdev(client, args):
|
|
params = {
|
|
'old_name': args.old_name,
|
|
'new_name': args.new_name
|
|
}
|
|
return client.call('rename_lvol_bdev', params)
|
|
|
|
|
|
def resize_lvol_bdev(client, args):
|
|
num_bytes = (args.size * 1024 * 1024)
|
|
params = {
|
|
'name': args.name,
|
|
'size': num_bytes,
|
|
}
|
|
return client.call('resize_lvol_bdev', params)
|
|
|
|
|
|
def destroy_lvol_store(client, args):
|
|
params = {}
|
|
if (args.uuid and args.lvs_name) or (not args.uuid and not args.lvs_name):
|
|
print("You need to specify either uuid or name of lvolstore")
|
|
else:
|
|
if args.uuid:
|
|
params['uuid'] = args.uuid
|
|
if args.lvs_name:
|
|
params['lvs_name'] = args.lvs_name
|
|
return client.call('destroy_lvol_store', params)
|
|
|
|
|
|
def get_lvol_stores(client, args):
|
|
params = {}
|
|
if (args.uuid and args.lvs_name):
|
|
print("You can only specify either uuid or name of lvolstore")
|
|
if args.uuid:
|
|
params['uuid'] = args.uuid
|
|
if args.lvs_name:
|
|
params['lvs_name'] = args.lvs_name
|
|
return client.call('get_lvol_stores', params)
|