File tree 2 files changed +58
-0
lines changed
2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ - multi_targets:
2
+ virt_test_type = qemu
3
+ type = multi_targets
4
+ only Windows
5
+ start_vm = no
6
+ kill_vm = yes
7
+ kill_vm_gracefully = yes
8
+ shutdown_cleanly = no
9
+ reboot_method = shell
10
+
11
+ iscsi_targets_luns = ' {
12
+ "iqn.2019-12.com.redhat:target01a": {
13
+ "portal_ip": "127.0.0.1",
14
+ "iscsi_backend": "fileio"
15
+ "default_lun": {
16
+ "emulated_image": "images/basefile1a",
17
+ "emulated_image_size": "1G",
18
+ "iscsi_lun_attrs": "block_size=4096"
19
+ },
20
+ },
21
+ "iqn.2019-12.com.redhat:target02a": {
22
+ "portal_ip": "127.0.0.1",
23
+ "iscsi_backend": "fileio"
24
+ "default_lun": {
25
+ "emulated_image": "images/basefile2a",
26
+ "emulated_image_size": "1G",
27
+ "iscsi_lun_attrs": "block_size=4096"
28
+ },
29
+ },
30
+ }'
Original file line number Diff line number Diff line change
1
+ from virttest import data_dir
2
+ from virttest .iscsi import Iscsi
3
+
4
+
5
+ def run (test , params , env ):
6
+ """
7
+ Usage of multi-targets iscsi.
8
+
9
+
10
+ :param test: QEMU test object.
11
+ :param params: Dictionary with the test parameters.
12
+ :param env: Dictionary with test environment.
13
+ """
14
+ base_dir = data_dir .get_data_dir ()
15
+ iscsi = Iscsi .create_iSCSI (params , base_dir )
16
+ iscsi .login () # or iscsi.login(target=xxx)
17
+ # iscsi.export_target()
18
+ # or
19
+ # iscsi.export_target(target=xxx)
20
+ targets = iscsi .query_targets () # or iscsi.query_targets(target=xxx)
21
+ test .log .debug ("iscsi.query_targets() returns: " )
22
+ test .log .debug (str (targets ))
23
+
24
+ dev_name = iscsi .get_device_names () # or iscsi.get_device_names(target=xxx)
25
+ test .log .debug ("iscsi.get_device_names() returns: " )
26
+ test .log .debug (str (dev_name ))
27
+
28
+ iscsi .cleanup ()
You can’t perform that action at this time.
0 commit comments