summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLee Duncan <lduncan@suse.com>2022-02-27 12:18:22 -0800
committerLee Duncan <lduncan@suse.com>2022-03-01 10:43:45 -0800
commit87729e74cb28e7ae84dd109e1b7d91c3c36b839b (patch)
tree3332edc79a464fc9c20c6894a5868af517a0c31a /test
parent95c090bebde3c3988c6d4c903d3cbbb379675014 (diff)
downloadopen-iscsi-87729e74cb28e7ae84dd109e1b7d91c3c36b839b.tar.gz
test: Add new README, update old README and TODO
The new README is about the python test suite. Update the old README to mention the new one. Also, clean up the TODO list and add a couple of items.
Diffstat (limited to 'test')
-rw-r--r--test/README220
-rw-r--r--test/README.orig11
-rw-r--r--test/TODO24
3 files changed, 237 insertions, 18 deletions
diff --git a/test/README b/test/README
new file mode 100644
index 0000000..2c7c2e9
--- /dev/null
+++ b/test/README
@@ -0,0 +1,220 @@
+---------------------------------------------------------------------------
+README
+======
+
+Setting up the tests
+--------------------
+
+ This is the README for the updated "test" open-iscsi subdirectory.
+
+ Note that these tests are *not* performance tests. So no
+ attempt is made to track or display how long each test takes,
+ so it is not currently possible to track any improvement
+ nor degredation in IO performance. Please feel free to
+ add tests to measure performance, if you wish.
+
+ The tests here are based on the python unittest package. Please use
+ the included "test-open-iscsi.py" python script to run the tests.
+ You can run:
+
+ # ./test-open-iscsi.py --help
+
+ to get a list of options for this script. You will need the following
+ packages or commands to run these tests:
+
+ * fio
+ * bonie++
+ * mkfs.FSTYPE (e.g. mkfs.ext3)
+ * sgdisk
+ * dd
+ * parted
+ * mount/umount
+ * iscsiadm (with the iscsid daemon or service running) [of course]
+
+
+Running the tests
+-----------------
+
+ You will also need to know the IQN (name) of an accesable iscsi target,
+ set up with appropriate access controls so that you can log into it,
+ as well as the IP address where you can access this
+ target, and you will need to know which SCSI disk will show in in
+ /dev for this target (e.g. "/dev/sdc", if you already have a "/dev/sda"
+ and a "/dev/sdb"). You will need to pass in this information to the
+ python script to test. For example, to run all tests on my test
+ system (as root, of course):
+
+ # ./test-open-iscsi.py -v -f \
+ -t iqn.2003-01.org.linux-iscsi.linux-o2br.x8664:sn.2296be998e2c \
+ -i 192.168.20.168 \
+ -D /dev/sdc
+
+ This can take quite a while to run (how long on my server?). << TODO XXX
+
+ The data on your target iSCSI disc will be wiped, so don't use a target
+ that has data you wish to save. As far as the size of the target, I
+ set up a 10G block-based iscsi target. Having a larger target makes
+ the test run take longer, though. I believe 1G or even 100M might work?
+
+ Instead of running all the tests, one can instead run a subtest, since
+ the unittest package supports this. To get a list of the tests, run:
+
+ # ./test-open-iscsi.py -l
+ test_HdrDigest_on_DataDigest_off (harness.tests.TestRegression)
+ test_HdrDigest_on_DataDigest_on (harness.tests.TestRegression)
+ test_InitialR2T_off_ImmediateData_off (harness.tests.TestRegression)
+ test_InitialR2T_off_ImmediateData_on (harness.tests.TestRegression)
+ test_InitialR2T_on_ImmediateData_off (harness.tests.TestRegression)
+ test_InitialR2T_on_ImmediateData_on (harness.tests.TestRegression)
+
+ I believe the names are self-explanitory. (If not, submit a pull
+ request or let me know.)
+
+ There are 6 test groups, all coming from one test script file (in
+ harness/tests.py), and that are in the the TestRegression python class.
+
+ [In the future, one can add more tests to this class, and other
+ classes to test things besides regression (like functionality,
+ bug-fix detection, etc).]
+
+ Here's an exmaple of running just the "test_InitialR2T_off_ImmediateData_off"
+ subtest:
+
+ # ./test-open-iscsi.py -v -f \
+ -t iqn.2003-01.org.linux-iscsi.linux-o2br.x8664:sn.2296be998e2c \
+ -i 192.168.20.168 \
+ -D /dev/sdc \
+ test_InitialR2T_off_ImmediateData_off
+
+ ... (start of the output goes here) << TODO XXX
+
+ One can also specify the list of subtests (by number) for each test,
+ further reducing test executing amount and time, if one wishes, using
+ the "-l/--list" option. Each subtest specifies a different
+ combination of FirstBurst, MaxBurstLength, and MaxRecv for the IO test.
+ Here's a list of the subest values:
+
+ Subtest [FirstBurstLength, MaxBurstLength, MaxRecvDataSegmentLength]
+ 1 4096 4096 4096
+ 2 8192 4096 4096
+ 3 16384 4096 4096
+ 4 32768 4096 4096
+ 5 65536 4096 4096
+ 6 131972 4096 4096
+ 7 4096 8192 4096
+ 8 4096 16384 4096
+ 9 4096 32768 4096
+ 10 4096 65536 4096
+ 11 4096 131072 4096
+ 12 4096 4096 8192
+ 13 4096 4096 16384
+ 14 4096 4096 32768
+ 15 4096 4096 65536
+ 16 4096 4096 131072
+
+ So to run subtest 7 through 11 of test_InitialR2T_off_ImmediateData_off:
+
+ # ... (fill in) << TODO XXX
+
+ Lastly, one can reduce the number of tests run (and hence the length of
+ time spent testing) by specifying the block size to test with during
+ IO testing. By default the script uses an array of block sizes:
+
+ [512,1k,2k,4k,8k,16k,32k,75536,128k,1000000]
+
+ Using this is left an exercise for the reader. :)
+
+
+Test Descriptsions
+------------------
+
+ The "regression" test sequence was laid out in regression.sh (the
+ previous test script, still around for reference). I am not sure
+ why we still call it a regression test, when it does not in fact
+ check for any regression in performance. Instead, it tests
+ functionality.
+
+ Each iscsi test has the following default values
+ (called "IscsiData()" in the test suite). These correspond to
+ the default values usually found in open-iscsi:
+
+ Immediate Data = on
+ Initial Request to Transmit = off
+ Header Digest = 'None,CRC32C' (i.e. off by default)
+ Data Digest = 'None,CRC32C' (i.e. off by default)
+ First Burst Length = 256k
+ Max Burst Length = (16 Meg - 1k)
+ Max Receive Data Length = 128k
+ Max Request to Transmit = 1
+
+ but one or more of these values can be overwritten for each test.
+
+ The current test suite is laid out like this:
+
+ test_HdrDigest_on_DataDigest_off (harness.tests.TestRegression)
+
+ This tests the Header Digest functionality, by itself.
+
+ test_HdrDigest_on_DataDigest_on (harness.tests.TestRegression)
+
+ This one tests both the Header and Data Digest functionality,
+ together
+
+ test_InitialR2T_off_ImmediateData_off (harness.tests.TestRegression)
+
+ Test both Initial Rquest to Transmit and Imediate data off
+
+ test_InitialR2T_off_ImmediateData_on (harness.tests.TestRegression)
+
+ Test with Initial Request to Transmit off but Imeediate Data
+ on. (This is the default configuration)
+
+ test_InitialR2T_on_ImmediateData_off (harness.tests.TestRegression)
+
+ Test Initial Request to Transmit on but Imediate Data off
+
+ test_InitialR2T_on_ImmediateData_on (harness.tests.TestRegression)
+
+ Test with both Initial Request to Transmit and Immediate Data
+ on.
+
+ For each test run (from this list above), we perform the following tests:
+
+ - Use "iscsiadm" to log into the iscsi target and wait for the
+ device to show up
+ - Run "fio" on the raw disc device
+ This is done 16 times, one for each subtest (see above)
+ Each of these 16 tests has 10 different block sizes used
+ (see above)
+ fio actually does (for each block size):
+ - fio read test (8 threads)
+ - fio write test (8 threads)
+ - fio verify test (1 thread)
+ - Run "parted" to partition
+ This actually first runs "sgdisk" then "dd" to wipe the disc,
+ then runs "parted" make a label then partition it, then
+ waits for the partition to show up.
+ - Run "mkfs" to create a filesystem (EXT3 by default)
+ - Run "bonnie++" on the created filesystem
+
+ For the math-friendly out there, I believe this adds up to about
+ 960 tests (10x16x6). By far the slowest part of the tests seems
+ to be wiping the discs clean of a label or partitions. Perhaps this
+ can be sped up?
+
+ The following things can be overridden in the environment, if you
+ wish, by setting the appropriate environment variable before running
+ the test script:
+
+ env. var. default meaning
+ --------- ------- -------
+ FSTYPE "ext3" filesystem type to create
+ MOUNTOPTIONS "-t FSTYPE" "-t FSTYPE" is added to whatever
+ options you pass in, if any
+ MKFSCMD "mkfs.FSTYPE" which mkfs command to call
+ MKFSOPTS <none> options too add to mkfs call,
+ if any
+ BONNIEPARAMS "-r0 -n10:0:0 -s16 -uroot -f -q"
+ params used when running bonnie++
+
+---------------------------------------------------------------------------
diff --git a/test/README.orig b/test/README.orig
index af54c3c..a046b01 100644
--- a/test/README.orig
+++ b/test/README.orig
@@ -1,3 +1,14 @@
+---------------------------------------------------------------------------
+A Note from current open-iscsi maintainer Lee Duncan:
+
+README.orig:
+ This is the old README for the "test" subdirectory, directed
+ at being able to use the "regressioin..sh" shell script. But
+ I no longer maintain the shell script, much preferring the
+ python unittest package. Please see the new README file
+ for how to use that package. (2/2022)
+---------------------------------------------------------------------------
+
From the original test/README:
---------------------------------------------------------------------------
This directory contains regression suite.
diff --git a/test/TODO b/test/TODO
index 096f250..516d25e 100644
--- a/test/TODO
+++ b/test/TODO
@@ -2,14 +2,6 @@
# Things to do for testing
#
-* get current tests running
- * this will mean replacing disktest with something
- (like fio?)
-
- PASS -- no need to spend time getting disktest working
- when (1) it's hard to find, and (2) it's going to be
- replaced anyway.
-
* ensure user is root? -- easy to do
* have tests create their own target using targetcli and
@@ -21,9 +13,6 @@
that to be done already. Either way, we may still need
to know the IQN of our target and the host where it lives.
- PASS -- we still would have to know two things (IQN and
- IP:Port). See next item.
-
* Have tests figure out the device path, so it doesn't have
to be passed in. Passing it in requires the called to
login to the remote iscsi target and look at the path
@@ -58,11 +47,10 @@
* Add back in the "big warning" from regression.sh?
-* Add info to the README about how to run the python tests
-
-* Leave the regression test around, for now? It doesn't run,
- so maybe it should just be removed?
+* Find a faster way to zero the disc than using sgdisk and
+ dd. Running both of these on a 10G disc can take minutes.
-* Add in option to specify which subtests (of 16) are run
- for each test case. Would make it much faster for testing
- and go/no-go testing?
+* Come up with some common subsets of tests that can be run
+ when needed, since running all the tests takes forever. Maybe
+ a "short", "medium", and "long" option, so the caller doesn't
+ have to remember the arcane command-line options?