Skip to content

[Draft] Test only #4303

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions qemu/tests/cfg/multi_targets.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
- multi_targets:
virt_test_type = qemu
type = multi_targets
only Windows
start_vm = no
kill_vm = yes
kill_vm_gracefully = yes
shutdown_cleanly = no
reboot_method = shell

iscsi_targets_luns = '{
"luns" : {
"xxxx": {
"emulated_image": "images/basefile1a",
"emulated_image_size": "1G",
"iscsi_lun_attrs": "block_size=4096",
},
"xxxx2": {
"emulated_image": "images/basefile2a",
"emulated_image_size": "1G",
"iscsi_lun_attrs": "block_size=4096",
},
},
"targets" : {
"iqn.xxxx-xx.xxx.xxxxxx:target01a": {
"portal_ip": "127.0.0.1",
"binding_luns" : ["xxxx"],
},
"iqn.xxxx-xx.xxx.xxxxxx:target02a": {
"portal_ip": "127.0.0.1",
"binding_luns" : ["xxxx2"],
},
},
}'
28 changes: 28 additions & 0 deletions qemu/tests/multi_targets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from virttest import data_dir
from virttest.iscsi import Iscsi


def run(test, params, env):
"""
Usage of multi-targets iscsi.


:param test: QEMU test object.
:param params: Dictionary with the test parameters.
:param env: Dictionary with test environment.
"""
base_dir = data_dir.get_data_dir()
iscsi = Iscsi.create_iSCSI(params, base_dir)
iscsi.login() # or iscsi.login(target=xxx)
# iscsi.export_target()
# or
# iscsi.export_target(target=xxx)
targets = iscsi.query_targets() # or iscsi.query_targets(target=xxx)
test.log.debug("iscsi.query_targets() returns: ")
test.log.debug(str(targets))

dev_name = iscsi.get_device_names() # or iscsi.get_device_names(target=xxx)
test.log.debug("iscsi.get_device_names() returns: ")
test.log.debug(str(dev_name))

iscsi.cleanup()
Loading