test/spdkcli: Fix: Add missing delete_*_bdev methods
Change-Id: I4973e98de2efcaf6e3f816712780745f5e8ae450 Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-on: https://review.gerrithub.io/420547 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com> Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
This commit is contained in:
parent
68c4df0f02
commit
6d4e910f32
@ -273,6 +273,20 @@ class UIAIOBdev(UIBdev):
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
"""
|
||||
Deletes aio bdev from configuration.
|
||||
|
||||
Arguments:
|
||||
name - Is a unique identifier of the aio bdev to be deleted - UUID number or name alias.
|
||||
"""
|
||||
try:
|
||||
self.get_root().delete_aio_bdev(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
||||
class UILvolBdev(UIBdev):
|
||||
def __init__(self, parent):
|
||||
@ -313,6 +327,20 @@ class UILvolBdev(UIBdev):
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
"""
|
||||
Deletes lvol bdev from configuration.
|
||||
|
||||
Arguments:
|
||||
name - Is a unique identifier of the lvol bdev to be deleted - UUID number or name alias.
|
||||
"""
|
||||
try:
|
||||
self.get_root().destroy_lvol_bdev(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
||||
class UINvmeBdev(UIBdev):
|
||||
def __init__(self, parent):
|
||||
@ -336,6 +364,20 @@ class UINvmeBdev(UIBdev):
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
"""
|
||||
Deletes NVMe controller from configuration.
|
||||
|
||||
Arguments:
|
||||
name - Is a unique identifier of the NVMe controller to be deleted.
|
||||
"""
|
||||
try:
|
||||
self.get_root().delete_nvme_controller(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
||||
class UINullBdev(UIBdev):
|
||||
def __init__(self, parent):
|
||||
@ -368,6 +410,20 @@ class UINullBdev(UIBdev):
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
"""
|
||||
Deletes null bdev from configuration.
|
||||
|
||||
Arguments:
|
||||
name - Is a unique identifier of the null bdev to be deleted - UUID number or name alias.
|
||||
"""
|
||||
try:
|
||||
self.get_root().delete_null_bdev(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
||||
class UIErrorBdev(UIBdev):
|
||||
def __init__(self, parent):
|
||||
@ -389,6 +445,20 @@ class UIErrorBdev(UIBdev):
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
"""
|
||||
Deletes error bdev from configuration.
|
||||
|
||||
Arguments:
|
||||
name - Is a unique identifier of the error bdev to be deleted - UUID number or name alias.
|
||||
"""
|
||||
try:
|
||||
self.get_root().delete_error_bdev(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
||||
class UISplitBdev(UIBdev):
|
||||
def __init__(self, parent):
|
||||
@ -435,6 +505,20 @@ class UIPmemBdev(UIBdev):
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
"""
|
||||
Deletes pmem bdev from configuration.
|
||||
|
||||
Arguments:
|
||||
name - Is a unique identifier of the pmem bdev to be deleted - UUID number or name alias.
|
||||
"""
|
||||
try:
|
||||
self.get_root().delete_pmem_bdev(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
||||
class UIRbdBdev(UIBdev):
|
||||
def __init__(self, parent):
|
||||
@ -455,6 +539,20 @@ class UIRbdBdev(UIBdev):
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
"""
|
||||
Deletes rbd bdev from configuration.
|
||||
|
||||
Arguments:
|
||||
name - Is a unique identifier of the rbd bdev to be deleted - UUID number or name alias.
|
||||
"""
|
||||
try:
|
||||
self.get_root().delete_rbd_bdev(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
||||
class UIiSCSIBdev(UIBdev):
|
||||
def __init__(self, parent):
|
||||
@ -523,6 +621,20 @@ class UIVirtioBlkBdev(UIBdev):
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
"""
|
||||
Deletes virtio scsi bdev from configuration.
|
||||
|
||||
Arguments:
|
||||
name - Is a unique identifier of the virtio scsi bdev to be deleted - UUID number or name alias.
|
||||
"""
|
||||
try:
|
||||
self.get_root().remove_virtio_bdev(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
||||
class UIVirtioScsiBdev(UIBdev):
|
||||
def __init__(self, parent):
|
||||
@ -556,7 +668,7 @@ class UIVirtioScsiBdev(UIBdev):
|
||||
|
||||
def ui_command_delete(self, name):
|
||||
try:
|
||||
self.get_root().remove_virtio_scsi_bdev(name=name)
|
||||
self.get_root().remove_virtio_bdev(name=name)
|
||||
except JSONRPCException as e:
|
||||
self.shell.log.error(e.message)
|
||||
|
||||
|
@ -100,6 +100,11 @@ class UIRoot(UINode):
|
||||
response = rpc.lvol.construct_lvol_bdev(self.client, **kwargs)
|
||||
return response
|
||||
|
||||
@verbose
|
||||
def destroy_lvol_bdev(self, **kwargs):
|
||||
response = rpc.lvol.destroy_lvol_bdev(self.client, **kwargs)
|
||||
return response
|
||||
|
||||
@verbose
|
||||
def create_nvme_bdev(self, **kwargs):
|
||||
response = rpc.bdev.construct_nvme_bdev(self.client, **kwargs)
|
||||
@ -154,19 +159,29 @@ class UIRoot(UINode):
|
||||
response = rpc.bdev.construct_pmem_bdev(self.client, **kwargs)
|
||||
return response
|
||||
|
||||
@verbose
|
||||
def delete_pmem_bdev(self, **kwargs):
|
||||
response = rpc.bdev.delete_pmem_bdev(self.client, **kwargs)
|
||||
return response
|
||||
|
||||
@verbose
|
||||
def create_rbd_bdev(self, **kwargs):
|
||||
response = rpc.bdev.construct_rbd_bdev(self.client, **kwargs)
|
||||
return response
|
||||
|
||||
@verbose
|
||||
def delete_rbd_bdev(self, **kwargs):
|
||||
response = rpc.bdev.delete_rbd_bdev(self.client, **kwargs)
|
||||
return response
|
||||
|
||||
@verbose
|
||||
def create_virtio_dev(self, **kwargs):
|
||||
response = rpc.vhost.construct_virtio_dev(self.client, **kwargs)
|
||||
return self.print_array(response)
|
||||
|
||||
@verbose
|
||||
def remove_virtio_scsi_bdev(self, **kwargs):
|
||||
response = rpc.vhost.remove_virtio_scsi_bdev(self.client, **kwargs)
|
||||
def remove_virtio_bdev(self, **kwargs):
|
||||
response = rpc.vhost.remove_virtio_bdev(self.client, **kwargs)
|
||||
return response
|
||||
|
||||
def get_virtio_scsi_devs(self):
|
||||
|
@ -64,7 +64,7 @@ $spdkcli_job "vhost/block delete vhost_blk2" "vhost_blk2"
|
||||
$spdkcli_job "vhost/block delete vhost_blk1" "vhost_blk1"
|
||||
$spdkcli_job "/bdevs/split_disk destruct_split_bdev Nvme0n1" "Nvme0n1p0"
|
||||
$spdkcli_job "/bdevs/aio delete sample" "sample"
|
||||
$spdkcli_job "/bdevs/nvme delete Nvme0n1" "Nvme0n1"
|
||||
$spdkcli_job "/bdevs/nvme delete Nvme0" "Nvme0"
|
||||
$spdkcli_job "/bdevs/null delete null_bdev" "null_bdev"
|
||||
$spdkcli_job "/bdevs/logical_volume delete lvs/lvol" "lvs/lvol"
|
||||
$spdkcli_job "/lvol_stores delete lvs" "lvs"
|
||||
|
Loading…
Reference in New Issue
Block a user