3 testdir
=$
(readlink
-f $
(dirname $0))
4 rootdir
=$
(readlink
-f $testdir/..
/..
/..
)
5 source $rootdir/test
/common
/autotest_common.sh
6 source $rootdir/test
/vhost
/common.sh
8 # Tested with windows vm with OS Name: Microsoft Windows Server 2012 R2 Datacenter
9 # and OS Version: 6.3.9600 N/A Build 9600
10 # In order to run this test with windows vm
11 # windows virtio scsi driver must be installed
12 WINDOWS_IMG
="/home/sys_sgsw/windows_scsi_compliance/windows_vm_image.qcow2"
13 aio_file
="$SPDK_TEST_STORAGE/aio_disk"
16 keep_results_dir
=false
17 rpc_py
="$rootdir/scripts/rpc.py -s $(get_vhost_dir 0)/rpc.sock"
24 echo "Windows Server scsi compliance test"
25 echo "Usage: $(basename $1) [OPTIONS]"
26 echo " --vm-ssh-pass=PASSWORD Text password for the VM"
27 echo " --vm-image-path Path of windows image"
28 echo " --keep_results Do not delete dir with results"
33 while getopts 'h-:' optchar
; do
38 vm-ssh-pass
=*) ssh_pass
="${OPTARG#*=}" ;;
39 vm-image-path
=*) WINDOWS_IMG
="${OPTARG#*=}" ;;
40 keep_results
*) keep_results_dir
=true
;;
44 *) usage
$0 "Invalid argument '$OPTARG'" ;;
48 trap 'rm -f $aio_file; rm -rf $testdir/results; error_exit' SIGINT SIGTERM ERR
50 VM_PASSWORD
="$ssh_pass"
51 mkdir
-p $testdir/results
52 dd if=/dev
/zero of
=$aio_file bs
=1M count
=512
54 timing_enter vhost_run
56 $rpc_py bdev_nvme_set_hotplug
-e
57 $rpc_py bdev_malloc_create
256 4096 -b Malloc0
58 $rpc_py bdev_aio_create
$aio_file Aio0
512
59 $rpc_py bdev_get_bdevs
60 $rpc_py vhost_create_scsi_controller naa.vhost
.1
61 $rpc_py vhost_scsi_controller_add_target naa.vhost
.1 0 Nvme0n1
62 $rpc_py vhost_scsi_controller_add_target naa.vhost
.1 1 Malloc0
63 # TODO: Currently there is bug for aio device. Disable this test
64 # $rpc_py vhost_scsi_controller_add_target naa.vhost.1 2 Aio0
68 vm_setup
--force=1 --disk-type=spdk_vhost_scsi
--os=$WINDOWS_IMG --disks=vhost
--memory=4096
70 # Wait until VM goes up
71 vm_wait_for_boot
"300" "$vm_num"
74 vm_scp
"$vm_num" $testdir/windows_scsi_compliance.ps1
127.0.0.1:/cygdrive
/c
/SCSI
/
75 vm_sshpass
"$vm_num" "$ssh_pass" "cd /cygdrive/c/SCSI; powershell.exe -file windows_scsi_compliance.ps1"
76 vm_scp
"$vm_num" 127.0.0.1:/cygdrive
/c
/SCSI
/WIN_SCSI_
* $testdir/results
/
77 dos2unix
$testdir/results
/WIN_SCSI_
*.log
83 notice
"Remove $aio_file"
86 python3
$testdir/windows_scsi_compliance.py
87 if ! $keep_results_dir; then
88 rm -rf $testdir/results