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

Conversation

nickzhq
Copy link
Contributor

@nickzhq nickzhq commented Apr 16, 2025

No description provided.

@nickzhq nickzhq marked this pull request as draft April 16, 2025 13:12
@nickzhq
Copy link
Contributor Author

nickzhq commented Apr 16, 2025

Hello @qingwangrh @XueqiangWei @hellohellenmao @aliang123 , that's a demo case for usage about multi_targets.
I can set up a meeting later for introduction If you guys want.

@nickzhq
Copy link
Contributor Author

nickzhq commented Apr 17, 2025

Python 3.12.9 (main, Feb  4 2025, 00:00:00) [GCC 14.2.1 20250110 (Red Hat 14.2.1-7)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from virttest import data_dir
>>> from virttest.iscsi import Iscsi
>>> base_dir = data_dir.get_data_dir()
>>> params = {"iscsi_targets_luns": '{"iqn.xxxx-xx.com.example:target01a": {"portal_ip": "127.0.0.1", "iscsi_backend": "fileio", "default_lun": { "emulated_image": "images/basefile1a", "emulated_image_size": "1G", "iscsi_lun_attrs": "block_size=4096" }, }, "iqn.xxxx-xx.com.example:target02a": { "portal_ip": "127.0.0.1", "iscsi_backend": "fileio","default_lun": {"emulated_image": "images/basefile2a", "emulated_image_size": "1G", "iscsi_lun_attrs": "block_size=4096"}, }, }'}
>>> iscsi = Iscsi.create_iSCSI(params, base_dir)
>>> iscsi.login()
>>> targets = iscsi.query_targets()
>>> targets
['iqn.xxxx-xx.com.example:kvm-qe', 'iqn.xxxx-xx.com.example:target01-user', 'iqn.xxxx-xx.com.example:target01a', 'iqn.xxxx-xx.com.example:target02-user', 'iqn.xxxx-xx.com.example:target02a']
>>> dev_name = iscsi.get_device_names()
>>> dev_name
{'iqn.xxxx-xx.com.example:target01a': {'lun0': '/dev/sdf'}, 'iqn.xxxx-xx.com.example:target02a': {'lun0': '/dev/sdg'}}

cc @qingwangrh @XueqiangWei @hellohellenmao @aliang123

Signed-off-by: Houqi (Nick) Zuo <[email protected]>
@nickzhq nickzhq force-pushed the Demo_multi_targets branch from d8046b2 to a6bfe2a Compare April 17, 2025 05:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant