]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | #!/usr/bin/env bash |
11fdf7f2 TL |
2 | rootdir=$(readlink -f $(dirname $0))/../.. |
3 | source "$rootdir/test/common/autotest_common.sh" | |
7c673cae FG |
4 | |
5 | set -e | |
6 | ||
11fdf7f2 TL |
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" | |
11 | ||
12 | case $1 in | |
13 | -h|--help) | |
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" | |
32 | echo "" | |
33 | echo "Environment:" | |
34 | echo " VM_IMAGE path to QCOW2 VM image used during test (default: $DEFAULT_VM_IMAGE)" | |
35 | echo "" | |
36 | echo "Tests are performed only on Linux machine. For other OS no action is performed." | |
37 | echo "" | |
38 | exit 0; | |
39 | ;; | |
40 | esac | |
41 | ||
42 | echo "Running SPDK vhost fio autotest..." | |
43 | if [[ $(uname -s) != Linux ]]; then | |
44 | echo "" | |
45 | echo "INFO: Vhost tests are only for Linux machine." | |
46 | echo "" | |
7c673cae FG |
47 | exit 0 |
48 | fi | |
49 | ||
11fdf7f2 TL |
50 | : ${VM_IMAGE="$DEFAULT_VM_IMAGE"} |
51 | : ${FIO_BIN="$DEFAULT_FIO_BIN"} | |
7c673cae | 52 | |
11fdf7f2 TL |
53 | if [[ ! -r "${VM_IMAGE}" ]]; then |
54 | echo "" | |
55 | echo "ERROR: VM image '${VM_IMAGE}' does not exist." | |
56 | echo "" | |
57 | exit 1 | |
7c673cae | 58 | fi |
11fdf7f2 TL |
59 | |
60 | DISKS_NUMBER=`lspci -mm -n | grep 0108 | tr -d '"' | awk -F " " '{print "0000:"$1}'| wc -l` | |
61 | ||
62 | WORKDIR=$(readlink -f $(dirname $0)) | |
63 | ||
64 | case $1 in | |
65 | -n|--negative) | |
66 | echo 'Negative tests suite...' | |
67 | run_test case $WORKDIR/other/negative.sh | |
68 | report_test_completion "vhost_negative" | |
69 | ;; | |
70 | -p|--performance) | |
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" | |
77 | ;; | |
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" | |
85 | ;; | |
86 | -m|--migration) | |
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 | |
90 | ;; | |
91 | -i|--integrity) | |
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" | |
98 | ;; | |
99 | -ib|--integrity-blk) | |
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" | |
106 | ;; | |
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" | |
111 | ;; | |
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" | |
116 | ;; | |
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" | |
122 | ;; | |
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" | |
128 | ;; | |
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 | |
134 | ||
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 | |
138 | fi | |
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 | |
143 | fi | |
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 | |
147 | ;; | |
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 | |
153 | ||
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 | |
157 | fi | |
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 | |
162 | fi | |
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 | |
166 | ;; | |
167 | -hp|--hotplug) | |
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" | |
177 | ;; | |
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 | |
186 | ;; | |
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 | |
195 | ;; | |
196 | -ro|--readonly) | |
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" | |
200 | ;; | |
201 | -b|--boot) | |
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" | |
205 | ;; | |
206 | *) | |
207 | echo "unknown test type: $1" | |
208 | exit 1 | |
209 | ;; | |
210 | esac |