Add tests for sending/receiving each opcode end-to-end using iscsi-test-cu

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
This commit is contained in:
Ronnie Sahlberg
2016-10-09 14:08:38 -07:00
parent 4d0c7559c0
commit 8ef4dc8f3a
37 changed files with 619 additions and 1 deletions

6
tests/functions.sh Normal file → Executable file
View File

@@ -19,7 +19,6 @@ start_target() {
sleep 1
${TGTADM} --op new --mode target --tid 1 -T ${IQNTARGET}
${TGTADM} --op bind --mode target --tid 1 -I ALL
#${TGTADM} --op show --mode target
}
shutdown_target() {
@@ -33,6 +32,7 @@ create_lun() {
# Setup LUN
truncate --size=100M ${TGTLUN}
${TGTADM} --op new --mode logicalunit --tid 1 --lun 1 -b ${TGTLUN} --blocksize=4096
${TGTADM} --op update --mode logicalunit --tid 1 --lun 1 --params thin_provisioning=1
}
delete_lun() {
@@ -59,6 +59,10 @@ remove_disk_lun() {
${TGTADM} --op delete --mode logicalunit --tid 1 --lun $1
}
set_lun_removable() {
${TGTADM} --op update --mode logicalunit --tid 1 --lun $1 --params removable=1
}
setup_chap() {
${TGTADM} --op new --mode account --user libiscsi --password libiscsi
${TGTADM} --op bind --mode account --tid 1 --user libiscsi

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu CompareAndWrite test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.CompareAndWrite ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.CompareAndWrite.* --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9001_extendedcopy.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ExtendedCopy test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ExtendedCopy ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ExtendedCopy.* --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9002_getlbatatus.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu GetLBAStatus test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.GetLBAStatus ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.GetLBAStatus.Simple --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9003_inquiry.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Inquiry test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Inquiry ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Inquiry --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

18
tests/test_9004_modesense6.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ModeSense6 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ModeSense6 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ModeSense6 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9005_orwrite.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu OrWrite test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.OrWrite ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.OrWrite.* --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9006_prefetch10.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Prefetch10 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Prefetch10 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Prefetch10.* --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9007_prefetch16.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Prefetch16 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Prefetch16 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Prefetch16 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9008_prinreadkeys.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu PrinReadKeys test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.PrinReadKeys ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.PrinReadKeys --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9009_read6.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Read6 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Read6 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Read6 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9010_read10.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Read10 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Read10 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Read10 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9011_read12.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Read12 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Read12 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Read12 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9012_read16.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Read16 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Read16 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Read16 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9013_verify10.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Verify10 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Verify10 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Verify10 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9014_verify12.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Verify12 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Verify12 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Verify12 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9015_verify16.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Verify16 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Verify16 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Verify16 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9016_write10.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Write10 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Write10 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Write10 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9017_write12.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Write12 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Write12 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Write12 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9018_write16.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Write16 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Write16 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Write16 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu WriteVerify16 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.WriteVerify16 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.WriteVerify16 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu WriteVerify12 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.WriteVerify12 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.WriteVerify12 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu WriteVerify16 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.WriteVerify16 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.WriteVerify16 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu TestUnitReady test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.TestUnitReady ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.TestUnitReady --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ReadCapacity10 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ReadCapacity10 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ReadCapacity10 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ReadCapacity16 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ReadCapacity16 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ReadCapacity16 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ReceiveCopyResults test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ReceiveCopyResults ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ReceiveCopyResults --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ReportSupportedOpcodes test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ReportSupportedOpcodes ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ReportSupportedOpcodes --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9027_unmap.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu Unmap test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.Unmap ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.Unmap --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ReadDefectData10 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ReadDefectData10 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ReadDefectData10 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ReadDefectData12 test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ReadDefectData12 ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ReadDefectData12 --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu PrinReportCapabilities test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.PrinReportCapabilities ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.PrinReportCapabilities --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ProutRegister test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ProutRegister ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ProutRegister --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9032_proutclear.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ProutClear test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ProutClear ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ProutClear --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

17
tests/test_9033_proutpreempt.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu ProutPreempt test"
start_target
create_disk_lun 1 100M
echo -n "SCSI.ProutPreempt ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.ProutPreempt --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,17 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu StartStopUnit test for fixed media"
start_target
create_disk_lun 1 100M
echo -n "SCSI.StartStopUnit ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.StartStopUnit --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0

View File

@@ -0,0 +1,18 @@
#!/bin/sh
. ./functions.sh
echo "iscsi-test-cu StartStopUnit test for removable media"
start_target
create_disk_lun 1 100M
set_lun_removable 1
echo -n "SCSI.StartStopUnit ... "
../test-tool/iscsi-test-cu -i ${IQNINITIATOR} iscsi://${TGTPORTAL}/${IQNTARGET}/1 -t SCSI.StartStopUnit --dataloss > /dev/null || failure
success
shutdown_target
delete_disk_lun 1
exit 0