test/spdkcli: Possibility to remove all lvol stores from lvol_store node
Change-Id: Iced2a79b5d0cfb1aff55c9aec29b7bc68fc3388e Signed-off-by: Pawel Kaminski <pawelx.kaminski@intel.com> Reviewed-on: https://review.gerrithub.io/434796 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
parent
e3a7bf7974
commit
1fa981d178
@ -73,6 +73,12 @@ class UILvolStores(UINode):
|
||||
for lvs in self.get_root().get_lvol_stores():
|
||||
UILvsObj(lvs, self)
|
||||
|
||||
def delete(self, name, uuid):
|
||||
if name is None and uuid is None:
|
||||
self.shell.log.error("Please specify one of the identifiers: "
|
||||
"lvol store name or UUID")
|
||||
self.get_root().delete_lvol_store(lvs_name=name, uuid=uuid)
|
||||
|
||||
def ui_command_create(self, name, bdev_name, cluster_size=None):
|
||||
"""
|
||||
Creates logical volume store on target bdev.
|
||||
@ -102,10 +108,13 @@ class UILvolStores(UINode):
|
||||
name - Friendly name of the logical volume store to be deleted.
|
||||
uuid - UUID number of the logical volume store to be deleted.
|
||||
"""
|
||||
if name is None and uuid is None:
|
||||
self.shell.log.error("Please specify one of the identifiers: "
|
||||
"lvol store name or UUID")
|
||||
self.get_root().delete_lvol_store(lvs_name=name, uuid=uuid)
|
||||
self.delete(name, uuid)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
def ui_command_delete_all(self):
|
||||
for lvs in self._children:
|
||||
self.delete(None, lvs.lvs.uuid)
|
||||
self.get_root().refresh()
|
||||
self.refresh()
|
||||
|
||||
|
@ -8,14 +8,15 @@ o- / ...........................................................................
|
||||
| | o- EE_Malloc4 ...................................................................................... [Size=$(FP)M, Not claimed]
|
||||
| o- iscsi ............................................................................................................ [Bdevs: 0]
|
||||
| o- logical_volume ................................................................................................... [Bdevs: 2]
|
||||
| | o- $(X)-$(X)-$(X)-$(X)-$(X) ................................................. [lvs/lvol$(FP), Size=$(FP)M, Not claimed]
|
||||
| | o- $(X)-$(X)-$(X)-$(X)-$(X) ................................................. [lvs/lvol$(FP), Size=$(FP)M, Not claimed]
|
||||
| o- malloc ........................................................................................................... [Bdevs: 5]
|
||||
| | o- $(X)-$(X)-$(X)-$(X)-$(X) ................................................ [lvs0/lvol$(FP), Size=$(FP)M, Not claimed]
|
||||
| | o- $(X)-$(X)-$(X)-$(X)-$(X) ................................................ [lvs0/lvol$(FP), Size=$(FP)M, Not claimed]
|
||||
| o- malloc ........................................................................................................... [Bdevs: 6]
|
||||
| | o- Malloc0 ............................................................................................. [Size=$(FP)M, Claimed]
|
||||
| | o- Malloc1 ............................................................................................. [Size=$(FP)M, Claimed]
|
||||
| | o- Malloc2 ......................................................................................... [Size=$(FP)M, Not claimed]
|
||||
| | o- Malloc3 ......................................................................................... [Size=$(FP)M, Not claimed]
|
||||
| | o- Malloc4 ............................................................................................. [Size=$(FP)M, Claimed]
|
||||
| | o- Malloc5 ............................................................................................. [Size=$(FP)M, Claimed]
|
||||
| o- null ............................................................................................................. [Bdevs: 2]
|
||||
| | o- null_bdev0 ...................................................................................... [Size=$(FP)M, Not claimed]
|
||||
| | o- null_bdev1 ...................................................................................... [Size=$(FP)M, Not claimed]
|
||||
@ -54,8 +55,9 @@ o- / ...........................................................................
|
||||
| o- iscsi_connections .......................................................................................... [Connections: 0]
|
||||
| o- portal_groups ............................................................................................ [Portal groups: 0]
|
||||
| o- target_nodes .............................................................................................. [Target nodes: 0]
|
||||
o- lvol_stores .................................................................................................. [Lvol stores: 1]
|
||||
| o- lvs ................................................................................................. [Size=$(FP)M, Free=$(FP)M]
|
||||
o- lvol_stores .................................................................................................. [Lvol stores: 2]
|
||||
| o- lvs0 ................................................................................................ [Size=$(FP)M, Free=$(FP)M]
|
||||
| o- lvs1 ............................................................................................... [Size=$(FP)M, Free=$(FP)M]
|
||||
o- nvmf .................................................................................................................... [...]
|
||||
| o- subsystem ................................................................................................... [Subsystems: 1]
|
||||
| | o- nqn.2014-08.org.nvmexpress.discovery ....................................................... [st=Discovery, Allow any host]
|
||||
|
@ -19,6 +19,7 @@ $spdkcli_job "/bdevs/malloc create 32 512 Malloc1" "Malloc1" True
|
||||
$spdkcli_job "/bdevs/malloc create 32 512 Malloc2" "Malloc2" True
|
||||
$spdkcli_job "/bdevs/malloc create 32 4096 Malloc3" "Malloc3" True
|
||||
$spdkcli_job "/bdevs/malloc create 32 4096 Malloc4" "Malloc4" True
|
||||
$spdkcli_job "/bdevs/malloc create 32 4096 Malloc5" "Malloc5" True
|
||||
$spdkcli_job "/bdevs/error create Malloc1" "EE_Malloc1" True
|
||||
$spdkcli_job "/bdevs/error create Malloc4" "EE_Malloc4" True
|
||||
$spdkcli_job "/bdevs/null create null_bdev0 32 512" "null_bdev0" True
|
||||
@ -34,9 +35,10 @@ $spdkcli_job "/bdevs/split_disk split_bdev Nvme0n1 4" "Nvme0n1p0" True
|
||||
timing_exit spdkcli_create_bdevs_config
|
||||
|
||||
timing_enter spdkcli_create_lvols_config
|
||||
$spdkcli_job "/lvol_stores create lvs Malloc0" "lvs" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol0 16 lvs" "lvs/lvol0" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol1 16 lvs" "lvs/lvol1" True
|
||||
$spdkcli_job "/lvol_stores create lvs0 Malloc0" "lvs0" True
|
||||
$spdkcli_job "/lvol_stores create lvs1 Malloc5" "lvs1" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol0 16 lvs0" "lvs0/lvol0" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol1 16 lvs0" "lvs0/lvol1" True
|
||||
timing_exit spdkcli_create_lvols_config
|
||||
|
||||
timing_enter spdkcli_create_vhosts_config
|
||||
@ -81,9 +83,10 @@ $spdkcli_job "/bdevs/aio delete_all" "sample1"
|
||||
$spdkcli_job "/bdevs/nvme delete Nvme0" "Nvme0"
|
||||
$spdkcli_job "/bdevs/null delete null_bdev0" "null_bdev0"
|
||||
$spdkcli_job "/bdevs/null delete_all" "null_bdev1"
|
||||
$spdkcli_job "/bdevs/logical_volume delete lvs/lvol0" "lvs/lvol0"
|
||||
$spdkcli_job "/bdevs/logical_volume delete_all" "lvs/lvol1"
|
||||
$spdkcli_job "/lvol_stores delete lvs" "lvs"
|
||||
$spdkcli_job "/bdevs/logical_volume delete lvs0/lvol0" "lvs0/lvol0"
|
||||
$spdkcli_job "/bdevs/logical_volume delete_all" "lvs0/lvol1"
|
||||
$spdkcli_job "/lvol_stores delete lvs0" "lvs0"
|
||||
$spdkcli_job "/lvol_stores delete_all" "lvs1"
|
||||
$spdkcli_job "/bdevs/error delete EE_Malloc1" "EE_Malloc1"
|
||||
$spdkcli_job "/bdevs/error delete_all" "EE_Malloc4"
|
||||
$spdkcli_job "/bdevs/malloc delete Malloc0" "Malloc0"
|
||||
@ -92,18 +95,20 @@ timing_exit spdkcli_clear_config
|
||||
|
||||
timing_enter spdkcli_load_config
|
||||
$spdkcli_job "load_config $testdir/config.json"
|
||||
$spdkcli_job "/lvol_stores create lvs Malloc0" "lvs" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol0 16 lvs" "lvs/lvol0" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol1 16 lvs" "lvs/lvol1" True
|
||||
$spdkcli_job "/lvol_stores create lvs0 Malloc0" "lvs0" True
|
||||
$spdkcli_job "/lvol_stores create lvs1 Malloc5" "lvs1" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol0 16 lvs0" "lvs0/lvol0" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol1 16 lvs0" "lvs0/lvol1" True
|
||||
check_match
|
||||
$spdk_clear_config_py clear_config
|
||||
# FIXME: remove this sleep when NVMe driver will be fixed to wait for reset to complete
|
||||
sleep 2
|
||||
$spdkcli_job "load_subsystem_config $testdir/config_bdev.json"
|
||||
$spdkcli_job "load_subsystem_config $testdir/config_vhost.json"
|
||||
$spdkcli_job "/lvol_stores create lvs Malloc0" "lvs" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol0 16 lvs" "lvs/lvol0" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol1 16 lvs" "lvs/lvol1" True
|
||||
$spdkcli_job "/lvol_stores create lvs0 Malloc0" "lvs0" True
|
||||
$spdkcli_job "/lvol_stores create lvs1 Malloc5" "lvs1" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol0 16 lvs0" "lvs0/lvol0" True
|
||||
$spdkcli_job "/bdevs/logical_volume create lvol1 16 lvs0" "lvs0/lvol1" True
|
||||
check_match
|
||||
rm -f $testdir/config.json
|
||||
rm -f $testdir/config_bdev.json
|
||||
|
Loading…
x
Reference in New Issue
Block a user