Add different log levels and update the TUR testsute.
Update the helper for testunitready() so that it
* prints FAILURE messages for normal and verbose levels
* prints selfdocumenting messages for which SCSI command it sends and the expected result for the verbose level
Dont call READCAPACITY from every single test.
Remove two arguments from the test signatures and turn them into globals.
remove the ret++ silliness. Tests return 0 : all ok, -2, skipped or -1 : test failed
As part of the test also validate the PDU that libiscsi generates and verify that
1, the PDU we send has the F flag set
2, that datasegmentlength for the PDU is one block
so that i/o from the initiator stops flowing and are just queued locally
until teh cmdsn window opens up again.
Send a lot of writes that block until we have processed the R2T
back from the target and verify we can still make process when we
have saturated the cmdsn window and are also blocked waiting for R2Ts.
gcc-4.6.3 warned about this one on several occasions:
gcc -DHAVE_CONFIG_H -I. -I. -I./include "-D_U_=__attribute__((unused))" -I./test-tool -Wall -W -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wwrite-strings -ggdb3 -O0 -MT test-tool/bin_iscsi_test-0000_testunitready_simple.o -MD -MP -MF test-tool/.deps/bin_iscsi_test-0000_testunitready_simple.Tpo -c -o test-tool/bin_iscsi_test-0000_testunitready_simple.o `test -f 'test-tool/0000_testunitready_simple.c' || echo './'`test-tool/0000_testunitready_simple.c
test-tool/0000_testunitready_simple.c: In function 'T0000_testunitready_simple':
test-tool/0000_testunitready_simple.c:23:44: warning: declaration of 'initiator' shadows a global declaration [-Wshadow]
test-tool/iscsi-test.h:20:20: warning: shadowed declaration is here [-Wshadow]
For now the global initiator is renamed to initiatorname1 (and initiator2 is
renamed to initiatorname2, respectively), but ultimately the globals should
probably go away.
While fixing this it also became apparent that initiator-name-2 was parsed
into the "initiator" variable as well.
Signed-off-by: Arne Redlich <arne.redlich@googlemail.com>
Send a large number of DATA-OUT PDUs that do not have a matching SCSI-COMMAND
PDU and verify that the target responds correctly. Either by terminating the
session or by just ignoring the data.
Verify also that the target is not "surprised" and crashes.
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>