iotests/image-fleecing: rename tgt_node
Actually target of backup(sync=None) is not a final backup target: image fleecing is intended to be used with external tool, which will copy data from fleecing node to some real backup target. Also, we are going to add a test case for "push backup with fleecing", where instead of exporting fleecing node by NBD, we'll start a backup job from fleecing node to real backup target. To avoid confusion, let's rename temporary fleecing node now. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-Id: <20210824083856.17408-32-vsementsov@virtuozzo.com> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
This commit is contained in:
parent
b23c3b1459
commit
66b63809fa
@ -71,6 +71,7 @@ with iotests.FilePath('base.img') as base_img_path, \
|
||||
log('')
|
||||
|
||||
src_node = 'source'
|
||||
tmp_node = 'temp'
|
||||
vm.add_blockdev(f'driver={iotests.imgfmt},file.driver=file,'
|
||||
f'file.filename={base_img_path},node-name={src_node}')
|
||||
vm.add_device('virtio-scsi')
|
||||
@ -82,12 +83,11 @@ with iotests.FilePath('base.img') as base_img_path, \
|
||||
log('--- Setting up Fleecing Graph ---')
|
||||
log('')
|
||||
|
||||
tgt_node = 'fleeceNode'
|
||||
|
||||
# create tgt_node backed by src_node
|
||||
# create tmp_node backed by src_node
|
||||
log(vm.qmp('blockdev-add', {
|
||||
'driver': 'qcow2',
|
||||
'node-name': tgt_node,
|
||||
'node-name': tmp_node,
|
||||
'file': {
|
||||
'driver': 'file',
|
||||
'filename': fleece_img_path,
|
||||
@ -99,19 +99,19 @@ with iotests.FilePath('base.img') as base_img_path, \
|
||||
log(vm.qmp('blockdev-backup',
|
||||
job_id='fleecing',
|
||||
device=src_node,
|
||||
target=tgt_node,
|
||||
target=tmp_node,
|
||||
sync='none'))
|
||||
|
||||
log('')
|
||||
log('--- Setting up NBD Export ---')
|
||||
log('')
|
||||
|
||||
nbd_uri = 'nbd+unix:///%s?socket=%s' % (tgt_node, nbd_sock_path)
|
||||
nbd_uri = 'nbd+unix:///%s?socket=%s' % (tmp_node, nbd_sock_path)
|
||||
log(vm.qmp('nbd-server-start',
|
||||
{'addr': { 'type': 'unix',
|
||||
'data': { 'path': nbd_sock_path } } }))
|
||||
|
||||
log(vm.qmp('nbd-server-add', device=tgt_node))
|
||||
log(vm.qmp('nbd-server-add', device=tmp_node))
|
||||
|
||||
log('')
|
||||
log('--- Sanity Check ---')
|
||||
@ -149,7 +149,7 @@ with iotests.FilePath('base.img') as base_img_path, \
|
||||
assert e is not None
|
||||
log(e, filters=[iotests.filter_qmp_event])
|
||||
log(vm.qmp('nbd-server-stop'))
|
||||
log(vm.qmp('blockdev-del', node_name=tgt_node))
|
||||
log(vm.qmp('blockdev-del', node_name=tmp_node))
|
||||
vm.shutdown()
|
||||
|
||||
log('')
|
||||
|
Loading…
Reference in New Issue
Block a user