]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/test/vhost/spdk_vhost.sh
2 rootdir
=$
(readlink
-f $
(dirname $0))/..
/..
3 source "$rootdir/test/common/autotest_common.sh"
7 DEFAULT_VM_IMAGE
="/home/sys_sgsw/vhost_vm_image.qcow2"
8 CENTOS_VM_IMAGE
="/home/sys_sgsw/spdk_vhost_CentOS_vm_image.qcow2"
9 DEFAULT_FIO_BIN
="/home/sys_sgsw/fio_ubuntu"
10 CENTOS_FIO_BIN
="/home/sys_sgsw/fio_ubuntu_bak"
14 echo "usage: $(basename $0) TEST_TYPE"
15 echo "Test type can be:"
16 echo " -i |--integrity for running an integrity test with vhost scsi"
17 echo " -fs|--fs-integrity-scsi for running an integrity test with filesystem"
18 echo " -fb|--fs-integrity-blk for running an integrity test with filesystem"
19 echo " -p |--performance for running a performance test with vhost scsi"
20 echo " -ib|--integrity-blk for running an integrity test with vhost blk"
21 echo " -pb|--performance-blk for running a performance test with vhost blk"
22 echo " -ils|--integrity-lvol-scsi for running an integrity test with vhost scsi and lvol backends"
23 echo " -ilb|--integrity-lvol-blk for running an integrity test with vhost blk and lvol backends"
24 echo " -ilsn|--integrity-lvol-scsi-nightly for running an nightly integrity test with vhost scsi and lvol backends"
25 echo " -ilbn|--integrity-lvol-blk-nightly for running an nightly integrity test with vhost blk and lvol backends"
26 echo " -hp|--hotplug for running hotplug tests"
27 echo " -shr|--scsi-hot-remove for running scsi hot remove tests"
28 echo " -bhr|--blk-hot-remove for running blk hot remove tests"
29 echo " -ro|--readonly for running readonly test for vhost blk"
30 echo " -b|--boot for booting vm from vhost controller"
31 echo " -h |--help prints this message"
34 echo " VM_IMAGE path to QCOW2 VM image used during test (default: $DEFAULT_VM_IMAGE)"
36 echo "Tests are performed only on Linux machine. For other OS no action is performed."
42 echo "Running SPDK vhost fio autotest..."
43 if [[ $
(uname
-s) != Linux
]]; then
45 echo "INFO: Vhost tests are only for Linux machine."
50 : ${VM_IMAGE="$DEFAULT_VM_IMAGE"}
51 : ${FIO_BIN="$DEFAULT_FIO_BIN"}
53 if [[ ! -r "${VM_IMAGE}" ]]; then
55 echo "ERROR: VM image '${VM_IMAGE}' does not exist."
60 DISKS_NUMBER
=`lspci -mm -n | grep 0108 | tr -d '"' | awk -F " " '{print "0000:"$1}'| wc -l`
62 WORKDIR
=$
(readlink
-f $
(dirname $0))
66 echo 'Negative tests suite...'
67 run_test
case $WORKDIR/other
/negative.sh
68 report_test_completion
"vhost_negative"
71 echo 'Running performance suite...'
72 run_test
case $WORKDIR/fiotest
/autotest.sh
--fio-bin=$FIO_BIN \
73 --vm=0,$VM_IMAGE,Nvme0n1p0 \
74 --test-type=spdk_vhost_scsi \
75 --fio-job=$WORKDIR/common
/fio_jobs
/default_performance.job
76 report_test_completion
"vhost_perf"
78 -pb|
--performance-blk)
79 echo 'Running blk performance suite...'
80 run_test
case $WORKDIR/fiotest
/autotest.sh
--fio-bin=$FIO_BIN \
81 --vm=0,$VM_IMAGE,Nvme0n1p0 \
82 --test-type=spdk_vhost_blk \
83 --fio-job=$WORKDIR/common
/fio_jobs
/default_performance.job
84 report_test_completion
"vhost_perf_blk"
87 echo 'Running migration suite...'
88 run_test
case $WORKDIR/migration
/migration.sh
-x \
89 --fio-bin=$FIO_BIN --os=$VM_IMAGE --test-cases=1,2
92 echo 'Running SCSI integrity suite...'
93 run_test
case $WORKDIR/fiotest
/autotest.sh
-x --fio-bin=$FIO_BIN \
94 --vm=0,$VM_IMAGE,Nvme0n1p0
:Nvme0n1p1
:Nvme0n1p2
:Nvme0n1p3 \
95 --test-type=spdk_vhost_scsi \
96 --fio-job=$WORKDIR/common
/fio_jobs
/default_integrity.job
97 report_test_completion
"nightly_vhost_integrity"
100 echo 'Running blk integrity suite...'
101 run_test
case $WORKDIR/fiotest
/autotest.sh
-x --fio-bin=$FIO_BIN \
102 --vm=0,$VM_IMAGE,Nvme0n1p0
:Nvme0n1p1
:Nvme0n1p2
:Nvme0n1p3 \
103 --test-type=spdk_vhost_blk \
104 --fio-job=$WORKDIR/common
/fio_jobs
/default_integrity.job
105 report_test_completion
"nightly_vhost_integrity_blk"
107 -fs|
--fs-integrity-scsi)
108 echo 'Running filesystem integrity suite with SCSI...'
109 run_test
case $WORKDIR/integrity
/integrity_start.sh
--ctrl-type=spdk_vhost_scsi
--fs="xfs ntfs btrfs ext4"
110 report_test_completion
"vhost_fs_integrity_scsi"
112 -fb|
--fs-integrity-blk)
113 echo 'Running filesystem integrity suite with BLK...'
114 run_test
case $WORKDIR/integrity
/integrity_start.sh
--ctrl-type=spdk_vhost_blk
--fs="xfs ntfs btrfs ext4"
115 report_test_completion
"vhost_fs_integrity_blk"
117 -ils|
--integrity-lvol-scsi)
118 echo 'Running lvol integrity suite...'
119 run_test
case $WORKDIR/lvol
/lvol_test.sh
-x --fio-bin=$FIO_BIN \
120 --ctrl-type=spdk_vhost_scsi
--thin-provisioning
121 report_test_completion
"vhost_integrity_lvol_scsi"
123 -ilb|
--integrity-lvol-blk)
124 echo 'Running lvol integrity suite...'
125 run_test
case $WORKDIR/lvol
/lvol_test.sh
-x --fio-bin=$FIO_BIN \
126 --ctrl-type=spdk_vhost_blk
127 report_test_completion
"vhost_integrity_lvol_blk"
129 -ilsn|
--integrity-lvol-scsi-nightly)
130 if [[ $DISKS_NUMBER -ge 2 ]]; then
131 echo 'Running lvol integrity nightly suite with two cores and two controllers'
132 run_test
case $WORKDIR/lvol
/lvol_test.sh
--fio-bin=$FIO_BIN \
133 --ctrl-type=spdk_vhost_scsi
--max-disks=2 --distribute-cores --vm-count=2
135 echo 'Running lvol integrity nightly suite with one core and two controllers'
136 run_test
case $WORKDIR/lvol
/lvol_test.sh
--fio-bin=$FIO_BIN \
137 --ctrl-type=spdk_vhost_scsi
--max-disks=2 --vm-count=2
139 if [[ -e $CENTOS_VM_IMAGE ]]; then
140 echo 'Running lvol integrity nightly suite with different os types'
141 run_test
case $WORKDIR/lvol
/lvol_test.sh
--fio-bin=$CENTOS_FIO_BIN \
142 --ctrl-type=spdk_vhost_scsi
--vm-count=2 --multi-os
144 echo 'Running lvol integrity nightly suite with one core and one controller'
145 run_test
case $WORKDIR/lvol
/lvol_test.sh
--fio-bin=$FIO_BIN \
146 --ctrl-type=spdk_vhost_scsi
--max-disks=1
148 -ilbn|
--integrity-lvol-blk-nightly)
149 if [[ $DISKS_NUMBER -ge 2 ]]; then
150 echo 'Running lvol integrity nightly suite with two cores and two controllers'
151 run_test
case $WORKDIR/lvol
/lvol_test.sh
--fio-bin=$FIO_BIN \
152 --ctrl-type=spdk_vhost_blk
--max-disks=2 --distribute-cores --vm-count=2
154 echo 'Running lvol integrity nightly suite with one core and two controllers'
155 run_test
case $WORKDIR/lvol
/lvol_test.sh
--fio-bin=$FIO_BIN \
156 --ctrl-type=spdk_vhost_blk
--max-disks=2 --vm-count=2
158 if [[ -e $CENTOS_VM_IMAGE ]]; then
159 echo 'Running lvol integrity nightly suite with different os types'
160 run_test
case $WORKDIR/lvol
/lvol_test.sh
--fio-bin=$CENTOS_FIO_BIN \
161 --ctrl-type=spdk_vhost_blk
--vm-count=2 --multi-os
163 echo 'Running lvol integrity nightly suite with one core and one controller'
164 run_test
case $WORKDIR/lvol
/lvol_test.sh
--fio-bin=$FIO_BIN \
165 --ctrl-type=spdk_vhost_blk
--max-disks=1
168 echo 'Running hotplug tests suite...'
169 run_test
case $WORKDIR/hotplug
/scsi_hotplug.sh
--fio-bin=$FIO_BIN \
170 --vm=0,$VM_IMAGE,Nvme0n1p0
:Nvme0n1p1 \
171 --vm=1,$VM_IMAGE,Nvme0n1p2
:Nvme0n1p3 \
172 --vm=2,$VM_IMAGE,Nvme0n1p4
:Nvme0n1p5 \
173 --vm=3,$VM_IMAGE,Nvme0n1p6
:Nvme0n1p7 \
174 --test-type=spdk_vhost_scsi \
175 --fio-jobs=$WORKDIR/hotplug
/fio_jobs
/default_integrity.job
-x
176 report_test_completion
"vhost_hotplug"
178 -shr|
--scsi-hot-remove)
179 echo 'Running scsi hotremove tests suite...'
180 run_test
case $WORKDIR/hotplug
/scsi_hotplug.sh
--fio-bin=$FIO_BIN \
181 --vm=0,$VM_IMAGE,Nvme0n1p0
:Nvme0n1p1 \
182 --vm=1,$VM_IMAGE,Nvme0n1p2
:Nvme0n1p3 \
183 --test-type=spdk_vhost_scsi \
184 --scsi-hotremove-test \
185 --fio-jobs=$WORKDIR/hotplug
/fio_jobs
/default_integrity.job
187 -bhr|
--blk-hot-remove)
188 echo 'Running blk hotremove tests suite...'
189 run_test
case $WORKDIR/hotplug
/scsi_hotplug.sh
--fio-bin=$FIO_BIN \
190 --vm=0,$VM_IMAGE,Nvme0n1p0
:Nvme0n1p1 \
191 --vm=1,$VM_IMAGE,Nvme0n1p2
:Nvme0n1p3 \
192 --test-type=spdk_vhost_blk \
193 --blk-hotremove-test \
194 --fio-jobs=$WORKDIR/hotplug
/fio_jobs
/default_integrity.job
197 echo 'Running readonly tests suite...'
198 run_test
case $WORKDIR/readonly
/readonly.sh
--vm_image=$VM_IMAGE --disk=Nvme0n1
-x
199 report_test_completion
"vhost_readonly"
202 echo 'Running os boot from vhost controller...'
203 $WORKDIR/vhost_boot
/vhost_boot.sh
--vm_image=$VM_IMAGE
204 report_test_completion
"vhost_boot"
207 echo "unknown test type: $1"